BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

error when using formatOccDat() in rmarkdown #77

Open drnickisaac opened 6 years ago

drnickisaac commented 6 years ago

Galina has noticed some odd behaviour of formatOccDat running rmarkdown on a Mac. so it's not a sparta bug, but there may be something we can do to avoid it.

The following call works fine on the console:

formattedOccData_Museum <- sparta::formatOccData(taxa = Museumdat_tidy$species, 
                                         site = Museumdat_tidy$km1grid, 
                                         survey= Museumdat_tidy$from_date,
                                         closure_period = Museumdat_tidy$year)

However, when run in rmarkdown:

Error in sparta::formatOccData(taxa = Museumdat_tidy$species, site = Museumdat_tidy$km1grid,  : could not find function "%>%"
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> <Anonymous>
Execution halted

I've also experienced some odd behaviour of rmarkdown on a Mac (specifically around the working directory). But it would be investigate more to either fix or advise users appropriately.

NB this is using the version of sparta on my repository.

AugustT commented 6 years ago

could not find function "%>%" makes me think that you might not have loaded tidyr in your rmarkdown document

AugustT commented 5 years ago

I think this will be solved by #91