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

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()
主站蜘蛛池模板: 平乡县| 海淀区| 汉源县| 恩施市| 卫辉市| 永济市| 德安县| 洛阳市| 融水| 遂川县| 大兴区| 武陟县| 五河县| 财经| 绍兴县| 拜泉县| 灯塔市| 眉山市| 郴州市| 潼关县| 潮州市| 曲周县| 云南省| 浦北县| 庆安县| 固安县| 武陟县| 香港 | 浦县| 钟祥市| 南丰县| 扎囊县| 长沙市| 安国市| 乐至县| 阿城市| 仲巴县| 张北县| 视频| 皮山县| 年辖:市辖区|