[R] How to import sensitive data when multiple users collaborate on R-script?

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Tue May 31 15:39:41 CEST 2016

Assume everyone will begin their work in a suitable working directory for their computer. Put data in that working directory or some directory "near" it. Then use relative paths to the data instead of absolute paths (don't use paths that start with "/"). I usually start by reading in a "configuration" file that I keep customized for per computer, that includes such things as the names of files I want to analyze. Sometimes there is only one row in that file, other times I select one row on the fly to use. 
Sent from my phone. Please excuse my brevity.

On May 31, 2016 3:44:21 AM PDT, Nikolai Stenfors <nikolai.stenfors at gapps.umu.se> wrote:
>We conduct medical research and our datafiles therefore contain
>data, not to be shared in the cloud (Dropboc, Box, Drive, Bitbucket,
>When we collaborate on a r-analysis-script, we stumble upon the
>annoyance. Researcher 1 has a line in the script importing the
>data from his/her personal computer. Researcher 2 has to put an
>line importing the data from his/her personal computer. Thus, we have
>in the script that are unnecessery for one or the other researcher. How
>we avoid this? Is there another way of conducting the collaboration.
>I'm perhaps looking for something like:
>"If the script is run on researcher 1 computer, load file from this
>directory. If the script is run on researcher 2 computer, load data
>that directory". 
>## Import data-------------------------------------
># Researcher 1 import data from laptop1, unnecessery line for
>Researcher 2
>data <- read.table("/path/to_researcher1_computer/sensitive_data.csv") 
># Researcher 2 import data from laptop2 (unnecessery line for
>Researcher 1)
>data <- read.table("/path/to_researcher2_computer/sensitive_data.csv") 
>## Clean data
>data$var1 <- NULL
>## Analyze data
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list