Dear Gabor, Thank your for helping me so much! I have loaded R the newest version 2.1.1. Then I setup it in the path of D:\program files\R\ 1. unpack tools.zip into c:\cygwin 2. install Active perl in c:\Perl 3. install the mingw32 in c:\mingwin 4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" (In your previous mail, you said "put these at the beginning of the path", I don't understand what is your meaning. Which path?) 5. I tried an library example. I set a new folder named "example" in the "c:\MyRpackages\". And In the "example" folder, it contain an "DESCRIPTION" file and "R" folder. in "R" folder contain a "example" file. I just write very simple script in it: a<-2; b<-3;sum <- sum(a,b); print(paste(a,"+",b,"=",sum)) 6. I opened the DOS environment. Into the "D:\>" Type the following code: cd \Program Files\R\rw2010 But I don't understand the second line you writed in your previous mail: "bin\R cmd install /MyRPackages/example" I am not sure that I set up R in "D:\" But I do so much action in C:\ Did I do the correct action? Did I do the action into the correct path? I still need your and others help. Thank you very much! ---------- : Gabor Grothendieck [mailto:ggrothendieck at gmail.com] : 200566 10:21 : Ivy_Li : r-help at stat.math.ethz.ch : Re: [R] fail in adding library in new version. On 6/5/05, Ivy_Li <Ivy_Li at smics.com> wrote:> Hello everybody, > Could I consult you a question? > I always use R old version 1.9.1 . Because I can not add my library into the new version 2.0.0 by the same method as old version.Getting the latest version of R is strongly recommended. The suggestions below all assume the latest version and may or may not work if you do not upgrade.> * I have read the webpage <http://www.stats.ox.ac.uk/pub/Rtools> > * Download the tools.zip > * Unpack tools.zip into c:\cygwin > * Install Active Perl in c:\Perl > * Install the mingw32 port of gcc in c:\mingwin > * Then go to "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable Balue" add ;c:\cygwin;c:\mingwin\binYou may need to put these at the beginning of the path rather than the end. Also just as a check enter path at the console to make sure that you have them. You will likely have to start a new console session and possibly even reboot. Also you need the Microsoft Help Compiler, hhc. Suggest you reread the material on which tools you need.> * Save my library "example" into "c:\MyRpackages\" . But I am not sure what type it is, is it need suffix?" And I don't what its content, just my function script, no special format?In MyRPackages you would have a folder called example, in your case, that contains the package. Within folder example, you would have the DESCRIPTION file, the R folder, etc.> * Then I don't know where should I do this step: Type R CMD INSTALL --build example. Need I run R first?You don't have to run R first. You do need to make sure that R.exe can be found on your path or else use the absolute path name in referring to R. For example, if your path does not include R you could do something like this: cd \Program Files\R\rw2010 bin\R cmd install /MyRPackages/example Be sure to use forward slashes where shown above and backslashes where shown.> So There is a error after I do this step. It said it can not find somethig. I don't which step is wrong. It costed me much time. >Try all these suggestions including upgrading R and if that does not work try posting screen dumps of the actual errors you are getting.
Ivy_Li wrote:> Dear Gabor, Thank your for helping me so much! I have loaded R the > newest version 2.1.1. Then I setup it in the path of D:\program > files\R\ 1. unpack tools.zip into c:\cygwin 2. install Active perl in > c:\Perl 3. install the mingw32 in c:\mingwin 4. add> "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> No, without the blank(!!!): "c:\cygwin;c:\mingwin\bin"> Environment Variables -> Path -> Variable" (In your previous mail, > you said "put these at the beginning of the path", I don't understand > what is your meaning. Which path?)Well, the PATH variable already contains a couple of paths, add the two given above in front of all others, separated by ";". Don't see what is difficult to understand here.> 5. I tried an library example. I set a new folder named "example" in > the "c:\MyRpackages\". And In the "example" folder, it contain an > "DESCRIPTION" file and "R" folder. in "R" folder contain a "example" > file. I just write very simple script in it: a<-2; b<-3;sum <- > sum(a,b); print(paste(a,"+",b,"=",sum)) > > 6. I opened the DOS environment. Into the "D:\>" Type the following > code: cd \Program Files\R\rw2010 But I don't understand the second > line you writed in your previous mail: "bin\R cmd install > /MyRPackages/example"Then you should read the R Installation and Administration manual, you missed it, obviously!> I am not sure that I set up R in "D:\" But I do so much action in C:\ > Did I do the correct action? Did I do the action into the correct > path? > > I still need your and others help. Thank you very much!I think you need to read the manuals before, and additionally seek advice by a local Windows expert who can tell you relationships between paths, environment variables, executable files etc. Uwe Ligges> > > ---------- : Gabor Grothendieck > [mailto:ggrothendieck at gmail.com] : 200566 10:21 : Ivy_Li > : r-help at stat.math.ethz.ch : Re: [R] fail in adding library in new > version. > > > On 6/5/05, Ivy_Li <Ivy_Li at smics.com> wrote: > >> Hello everybody, Could I consult you a question? I always use R old >> version 1.9.1 . Because I can not add my library into the new >> version 2.0.0 by the same method as old version. > > > Getting the latest version of R is strongly recommended. The > suggestions below all assume the latest version and may or may not > work if you do not upgrade. > > >> * I have read the webpage >> <http://www.stats.ox.ac.uk/pub/Rtools> * Download the >> tools.zip * Unpack tools.zip into c:\cygwin * Install >> Active Perl in c:\Perl * Install the mingw32 port of gcc in >> c:\mingwin * Then go to "Control Panel -> System -> Advanced >> -> Environment Variables -> Path -> Variable Balue" add >> ;c:\cygwin;c:\mingwin\bin > > > You may need to put these at the beginning of the path rather than > the end. Also just as a check enter path at the console to make sure > that you have them. You will likely have to start a new console > session and possibly even reboot. > > Also you need the Microsoft Help Compiler, hhc. Suggest you reread > the material on which tools you need. > > >> * Save my library "example" into "c:\MyRpackages\" . But I am >> not sure what type it is, is it need suffix?" And I don't what its >> content, just my function script, no special format? > > > In MyRPackages you would have a folder called example, in your case, > that contains the package. Within folder example, you would have the > DESCRIPTION file, the R folder, etc. > > >> * Then I don't know where should I do this step: Type R CMD >> INSTALL --build example. Need I run R first? > > > You don't have to run R first. You do need to make sure that R.exe > can be found on your path or else use the absolute path name in > referring to R. For example, if your path does not include R you > could do something like this: > > cd \Program Files\R\rw2010 bin\R cmd install /MyRPackages/example > > Be sure to use forward slashes where shown above and backslashes > where shown. > > >> So There is a error after I do this step. It said it can not find >> somethig. I don't which step is wrong. It costed me much time. >> > > > Try all these suggestions including upgrading R and if that does not > work try posting screen dumps of the actual errors you are getting. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the > posting guide! http://www.R-project.org/posting-guide.html
Gabor Grothendieck
2005-Jun-30 11:16 UTC
Re: 答复: [R] fail in adding library in new version.
On 6/30/05, Ivy_Li <Ivy_Li at smics.com> wrote:> Dear Gabor, > Thank your for helping me so much! > I have loaded R the newest version 2.1.1. Then I setup it in the path of D:\program files\R\ > 1. unpack tools.zip into c:\cygwin > 2. install Active perl in c:\Perl > 3. install the mingw32 in c:\mingwin > 4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" (In your previous mail, you said "put these at the beginning of the path", I don't understand what is your meaning. Which path?)If in the console you enter the command: path then it will display a semicolon separated list of folders. You want the folder that contains the tools to be at the beginning so that you eliminate the possibility of finding a different program of the same name first in a folder that comes prior to the one where the tools are stored.> > 5. I tried an library example. I set a new folder named "example" in the "c:\MyRpackages\". And In the "example" folder, it contain an "DESCRIPTION" file and "R" folder. in "R" folder contain a "example" file. I just write very simple script in it: > a<-2; b<-3;sum <- sum(a,b); print(paste(a,"+",b,"=",sum)) > > 6. I opened the DOS environment. Into the "D:\>" Type the following code: > cd \Program Files\R\rw2010 > But I don't understand the second line you writed in your previous mail: "bin\R cmd install /MyRPackages/example"I was assuming that MyRPackages and R are on the same disk. If they are not then you need to specify the disk too. That is if MyRPackages is on C and R is installed on D then install your package via: d: cd \Program Files\R\rw2010 bin\R CMD install c:/MyRPackages/example Note that bin\R means to run R.exe in the bin subfolder of the current folder using command script install and the indicated source package.> > I am not sure that I set up R in "D:\" But I do so much action in C:\ Did I do the correct action? Did I do the action into the correct path?If you are not sure where R is installed then enter the following at the Windows console prompt to find out (this will work provided you let it install the key into the registry when you installed R initially). The reg command is a command built into Windows (I used XP but I assume its the same on other versions) that will query the Windows registry: reg query hklm\software\r-core\r /v InstallPath> > I still need your and others help. Thank you very much! > > > > -----佋伃伿伡佊伿伡侢----- > 伔仮伡侢伻佀: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] > 伔仮佀佂伿伇伡佷: 2005伳侁6佋伮6伻佌 10:21 > 伿佌伡侢伻佀: Ivy_Li > 伋伃佀佂: r-help at stat.math.ethz.ch > 佒侘佁佲: Re: [R] fail in adding library in new version. > > > On 6/5/05, Ivy_Li <Ivy_Li at smics.com> wrote: > > Hello everybody, > > Could I consult you a question? > > I always use R old version 1.9.1 . Because I can not add my library into the new version 2.0.0 by the same method as old version. > > Getting the latest version of R is strongly recommended. The suggestions > below all assume the latest version and may or may not work if you do > not upgrade. > > > * I have read the webpage <http://www.stats.ox.ac.uk/pub/Rtools> > > * Download the tools.zip > > * Unpack tools.zip into c:\cygwin > > * Install Active Perl in c:\Perl > > * Install the mingw32 port of gcc in c:\mingwin > > * Then go to "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable Balue" add ;c:\cygwin;c:\mingwin\bin > > You may need to put these at the beginning of the path rather than the end. > Also just as a check enter > path > at the console to make sure that you have them. You will likely > have to start a new console session and possibly even reboot. > > Also you need the Microsoft Help Compiler, hhc. Suggest > you reread the material on which tools you need. > > > * Save my library "example" into "c:\MyRpackages\" . But I am not sure what type it is, is it need suffix?" And I don't what its content, just my function script, no special format? > > In MyRPackages you would have a folder called example, in your case, > that contains the package. Within folder example, you would have the > DESCRIPTION file, the R folder, etc. > > > * Then I don't know where should I do this step: Type R CMD INSTALL --build example. Need I run R first? > > You don't have to run R first. You do need to make sure that R.exe can > be found on your path or else use the absolute path name in referring to R. > For example, if your path does not include R you could do something like this: > > cd \Program Files\R\rw2010 > bin\R cmd install /MyRPackages/exampleSorry, there is an error in the above. It should be: bin\R CMD install c:/MyRPackages/example or bin\Rcmd install c:/MyRPackages/example> > Be sure to use forward slashes where shown above and backslashes > where shown. > > > So There is a error after I do this step. It said it can not find somethig. I don't which step is wrong. It costed me much time. > > > > Try all these suggestions including upgrading R and if that does not work > try posting screen dumps of the actual errors you are getting. >Also try googling for making creating R packages and you will find some privately written tutorials on all this.
It is interesting that in my PC >R cmd is same as >R Which leads me into the R interface. ------------------------------------------------------------------------------ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\xiaohuadai>r cmd ARGUMENT 'cmd' __ignored__ R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. Working directory is C:/Documents and Settings/xiaohuadai bugs() function loaded from file c:\bugsR\bugs.R display() and sim() functions loaded from file c:\bugsR\regression.R>------------------------------------------------------------------------------- Xiaohua On 6/30/05, Gabor Grothendieck <ggrothendieck@gmail.com> wrote:> > They both work for me. I just installed a package using R CMD > and then did it again using Rcmd. Here is the input and > first few lines of output for the first one: > > > ------------------------------------------------------------------------------------------------- > C:\Program Files\R\rw2011pat>bin\R CMD install /Rpkgs/vcd > > > ---------- Making package vcd ------------ > > adding build stamp to DESCRIPTION > installing R files > installing demos > ...etc... > > ------------------------------------------------------------------------------------------------- > > and here it is for the second one: > > > ------------------------------------------------------------------------------------------------- > C:\Program Files\R\rw2011pat>bin\Rcmd install /Rpkgs/vcd > > > ---------- Making package vcd ------------ > adding build stamp to DESCRIPTION > installing R files > installing demos > ...etc.. > > ------------------------------------------------------------------------------------------------- > > > On 6/30/05, ecoinfo <ecoinformatics@gmail.com> wrote: > > In my Windows XP, the commond is RCMD not R CMD. > > > > > > On 6/30/05, Gabor Grothendieck <ggrothendieck@gmail.com> wrote: > > > > > > On 6/30/05, Ivy_Li <Ivy_Li@smics.com> wrote: > > > > Dear Gabor, > > > > Thank your for helping me so much! > > > > I have loaded R the newest version 2.1.1. Then I setup it in the > > path of D:\program files\R\ > > > > 1. unpack tools.zip into c:\cygwin > > > > 2. install Active perl in c:\Perl > > > > 3. install the mingw32 in c:\mingwin > > > > 4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> > > Advanced -> Environment Variables -> Path -> Variable" (In your previous > > mail, you said "put these at the beginning of the path", I don't > understand > > what is your meaning. Which path?) > > > > > > If in the console you enter the command: > > > > > > path > > > > > > then it will display a semicolon separated list of folders. You want > the > > folder > > > that contains the tools to be at the beginning so that you eliminate > > > the possibility > > > of finding a different program of the same name first in a folder that > > comes > > > prior to the one where the tools are stored. > > > > > > > > > > > 5. I tried an library example. I set a new folder named "example" in > the > > "c:\MyRpackages\". And In the "example" folder, it contain an > "DESCRIPTION" > > file and "R" folder. in "R" folder contain a "example" file. I just > write > > very simple script in it: > > > > a<-2; b<-3;sum <- sum(a,b); print(paste(a,"+",b,"=",sum)) > > > > > > > > 6. I opened the DOS environment. Into the "D:\>" Type the following > > code: > > > > cd \Program Files\R\rw2010 > > > > But I don't understand the second line you writed in your previous > mail: > > "bin\R cmd install /MyRPackages/example" > > > > > > I was assuming that MyRPackages and R are on the same disk. If they > are > > not > > > then you need to specify the disk too. That is if MyRPackages is on C > and > > R > > > is installed on D then install your package via: > > > > > > d: > > > cd \Program Files\R\rw2010 > > > bin\R CMD install c:/MyRPackages/example > > > > > > Note that bin\R means to run R.exe in the bin subfolder of the current > > folder > > > using command script install and the indicated source package. > > > > > > > > > > > I am not sure that I set up R in "D:\" But I do so much action in > C:\ > > Did I do the correct action? Did I do the action into the correct path? > > > > > > If you are not sure where R is installed then enter the following at > the > > Windows > > > console prompt to find out (this will work provided you let it install > the > > key > > > into the registry when you installed R initially). The reg command is > a > > command > > > built into Windows (I used XP but I assume its the same on other > versions) > > > that will query the Windows registry: > > > > > > reg query hklm\software\r-core\r /v InstallPath > > > > > > > > > > > I still need your and others help. Thank you very much! > > > > > > > > > > > > > > > > -----ÔʼÓʼþ----- > > > > ·¢¼þÈË: Gabor Grothendieck [mailto:ggrothendieck@gmail.com] > > > > ·¢ËÍʱ¼ä: 2005Äê6ÔÂ6ÈÕ 10:21 > > > > ÊÕ¼þÈË: Ivy_Li > > > > ³ËÍ: r-help@stat.math.ethz.ch > > > > Ö÷Ìâ: Re: [R] fail in adding library in new version. > > > > > > > > > > > > On 6/5/05, Ivy_Li <Ivy_Li@smics.com> wrote: > > > > > Hello everybody, > > > > > Could I consult you a question? > > > > > I always use R old version 1.9.1 . Because I can not add my > > library into the new version 2.0.0 by the same method as old version. > > > > > > > > Getting the latest version of R is strongly recommended. The > > suggestions > > > > below all assume the latest version and may or may not work if you > do > > > > not upgrade. > > > > > > > > > * I have read the webpage > > <http://www.stats.ox.ac.uk/pub/Rtools > > > > > > * Download the tools.zip > > > > > * Unpack tools.zip into c:\cygwin > > > > > * Install Active Perl in c:\Perl > > > > > * Install the mingw32 port of gcc in c:\mingwin > > > > > * Then go to "Control Panel -> System -> Advanced -> Environment > > Variables -> Path -> Variable Balue" add ;c:\cygwin;c:\mingwin\bin > > > > > > > > You may need to put these at the beginning of the path rather than > the > > end. > > > > Also just as a check enter > > > > path > > > > at the console to make sure that you have them. You will likely > > > > have to start a new console session and possibly even reboot. > > > > > > > > Also you need the Microsoft Help Compiler, hhc. Suggest > > > > you reread the material on which tools you need. > > > > > > > > > * Save my library "example" into "c:\MyRpackages\" . But I am > > not sure what type it is, is it need suffix?" And I don't what its > content, > > just my function script, no special format? > > > > > > > > In MyRPackages you would have a folder called example, in your case, > > > > that contains the package. Within folder example, you would have the > > > > DESCRIPTION file, the R folder, etc. > > > > > > > > > * Then I don't know where should I do this step: Type R CMD > > INSTALL --build example. Need I run R first? > > > > > > > > You don't have to run R first. You do need to make sure that R.execan > > > > be found on your path or else use the absolute path name in > referring to > > R. > > > > For example, if your path does not include R you could do something > like > > this: > > > > > > > > cd \Program Files\R\rw2010 > > > > bin\R cmd install /MyRPackages/example > > > > > > Sorry, there is an error in the above. It should be: > > > > > > bin\R CMD install c:/MyRPackages/example > > > > > > or > > > > > > bin\Rcmd install c:/MyRPackages/example > > > > > > > > > > > > > > Be sure to use forward slashes where shown above and backslashes > > > > where shown. > > > > > > > > > So There is a error after I do this step. It said it can not > > find somethig. I don't which step is wrong. It costed me much time. > > > > > > > > > > > > > Try all these suggestions including upgrading R and if that does not > > work > > > > try posting screen dumps of the actual errors you are getting. > > > > > > > > > > Also try googling for > > > > > > making creating R packages > > > > > > and you will find some privately written tutorials on all this. > > > > > > > > > > > > ______________________________________________ > > > R-help@stat.math.ethz.ch mailing list > > > https://stat.ethz.ch/mailman/listinfo/r-help > > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > > > > > > > > > > > -- > > Xiaohua Dai > > Centre for Systems Research, Durban Institute of Technology > > P.O.Box 953, Durban 4000, South Africa > > >-- Xiaohua Dai, Dr. [[alternative HTML version deleted]]
Dear All, I imitated the web age "Description" example to make my "description". I wrote: Package: example Version: 1.0 Date: 2005-07-08 Title: example library Author: Ivy <Ivy_Li at smics.com> Maintainer: Ivy <Ivy_Li at smics.com> Description: simple function License: GPL Version 2 or later. Packaged: Fri July 8 13:00:00 2005; Ivy And In Dos environment, I install "example" library. There are some error: ---------- Making package example ------------ adding build stamp to DESCRIPTION no R files in this package no man files in this package installing indices installing help wc: D:/PROGRA~1/R/rw2011/library/example/R/example: No such file or directory adding MD5 sums * DONE (example) Then the "DESCRIPTION", "MD5" and "Meta" folder are created in the path of "D:\Program Files\R\rw2011\library\example" So please tell me which step was wrong? Thank you very much! -----佋伃伿伡佊伿伡侢----- 伔仮伡侢伻佀: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] 伔仮佀佂伿伇伡佷: 2005伳侁7佋伮8伻佌 12:48 伿佌伡侢伻佀: Ivy_Li 伋伃佀佂: Uwe Ligges; r-help at stat.math.ethz.ch 佒侘佁佲: Re: [R] fail in adding library in new version. There is also an even larger source of examples at: http://cran.r-project.org/src/contrib/Descriptions/ although the built caveat mentioned below applies here as well. On 7/7/05, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> You cannot use an empty DESCRIPTION file. > To get more info on the DESCRIPTION file see > 1.1.1 of the Writing Extensions manual which you > can get to from the Help | Manuals menu entry in > the Windows R GUI. There is also an example > in that section. > > Also \Program Files\R\rw2011\library contains one directory per > package and you can look at the DESCRIPTION files in each > for additional examples (although these are built files and you don't > need the Packaged and Built lines since those were added > automatically). > > On 7/7/05, Ivy_Li <Ivy_Li at smics.com> wrote: > > Dear all, > > I really appreciate your help. I think I have a little advancement. ^_^ > > > > When I enter the Dos environment, at first, into the D:\>, I type the following code: > > cd Program Files\R\rw2011\ > > bin\R CMD install /example > > > > "example" is in the d:\, which include the R folder and "DESCRIPTION" file, But I wrote nothing in the "DESCRIPTION" file. Actually, I don't know what I should write in it. > > > > Well, there are still aother error: > > > > ---------- Making package example ------------ > > adding build stamp to DESCRIPTION > > error happened.read_description(dfile) : file 'D:/example/DESCRIPTION' is not in valid DCF format > > Stop execute > > make[2]: *** [frontmatter] Error 1 > > make[1]: *** [all] Error 2 > > make: *** [pkg-example] Error 2 > > *** Installation of example failed *** > > Removing 'D:/PROGRA~1/R/rw2011/library/example' > > > > Please tell me which step is wrong? > > Thanks a lot! > > > > BG > > Ivy_Li > > > > > > -----佋伃伿伡佊伿伡侢----- > > 伔仮伡侢伻佀: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] > > 伔仮佀佂伿伇伡佷: 2005伳侁7佋伮7伻佌 20:57 > > 伿佌伡侢伻佀: Uwe Ligges > > 伋伃佀佂: Ivy_Li; r-help at stat.math.ethz.ch > > 佒侘佁佲: Re: 伌侌伕伌: 伌侌伕伌: [R] fail in adding library in new version. > > > > > > On 7/7/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote: > > > Gabor Grothendieck wrote: > > > > > > > On 7/7/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote: > > > > > > > >>Ivy_Li wrote: > > > >> > > > >> > > > >>>Dear all, > > > >>> I have done every step as the previous mail. > > > >>>1. unpack tools.zip into c:\cygwin > > > >>>2. install Active perl in c:\Perl > > > >>>3. install the mingw32 in c:\mingwin > > > >>>4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" , and they are in the beginning of the "Path" > > > >> > > > >> ^ > > > >>such blanks are not allowed in the PATH variable > > > >> > > > >> > > > >> > > > >> > > > >>> Because I install R in the D drive, so I set a fold "MyRpackages" in the same drive. Into the "MyRpackages" folder I write a R library named "example", include "DESCRIPTION" file and "R" folder. In the "R" folder, the "example" file just content very simple code as the previous mail said. > > > >>> So in the Dos environment, at first, into the D:\>, I type the following code: > > > >>>cd Program Files\R\rw2011\ > > > >> > > > >>MyRpackages does not need to be here. > > > >> > > > >> > > > >>>bin\R CMD install /MyRpackages/example > > > >> > > > >>The first slash in "/MyRPackages" sugests that this is a top level > > > >>directory, which does not exist. > > > >>Even better, cd to MyRpackages, add R's bin dir to your path variable, > > > >>and simply say: > > > >> > > > >>R CMD INSTALL example > > > > > > > > > > > > Another possibility is to put Rcmd.bat from the batch file collection > > > > > > > > http://cran.r-project.org/contrib/extra/batchfiles/ > > > > > > > > in your path. It will use the registry to find R so you won't have > > > > to modify your path (nor would you have to remodify it every time you > > > > install a new version of R which is what you would otherwise have to do): > > > > > > > > cd \MyPackages > > > > Rcmd install example > > > > > > > > > Just for the records: > > > > > > 1. "cd \MyPackages" won't work, as I have already explained above. > > > > If MyPackages is not a top level directory in the current drive > > then it will not work. Otherwise it does work. > > > > > > > > 2. I do *not* recommend this way, in particular I find it misleading to > > > provide these batch files on CRAN. > > > > > > > The alternative, at least as discussed in your post, is more work > > since one will then have to change one's path every time one > > reinstalls R. This is just needless extra work and is error prone. If you > > forget to do it then you will be accessing the bin directory of the > > wrong version of R. > > > > > >>> There are some error: > > > >>>'make' is neither internal or external command, nor executable operation or batch file > > > >>>*** installation of example failed *** > > > >> > > > >>Well, make.exe is not find in your path. Please check whether the file > > > >>exists and the path has been added. > > > >> > > > >>Uwe Ligges > > > >> > > > >> > > > >> > > > >>>Removing 'D:/PROGRA~1/R/rw2011/library/example' > > > >>> > > > >>>I think I have closed to success. heehee~~~~~ > > > >>>Thank you for your help. > > > >>>I still need you and others help. Thank you very much! > > > >>> > > > >>> > > > >>>-----佋伃伿伡佊伿伡侢----- > > > >>>伔仮伡侢伻佀: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] > > > >>>伔仮佀佂伿伇伡佷: 2005伳侁6佋伮30伻佌 19:16 > > > >>>伿佌伡侢伻佀: Ivy_Li > > > >>>伋伃佀佂: r-help at stat.math.ethz.ch > > > >>>佒侘佁佲: Re: 伌侌伕伌: [R] fail in adding library in new version. > > > >>> > > > >>> > > > >>>On 6/30/05, Ivy_Li <Ivy_Li at smics.com> wrote: > > > >>> > > > >>> > > > >>>>Dear Gabor, > > > >>>> Thank your for helping me so much! > > > >>>> I have loaded R the newest version 2.1.1. Then I setup it in the path of D:\program files\R\ > > > >>>>1. unpack tools.zip into c:\cygwin > > > >>>>2. install Active perl in c:\Perl > > > >>>>3. install the mingw32 in c:\mingwin > > > >>>>4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" (In your previous mail, you said "put these at the beginning of the path", I don't understand what is your meaning. Which path?) > > > >>> > > > >>> > > > >>>If in the console you enter the command: > > > >>> > > > >>>path > > > >>> > > > >>>then it will display a semicolon separated list of folders. You want the folder > > > >>>that contains the tools to be at the beginning so that you eliminate > > > >>>the possibility > > > >>>of finding a different program of the same name first in a folder that comes > > > >>>prior to the one where the tools are stored. > > > >>> > > > >>> > > > >>> > > > >>>>5. I tried an library example. I set a new folder named "example" in the "c:\MyRpackages\". And In the "example" folder, it contain an "DESCRIPTION" file and "R" folder. in "R" folder contain a "example" file. I just write very simple script in it: > > > >>>>a<-2; b<-3;sum <- sum(a,b); print(paste(a,"+",b,"=",sum)) > > > >>>> > > > >>>>6. I opened the DOS environment. Into the "D:\>" Type the following code: > > > >>>>cd \Program Files\R\rw2010 > > > >>>>But I don't understand the second line you writed in your previous mail: "bin\R cmd install /MyRPackages/example" > > > >>> > > > >>> > > > >>>I was assuming that MyRPackages and R are on the same disk. If they are not > > > >>>then you need to specify the disk too. That is if MyRPackages is on C and R > > > >>>is installed on D then install your package via: > > > >>> > > > >>>d: > > > >>>cd \Program Files\R\rw2010 > > > >>>bin\R CMD install c:/MyRPackages/example > > > >>> > > > >>>Note that bin\R means to run R.exe in the bin subfolder of the current folder > > > >>>using command script install and the indicated source package. > > > >>> > > > >>> > > > >>> > > > >>>>I am not sure that I set up R in "D:\" But I do so much action in C:\ Did I do the correct action? Did I do the action into the correct path? > > > >>> > > > >>> > > > >>>If you are not sure where R is installed then enter the following at the Windows > > > >>>console prompt to find out (this will work provided you let it install the key > > > >>>into the registry when you installed R initially). The reg command is a command > > > >>>built into Windows (I used XP but I assume its the same on other versions) > > > >>>that will query the Windows registry: > > > >>> > > > >>>reg query hklm\software\r-core\r /v InstallPath > > > >>> > > > >>> > > > >>> > > > >>>>I still need your and others help. Thank you very much! > > > >>>> > > > >>>> > > > >>>> > > > >>>>-----佋伃伿伡佊伿伡侢----- > > > >>>>伔仮伡侢伻佀: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] > > > >>>>伔仮佀佂伿伇伡佷: 2005伳侁6佋伮6伻佌 10:21 > > > >>>>伿佌伡侢伻佀: Ivy_Li > > > >>>>伋伃佀佂: r-help at stat.math.ethz.ch > > > >>>>佒侘佁佲: Re: [R] fail in adding library in new version. > > > >>>> > > > >>>> > > > >>>>On 6/5/05, Ivy_Li <Ivy_Li at smics.com> wrote: > > > >>>> > > > >>>> > > > >>>>>Hello everybody, > > > >>>>> Could I consult you a question? > > > >>>>> I always use R old version 1.9.1 . Because I can not add my library into the new version 2.0.0 by the same method as old version. > > > >>>> > > > >>>>Getting the latest version of R is strongly recommended. The suggestions > > > >>>>below all assume the latest version and may or may not work if you do > > > >>>>not upgrade. > > > >>>> > > > >>>> > > > >>>> > > > >>>>>* I have read the webpage <http://www.stats.ox.ac.uk/pub/Rtools> > > > >>>>>* Download the tools.zip > > > >>>>>* Unpack tools.zip into c:\cygwin > > > >>>>>* Install Active Perl in c:\Perl > > > >>>>>* Install the mingw32 port of gcc in c:\mingwin > > > >>>>>* Then go to "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable Balue" add ;c:\cygwin;c:\mingwin\bin > > > >>>> > > > >>>>You may need to put these at the beginning of the path rather than the end. > > > >>>>Also just as a check enter > > > >>>> path > > > >>>>at the console to make sure that you have them. You will likely > > > >>>>have to start a new console session and possibly even reboot. > > > >>>> > > > >>>>Also you need the Microsoft Help Compiler, hhc. Suggest > > > >>>>you reread the material on which tools you need. > > > >>>> > > > >>>> > > > >>>> > > > >>>>>* Save my library "example" into "c:\MyRpackages\" . But I am not sure what type it is, is it need suffix?" And I don't what its content, just my function script, no special format? > > > >>>> > > > >>>>In MyRPackages you would have a folder called example, in your case, > > > >>>>that contains the package. Within folder example, you would have the > > > >>>>DESCRIPTION file, the R folder, etc. > > > >>>> > > > >>>> > > > >>>> > > > >>>>>* Then I don't know where should I do this step: Type R CMD INSTALL --build example. Need I run R first? > > > >>>> > > > >>>>You don't have to run R first. You do need to make sure that R.exe can > > > >>>>be found on your path or else use the absolute path name in referring to R. > > > >>>>For example, if your path does not include R you could do something like this: > > > >>>> > > > >>>>cd \Program Files\R\rw2010 > > > >>>>bin\R cmd install /MyRPackages/example > > > >>> > > > >>> > > > >>>Sorry, there is an error in the above. It should be: > > > >>> > > > >>>bin\R CMD install c:/MyRPackages/example > > > >>> > > > >>>or > > > >>> > > > >>>bin\Rcmd install c:/MyRPackages/example > > > >>> > > > >>> > > > >>> > > > >>> > > > >>>>Be sure to use forward slashes where shown above and backslashes > > > >>>>where shown. > > > >>>> > > > >>>> > > > >>>> > > > >>>>> So There is a error after I do this step. It said it can not find somethig. I don't which step is wrong. It costed me much time. > > > >>>>> > > > >>>> > > > >>>>Try all these suggestions including upgrading R and if that does not work > > > >>>>try posting screen dumps of the actual errors you are getting. > > > >>>> > > > >>> > > > >>> > > > >>>Also try googling for > > > >>> > > > >>> making creating R packages > > > >>> > > > >>>and you will find some privately written tutorials on all this. > > > >>> > > > >>> > > > >>> > > > >>>------------------------------------------------------------------------ > > > >>> > > > >>>______________________________________________ > > > >>>R-help at stat.math.ethz.ch mailing list > > > >>>https://stat.ethz.ch/mailman/listinfo/r-help > > > >>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > > >> > > > >> > > > > > > > > >
Dear all, I really appreciate your help. I think I have a little advancement. ^_^ Now I use the package.skeleton() function to create a template. I type: f <- function(x,y) x+y g <- function(x,y) x-y d <- data.frame(a=1, b=2) e <- rnorm(1000) package.skeleton(list=c("f","g","d","e"), name="example") in R. I know it will create a folder named "example" in the path of "\R\rw2011\" I opened this folder, its format is similar as other library. Then I modify it "DESCRIPTION" file: Package: example Version: 1.0-1 Date: 2005-07-09 Title: My first function Author: Ivy <Ivy_Li at smics.com> Maintainer: Ivy <Ivy_Li at smics.com> Description: simple sum and subtract License: GPL version 2 or later Depends: R (>= 1.9), stats, graphics, utils I don't whether I should modify other "README" file. When I enter the Dos environment, at first, into the D:\>, I type the following code: cd Program Files\R\rw2011\ bin\R CMD install /example Well, there appeared error: ---------- Making package example ------------ adding build stamp to DESCRIPTION installing R files installing data files installing man source files installing indices not zipping data installing help >>> Building/Updating help pages for package 'example' Formats: text html latex example chm d text html latex example chm e text html latex example chm f text html latex example chm missing link(s): ~~fun~~ g text html latex example chm missing link(s): ~~fun~~ hhc: not found cp: cannot stat `D:/PROGRA~1/R/rw2011/example/chm/example.chm': No such file or directory make[1]: *** [chm-example] Error 1 make: *** [pkg-example] Error 2 *** Installation of example failed *** Removing 'D:/PROGRA~1/R/rw2011/library/example' That's it. I have to consult every R expert. Please help to solve this issue. Thank you very much! ---------- : Duncan Murdoch [mailto:murdoch at stats.uwo.ca] : 200578 19:34 : Ivy_Li : r-help at stat.math.ethz.ch : Re: [R] fail in adding library in new version. Ivy_Li wrote:> Dear all, > I really appreciate your help. I think I have a little advancement. ^_^ > > When I enter the Dos environment, at first, into the D:\>, I type the following code: > cd Program Files\R\rw2011\ > bin\R CMD install /example > > "example" is in the d:\, which include the R folder and "DESCRIPTION" file, But I wrote nothing in the "DESCRIPTION" file. Actually, I don't know what I should write in it.Read the R Extensions manual for a detailed description. You can use the package.skeleton() function to create a template, but you need to edit it to make it acceptable.> > Well, there are still aother error: > > ---------- Making package example ------------ > adding build stamp to DESCRIPTION > error happened.read_description(dfile) : file 'D:/example/DESCRIPTION' is not in valid DCF formatThat's complaining about your bad DESCRIPTION file. Duncan Murdoch> Stop execute > make[2]: *** [frontmatter] Error 1 > make[1]: *** [all] Error 2 > make: *** [pkg-example] Error 2 > *** Installation of example failed *** > Removing 'D:/PROGRA~1/R/rw2011/library/example' > > Please tell me which step is wrong? > Thanks a lot! > > BG > Ivy_Li > > > ---------- > : Gabor Grothendieck [mailto:ggrothendieck at gmail.com] > : 200577 20:57 > : Uwe Ligges > : Ivy_Li; r-help at stat.math.ethz.ch > : Re: : : [R] fail in adding library in new version. > > > On 7/7/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote: > >>Gabor Grothendieck wrote: >> >> >>>On 7/7/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote: >>> >>> >>>>Ivy_Li wrote: >>>> >>>> >>>> >>>>>Dear all, >>>>> I have done every step as the previous mail. >>>>>1. unpack tools.zip into c:\cygwin >>>>>2. install Active perl in c:\Perl >>>>>3. install the mingw32 in c:\mingwin >>>>>4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" , and they are in the beginning of the "Path" >>>> >>>> ^ >>>>such blanks are not allowed in the PATH variable >>>> >>>> >>>> >>>> >>>> >>>>> Because I install R in the D drive, so I set a fold "MyRpackages" in the same drive. Into the "MyRpackages" folder I write a R library named "example", include "DESCRIPTION" file and "R" folder. In the "R" folder, the "example" file just content very simple code as the previous mail said. >>>>> So in the Dos environment, at first, into the D:\>, I type the following code: >>>>>cd Program Files\R\rw2011\ >>>> >>>>MyRpackages does not need to be here. >>>> >>>> >>>> >>>>>bin\R CMD install /MyRpackages/example >>>> >>>>The first slash in "/MyRPackages" sugests that this is a top level >>>>directory, which does not exist. >>>>Even better, cd to MyRpackages, add R's bin dir to your path variable, >>>>and simply say: >>>> >>>>R CMD INSTALL example >>> >>> >>>Another possibility is to put Rcmd.bat from the batch file collection >>> >>> http://cran.r-project.org/contrib/extra/batchfiles/ >>> >>>in your path. It will use the registry to find R so you won't have >>>to modify your path (nor would you have to remodify it every time you >>>install a new version of R which is what you would otherwise have to do): >>> >>>cd \MyPackages >>>Rcmd install example >> >> >>Just for the records: >> >>1. "cd \MyPackages" won't work, as I have already explained above. > > > If MyPackages is not a top level directory in the current drive > then it will not work. Otherwise it does work. > > >>2. I do *not* recommend this way, in particular I find it misleading to >>provide these batch files on CRAN. >> > > > The alternative, at least as discussed in your post, is more work > since one will then have to change one's path every time one > reinstalls R. This is just needless extra work and is error prone. If you > forget to do it then you will be accessing the bin directory of the > wrong version of R. > > >>>>> There are some error: >>>>>'make' is neither internal or external command, nor executable operation or batch file >>>>>*** installation of example failed *** >>>> >>>>Well, make.exe is not find in your path. Please check whether the file >>>>exists and the path has been added. >>>> >>>>Uwe Ligges >>>> >>>> >>>> >>>> >>>>>Removing 'D:/PROGRA~1/R/rw2011/library/example' >>>>> >>>>>I think I have closed to success. heehee~~~~~ >>>>>Thank you for your help. >>>>>I still need you and others help. Thank you very much! >>>>> >>>>> >>>>>---------- >>>>>: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] >>>>>: 2005630 19:16 >>>>>: Ivy_Li >>>>>: r-help at stat.math.ethz.ch >>>>>: Re: : [R] fail in adding library in new version. >>>>> >>>>> >>>>>On 6/30/05, Ivy_Li <Ivy_Li at smics.com> wrote: >>>>> >>>>> >>>>> >>>>>>Dear Gabor, >>>>>> Thank your for helping me so much! >>>>>> I have loaded R the newest version 2.1.1. Then I setup it in the path of D:\program files\R\ >>>>>>1. unpack tools.zip into c:\cygwin >>>>>>2. install Active perl in c:\Perl >>>>>>3. install the mingw32 in c:\mingwin >>>>>>4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable" (In your previous mail, you said "put these at the beginning of the path", I don't understand what is your meaning. Which path?) >>>>> >>>>> >>>>>If in the console you enter the command: >>>>> >>>>>path >>>>> >>>>>then it will display a semicolon separated list of folders. You want the folder >>>>>that contains the tools to be at the beginning so that you eliminate >>>>>the possibility >>>>>of finding a different program of the same name first in a folder that comes >>>>>prior to the one where the tools are stored. >>>>> >>>>> >>>>> >>>>> >>>>>>5. I tried an library example. I set a new folder named "example" in the "c:\MyRpackages\". And In the "example" folder, it contain an "DESCRIPTION" file and "R" folder. in "R" folder contain a "example" file. I just write very simple script in it: >>>>>>a<-2; b<-3;sum <- sum(a,b); print(paste(a,"+",b,"=",sum)) >>>>>> >>>>>>6. I opened the DOS environment. Into the "D:\>" Type the following code: >>>>>>cd \Program Files\R\rw2010 >>>>>>But I don't understand the second line you writed in your previous mail: "bin\R cmd install /MyRPackages/example" >>>>> >>>>> >>>>>I was assuming that MyRPackages and R are on the same disk. If they are not >>>>>then you need to specify the disk too. That is if MyRPackages is on C and R >>>>>is installed on D then install your package via: >>>>> >>>>>d: >>>>>cd \Program Files\R\rw2010 >>>>>bin\R CMD install c:/MyRPackages/example >>>>> >>>>>Note that bin\R means to run R.exe in the bin subfolder of the current folder >>>>>using command script install and the indicated source package. >>>>> >>>>> >>>>> >>>>> >>>>>>I am not sure that I set up R in "D:\" But I do so much action in C:\ Did I do the correct action? Did I do the action into the correct path? >>>>> >>>>> >>>>>If you are not sure where R is installed then enter the following at the Windows >>>>>console prompt to find out (this will work provided you let it install the key >>>>>into the registry when you installed R initially). The reg command is a command >>>>>built into Windows (I used XP but I assume its the same on other versions) >>>>>that will query the Windows registry: >>>>> >>>>>reg query hklm\software\r-core\r /v InstallPath >>>>> >>>>> >>>>> >>>>> >>>>>>I still need your and others help. Thank you very much! >>>>>> >>>>>> >>>>>> >>>>>>---------- >>>>>>: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] >>>>>>: 200566 10:21 >>>>>>: Ivy_Li >>>>>>: r-help at stat.math.ethz.ch >>>>>>: Re: [R] fail in adding library in new version. >>>>>> >>>>>> >>>>>>On 6/5/05, Ivy_Li <Ivy_Li at smics.com> wrote: >>>>>> >>>>>> >>>>>> >>>>>>>Hello everybody, >>>>>>> Could I consult you a question? >>>>>>> I always use R old version 1.9.1 . Because I can not add my library into the new version 2.0.0 by the same method as old version. >>>>>> >>>>>>Getting the latest version of R is strongly recommended. The suggestions >>>>>>below all assume the latest version and may or may not work if you do >>>>>>not upgrade. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>* I have read the webpage <http://www.stats.ox.ac.uk/pub/Rtools> >>>>>>>* Download the tools.zip >>>>>>>* Unpack tools.zip into c:\cygwin >>>>>>>* Install Active Perl in c:\Perl >>>>>>>* Install the mingw32 port of gcc in c:\mingwin >>>>>>>* Then go to "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable Balue" add ;c:\cygwin;c:\mingwin\bin >>>>>> >>>>>>You may need to put these at the beginning of the path rather than the end. >>>>>>Also just as a check enter >>>>>> path >>>>>>at the console to make sure that you have them. You will likely >>>>>>have to start a new console session and possibly even reboot. >>>>>> >>>>>>Also you need the Microsoft Help Compiler, hhc. Suggest >>>>>>you reread the material on which tools you need. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>* Save my library "example" into "c:\MyRpackages\" . But I am not sure what type it is, is it need suffix?" And I don't what its content, just my function script, no special format? >>>>>> >>>>>>In MyRPackages you would have a folder called example, in your case, >>>>>>that contains the package. Within folder example, you would have the >>>>>>DESCRIPTION file, the R folder, etc. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>* Then I don't know where should I do this step: Type R CMD INSTALL --build example. Need I run R first? >>>>>> >>>>>>You don't have to run R first. You do need to make sure that R.exe can >>>>>>be found on your path or else use the absolute path name in referring to R. >>>>>>For example, if your path does not include R you could do something like this: >>>>>> >>>>>>cd \Program Files\R\rw2010 >>>>>>bin\R cmd install /MyRPackages/example >>>>> >>>>> >>>>>Sorry, there is an error in the above. It should be: >>>>> >>>>>bin\R CMD install c:/MyRPackages/example >>>>> >>>>>or >>>>> >>>>>bin\Rcmd install c:/MyRPackages/example >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Be sure to use forward slashes where shown above and backslashes >>>>>>where shown. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> So There is a error after I do this step. It said it can not find somethig. I don't which step is wrong. It costed me much time. >>>>>>> >>>>>> >>>>>>Try all these suggestions including upgrading R and if that does not work >>>>>>try posting screen dumps of the actual errors you are getting. >>>>>> >>>>> >>>>> >>>>>Also try googling for >>>>> >>>>> making creating R packages >>>>> >>>>>and you will find some privately written tutorials on all this. >>>>> >>>>> >>>>> >>>>>------------------------------------------------------------------------ >>>>> >>>>>______________________________________________ >>>>>R-help at stat.math.ethz.ch mailing list >>>>>https://stat.ethz.ch/mailman/listinfo/r-help >>>>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >>>> >>>> >> > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html