官术网_书友最值得收藏!

Getting ready

Download the script 5644_01_01.r from your account at http://www.packtpub.com and save it to your hard disk. The first section of the script, below the comment line starting with ### loading packages, will automatically check for the availability of the R packages gplots and lattice, which are required for this recipe.

If those packages are not already installed, you will be prompted to select an official server from the Comprehensive R Archive Network (CRAN) to allow the automatic download and installation of the required packages.

If you have already installed those two packages prior to executing the script, I recommend you to update them to the most recent version by calling the following function in the R command line:

update.packages("gplots")
update.packages("lattice")
Tip

Use the source() function in the R command-line to execute an external script from any location on your hard drive.

If you start a new R session from the same directory as the location of the script, simply provide the name of the script as an argument in the function call as follows:

source("myScript.r")

You have to provide the absolute or relative path to the script on your hard drive if you started your R session from a different directory to the location of the script. Refer to the following example:

source("/home/username/Downloads/myScript.r")

You can view the current working directory of your current R session by executing the following command in the R command-line:

getwd()
主站蜘蛛池模板: 繁昌县| 革吉县| 仙桃市| 辉县市| 藁城市| 四平市| 灵武市| 扶风县| 滨州市| 新巴尔虎右旗| 托克逊县| 金门县| 宝鸡市| 余江县| 商南县| 游戏| 长治市| 苍南县| 宜章县| 尚志市| 山东省| 长寿区| 昆明市| 樟树市| 华容县| 淮北市| 普陀区| 柳河县| 黑龙江省| 汝阳县| 嵊泗县| 玉山县| 凤阳县| 阳城县| 逊克县| 即墨市| 宁海县| 长春市| 无棣县| 天水市| 油尖旺区|