Skip to content

Commit

Permalink
remove list columns in data_bird
Browse files Browse the repository at this point in the history
  • Loading branch information
daijiang committed Apr 6, 2022
1 parent b2f9489 commit 4df118a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.DS_Store
data-raw/NEON_raw_data
data-raw/neon_div_data
data-raw/edi
2 changes: 2 additions & 0 deletions data-raw/02_data_to_neonDivData.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ read_data_package <- function(
# read in all data in data_catalog, make a list of flat tables
data_all <- read_data_package(in_dir = my_in_dir)
names(data_all)
# Bird data has columns as lists
data_all <- map(data_all, function(x) unnest(x))

# d_fish = read_data_package(taxon_groups = "FISH", return_flat_tables = T)
# data_all$FISH_neon.ecocomdp.20107.001.001.20210306180225.RDS <- d_fish$FISH_neon.ecocomdp.20107.001.001.20210306180225
Expand Down
30 changes: 15 additions & 15 deletions data-raw/03_save_to_EDI.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ library(dplyr)
table(data_algae$release)

# save all flatterned data frames to csv
write.csv(filter(data_algae, release != "PROVISIONAL"), file = "data_algae.csv")
write.csv(filter(data_beetle, release != "PROVISIONAL"), file = "data_beetle.csv")
write.csv(filter(data_bird, release != "PROVISIONAL"), file = "data_bird.csv")
write.csv(filter(data_fish, release != "PROVISIONAL"), file = "data_fish.csv")
write.csv(filter(data_herp_bycatch, release != "PROVISIONAL"), file = "data_herp_bycatch.csv")
write.csv(filter(data_macroinvertebrate, release != "PROVISIONAL"), file = "data_macroinvertebrate.csv")
write.csv(filter(data_mosquito, release != "PROVISIONAL"), file = "data_mosquito.csv")
write.csv(filter(data_plant, release != "PROVISIONAL"), file = "data_plant.csv")
write.csv(filter(data_small_mammal, release != "PROVISIONAL"), file = "data_small_mammal.csv")
write.csv(filter(data_tick, release != "PROVISIONAL"), file = "data_tick.csv")
write.csv(filter(data_tick_pathogen, release != "PROVISIONAL"), file = "data_tick_pathogen.csv")
write.csv(filter(data_zooplankton, release != "PROVISIONAL"), file = "data_zooplankton.csv")
write.csv(filter(data_algae, release != "PROVISIONAL"), file = "data-raw/edi/data_algae.csv")
write.csv(filter(data_beetle, release != "PROVISIONAL"), file = "data-raw/edi/data_beetle.csv")
write.csv(filter(data_bird, release != "PROVISIONAL"), file = "data-raw/edi/data_bird.csv")
write.csv(filter(data_fish, release != "PROVISIONAL"), file = "data-raw/edi/data_fish.csv")
write.csv(filter(data_herp_bycatch, release != "PROVISIONAL"), file = "data-raw/edi/data_herp_bycatch.csv")
write.csv(filter(data_macroinvertebrate, release != "PROVISIONAL"), file = "data-raw/edi/data_macroinvertebrate.csv")
write.csv(filter(data_mosquito, release != "PROVISIONAL"), file = "data-raw/edi/data_mosquito.csv")
write.csv(filter(data_plant, release != "PROVISIONAL"), file = "data-raw/edi/data_plant.csv")
write.csv(filter(data_small_mammal, release != "PROVISIONAL"), file = "data-raw/edi/data_small_mammal.csv")
write.csv(filter(data_tick, release != "PROVISIONAL"), file = "data-raw/edi/data_tick.csv")
write.csv(filter(data_tick_pathogen, release != "PROVISIONAL"), file = "data-raw/edi/data_tick_pathogen.csv")
write.csv(filter(data_zooplankton, release != "PROVISIONAL"), file = "data-raw/edi/data_zooplankton.csv")

# location info are already in the above data objects,
# but I did extract all of them and put them in one file
write.csv(neon_location, file = "neon_location.csv")
write.csv(neon_location, file = "data-raw/edi/neon_location.csv")

# taxa code and scientific names
write.csv(neon_taxa, file = "neon_taxa.csv")
write.csv(neon_taxa, file = "data-raw/edi/neon_taxa.csv")

# summary information
write.csv(neon_summary, file = "neon_summary.csv")
write.csv(data_summary, file = "data-raw/edi/data_summary.csv")

# how to deposit csv files to EDI? Or just rds file?

Expand Down
Binary file modified data/data_bird.rda
Binary file not shown.

0 comments on commit 4df118a

Please sign in to comment.