Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data in a different folder than MixSIAR library folder #269

Closed
AdrianaVelasquezVacca opened this issue Feb 16, 2021 · 2 comments
Closed

Comments

@AdrianaVelasquezVacca
Copy link

Hi!

I have a very simple question I'm sure, but I can't find the solution, please someone help me! I'm new to R and I will learn more but I need to send a report using this script very soon.

I installed MixSIAR and I see that the library is in C:/Users/me/Documents/R/win-library/4.0/MixSIAR and the script works perfectly as long as my data is in the same folder MixSIAR, but if I want to have it in my Dropbox or any other folder in my PC it doesn't work, because I can't figure out how to write the path to "call" the package MixSIAR.

#library(MixSIAR) # Works but needs data to be in the same MixSIAR folder.
 library("C:/Users/pingry/Documents/R/win-library/4.0/MixSIAR") # doesn't work

# Load consumer
mix.filename <- system.file("data", "contemp_turtles_Oahu_consumer.csv", package = "MixSIAR")
mix <- load_mix_data(filename=mix.filename,
           iso_names=c("d13C","d15N","d34S"),
           factors=NULL,
           fac_random=NULL,
           fac_nested=NULL,
           cont_effects=NULL)`

The error I get:

Error is in library("C:/Users/pingry/Documents/R/win-library/4.0/MixSIAR") : there is no package called ‘C:/Users/pingry/Documents/R/win-library/4.0/MixSIAR’

Thank you so much!

Screenshot 2021-02-16 14 30 04

@AdrianaVelasquezVacca
Copy link
Author

Someone suggested I use Github instead of Dropbox to keep my code but I'm still curious about this question.

@AdrianaVelasquezVacca
Copy link
Author

Mr. Flick from Stackoverflow gave me the answer so here is the code fixed to have my data in my Dropbox and use the MixSIAR package:

library(MixSIAR)
# Load mix data
mix <- load_mix_data(filename=("data/contemp_turtles_2islands_consumer.csv"),
           iso_names=c("d13C","d15N","d34S"),
           factors="island",
           fac_random=TRUE,
           fac_nested=FALSE,
           cont_effects=NULL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant