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

Nikolai Stenfors nikolai.stenfors at gapps.umu.se
Tue May 31 12:44:21 CEST 2016


We conduct medical research and our datafiles therefore contain sensitive
data, not to be shared in the cloud (Dropboc, Box, Drive, Bitbucket, GitHub).
When we collaborate on a r-analysis-script, we stumble upon the following
annoyance. Researcher 1 has a line in the script importing the sensitive
data from his/her personal computer. Researcher 2 has to put an additional
line importing the data from his/her personal computer. Thus, we have lines
in the script that are unnecessery for one or the other researcher. How can
we avoid this? Is there another way of conducting the collaboration. Other
workflow? 

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 from
that directory". 

Example:
## 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
boxplot(data$var2)



More information about the R-help mailing list