ISU-Monarchs / HabitatRestoration

R data package containing data from a series of habitat restoration projects running from 2016-2019
0 stars 0 forks source link

Parsing failures when running environment.R #16

Closed jarad closed 6 years ago

jarad commented 6 years ago

Running environment.R from the data-raw/ directory has parsing failures.

sethapp commented 6 years ago

I'm not sure what I should be seeing here or what I should be fixing. When I run the code I'm fine until I reach the code: select(-environment, -extension) %>% tidyr::spread(variable, value)

Then I get this:

jarad commented 6 years ago

This doesn't happen for me. Can you make sure you are running all the code and running from the data-raw/ directory?

sethapp commented 6 years ago

I got it figured out. The grad students in the office helped me troubleshoot it. I'll start fixing the files now

sethapp commented 6 years ago

Sometimes more than 1 'dominant species' were present at a site which is the final line in each file. This was expected. The two or three species should have been separated by a semi colon but a comma was used instead...adding an extra 1-2 columns

sethapp commented 6 years ago

This issue is closed if this warning message doesn't mean anything: Warning message: In evalq(as.numeric(milkweed_ramet), ) : NAs introduced by coercion

devtools::use_data(environment,

  • overwrite = TRUE) Saving environment as environment.rda to C:/Users/sethapp/Documents/Git/ISUmonarch/data
jarad commented 6 years ago

This was caused by an "na" in prd1_tprd1a_3.csv. I fixed this in 491d26cdc by replacing the "na" with 0. If it should really be missing, then we should delete the 0 and leave it blank. If replacing the "na" with 0 is appropriate, then you can close this issue. Otherwise, make the appropriate fix and close.