Skip to contents

Dataset used

  • atlantic_butterflies

Introduction

The atlantic_butterflies data set contains

Data exploration

Citations

Santos et al. 2018. Atlantic butterflies: a data set of fruit-feeding butterfly communities from the Atlantic forests. Ecology, 99(12), e02785. https://doi.org/10.1002/ecy.2507

How we processed the raw data

Download data from Ecology

# download
# download data from https://esajournals.onlinelibrary.wiley.com/doi/full/10.1002/ecy.2507

# unzip
unzip(zipfile = "data-raw/ecy2507-sup-0001-datas1.zip", exdir = "data-raw")

Data cleaning

# fix
readr::read_delim("data-raw/ATLANTIC_BUTTERFLIES_sites.csv", delim = ";",
                  locale = readr::locale(encoding = "latin1")) %>%
    readr::write_csv("data-raw/ATLANTIC_BUTTERFLIES_sites.csv")

readr::read_delim("data-raw/ATLANTIC_BUTTERFLIES_species.csv", delim = ";",
                  locale = readr::locale(encoding = "latin1")) %>%
    dplyr::select(1:9) %>%
    readr::write_csv("data-raw/ATLANTIC_BUTTERFLIES_species.csv")

readr::read_delim("data-raw/ATLANTIC_BUTTERFLIES_references.csv", delim = ";",
                  locale = readr::locale(encoding = "latin1")) %>%
    readr::write_csv("data-raw/ATLANTIC_BUTTERFLIES_references.csv")

# import data
atlantic_butterflies_sites <- readr::read_delim("data-raw/ATLANTIC_BUTTERFLIES_sites.csv") %>%
    janitor::clean_names()

atlantic_butterflies_species <- readr::read_csv("data-raw/ATLANTIC_BUTTERFLIES_species.csv") %>%
    janitor::clean_names()

atlantic_butterflies_references <- readr::read_delim("data-raw/ATLANTIC_BUTTERFLIES_references.csv") %>%
    janitor::clean_names()

# combine data
atlantic_butterflies <- atlantic_butterflies_sites %>%
    dplyr::left_join(atlantic_butterflies_species)