weecology / Metabarcoding

Repository for work on the diet partitioning study at Portal
0 stars 1 forks source link

Remove hard paths #15

Open skmorgane opened 7 years ago

skmorgane commented 7 years ago

Hard paths will make it difficult for each of us to run each other's code. We should talk about file structure and how to call files in a way that either uses relative paths wrt the repo or allows us to specify what the home directory is.

bleds22e commented 7 years ago

Good call. I've been doing a lot of work without internet (e.g. on airplanes, in the car), so that wasn't my top priority. But yeah, pulling from the URL or whatever is a better plan in general.

skmorgane commented 7 years ago

Ah! That makes sense!

bleds22e commented 7 years ago

Is there a way to remove hard files paths when you are writing a csv? Or should I just not worry about that part and worry about removing hard paths for data getting read in?

bleds22e commented 7 years ago

Also any idea if we can remove hard paths for dropbox files?

skmorgane commented 7 years ago

If you're writing a file that will be stored in the repo, you can just give it a relative path: "./Plants/TrnL_stuff.csv" If your repo is in Dropbox, it shouldn't matter as long as you are using an RProject (it sets the location of your working directory to be the main folder of the repo). If you are saving to or reading from a folder outside the repo, I think we have to use some of the approaches we used in PortPredictions and PortalDataSummaries?

bleds22e commented 7 years ago

Oh, right. That makes sense for writing the file. I'll have to take a closer look at what happens in portalPredictions and PortalDataSummaries for pulling from Dropbox