Claire Vandiedonck & Jacques van Helden
2020-03-10
In a Web browser, open a connection to the IFB RStudio server
https://rstudio.cluster.france-bioinformatique.fr/
This requires your login and password.
Check the version of R and of loaded packages.
R version 3.5.1 (2018-07-02)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.21
loaded via a namespace (and not attached):
[1] compiler_3.5.1 magrittr_1.5 tools_3.5.1 htmltools_0.4.0 yaml_2.2.0 Rcpp_1.0.3 stringi_1.4.6 rmarkdown_1.11 stringr_1.4.0 xfun_0.4 digest_0.6.25 rlang_0.4.5 evaluate_0.12
## Where am I now?
getwd()
## Where is my home?
Sys.getenv("HOME")
## Who am I?
Sys.getenv("LOGNAME")
## Go home
setwd(Sys.getenv("HOME"))
setwd("~") ## An easier way
Sys.getenv()
returns all the environment variables$HOME
is a Unix variable environment indicating the home directory$LOGNAME
is my login name (did you guess?)~
denotes your home directory (equivalent to $HOME
)We will create a specific directory to store the data and results of the practicals for this course. For this we use the function file.path()
to concatenate subfolders.
Use the command dir.create()
to create the directory definedcourseDir
defined in the previous slide.
The above command returned an error. Do you understand why? If not read the help page and find a way to solve the problem.
Solution:
dir.create()
refused to create a subdirectory (session1
) because its parent directories (dubii2020
and stat-R
) did not exist.recursive= TRUE
to create.Now, re-run the same command and check the result.
Data and files are stored on the cluster in the directory /shared/projects/dubii2020/data/module3/seance1/
We will download the data Prerequis.RData
that you saved during the prerequisites session.
## Define the path of the files
data_path <- "/shared/projects/dubii2020/data/module3/seance1/"
print(data_path) ## Check the result
## Load the data from this path
load(paste(data_path, "Prerequis.RData", sep=""))
## List the data you have dowloaded, check their struture and keep in your session only the three vectors called size, weight and bmi as well as the matrix called myData2
ls()
## to complete on your own with `rm()`
Finally, open the script DUBii_R_Session1.R
stored in the same directory as the data.