Software path setting is important for memory management, working data storage, and getting to the bottom of things. Therefore, a reasonable setting of the relevant path in R can facilitate the management of relevant documents, improve the efficiency of learning R language, and establish their own habit system.
The path setting in R mainly includes the following aspects:
Path to the working directory Path to the installation package
Working directory
1. Use the geTWd () function to display the current working directory;
getwd()
2. Change the current directory using the seTWd () function;
setwd("D:/R")
Note: the
(1) function setwd() does not automatically create a directory that does not exist. If necessary, you can use the function dir. Create () to create a new directory, then use setwd() to point the working directory to the new directory.
(2) Dir. Create () in R is non-cascading, meaning that only one “/” path can be created at a time. If you need two “/” paths, you need to create them twice with dir. Create () before the file is created successfully. Then follow the example and use seTWd () to set it.
(3) The seTWd () function is to set a temporary work path. 3. Use the RStudio window to permanently change the working directory
A.
B.
Package installation
Once and for all: (Run RStudio as administrator) write the following command in R:
.libPaths("C:/Program Files/R/R-3.5.2/library")
or
Run RStudio as an administrator
Read More:
- Idle line number setting and linenumbers modification
- IntelliJ idea sets the default working directory
- Cannot change working directory processing of setwd
- Installation and use of R language ggmap package
- R language error messages and related solutions
- R language notes – sample() function
- ionic android Current working directory is not a Cordova-based project.
- Solutions to the failure of R language loading rjava
- Error:Cannot start process,the working directory does not exist
- Solving the problem of saving object set by save() function in R language
- R language error in hist.default ():’x’must be a value
- Renaming the column name of data frame in R language
- R language loading xlsx error error: JAVA_HOME cannot be determined from the Registry
- Analysis of R language error replacement has length zero problem
- Setting the exclutable path of QT running settings
- Trivia: How does R language solve Error in ts(x):’ts’ object must have one or more observations
- R language error:‘ namespace:lazyeval There is no exit_ The object is eval
- Usage and examples of three important functions of tidyr package in R language: gather, spread and separate
- R language-Error in file(out, “wt”): Unable to open the link problem solved
- The solution of “error in NLS loop more than 50” in R language