Maître de Conférences en Informatique à l'Université d'Angers
Ce site est en cours de reconstruction certains liens peuvent ne pas fonctionner ou certaines images peuvent ne pas s'afficher.
Under Linux R will create two files under the directory where you started the program. Those files are .RData (for the data that you have defined) and .Rhistory is the history of commands.
To change the directory where you are working you can call the setwd() (Set Working Directory).
# print current working directory
> getwd()
[1] "/home/richer/public_html"
# modify working directory
> setwd("/home/richer/dev/R/code")
> getwd()
[1] "/home/richer/dev/R/code"
# save environment (all data)
> save.image()
# save environment in a particular file
> save.image('my_env.RData')
# load previously saved environment
> load('my_env.RData')
You can also manage the variables you have defined:
# show all variables defined > ls() [1] "a" "avgT" "col" "cores" "cpus" [6] "fun1" "fun2" "isprime" "launch.date" "litho" [11] "month" "mydata" "myvec" "num" "set" [16] "setw" "sq" "students" "students.wd" "tdp" [21] "temperatures" "threads" "wset" "x" "xy" [26] "y" > ls(pattern="my") [1] "mydata" "myvec" # remove some variables > rm(list = ls(pattern="my")) > ls() [1] "a" "avgT" "col" "cores" "cpus" [6] "fun1" "fun2" "launch.date" "litho" "set" [11] "setw" "sq" "students" "students.wd" "tdp" [16] "threads" "wset" "x" "xy" "y" # remove all variables > rm(list=ls()) > ls() character(0)