Thanks for your help on moving files from S+ to R and on attaching directories. If attaching directories is NOT possible in R, is there any other way to separate objects into different folders or something similar? For example, to keep user functions for multivariate analysis in a different "place" than user functions on time series, or to keep data objects of project_1 in a different place than data objects of project_2. Also, where does R put the objects that are saved? in .Rdata? Could not be possible to have different .Rdata (.Rdata_1, .Rdata_2...) ? Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es http://pangea.ija.csic.es/alobo -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> On Fri, 16 Jul 1999 12:48:52 +0200 (MET DST), >>>>> Agustin Lobo (AL) wrote:AL> Thanks for your help on moving files from AL> S+ to R and on attaching directories. AL> If attaching directories is NOT possible in R, AL> is there any other way to separate AL> objects into different folders or something similar? AL> For example, to keep user functions for multivariate AL> analysis in a different "place" than user functions on AL> time series, or to keep data objects of project_1 AL> in a different place than data objects of project_2. The preferred way of doing this is creating a seperate package for these, see help(library) for details. AL> Also, where does R put the objects that are saved? AL> in .Rdata? Could not be possible to have different .Rdata AL> (.Rdata_1, .Rdata_2...) ? R creates the .RData file in the current working directory, so the easiest way is to create a directory for each project and simply start R there. .fritz -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi! The Writing R Extensions document (R-exts.pdf) states that, for creating an R library, "" The `R'' subdirectory contains R code files. The code files to be installed must start with a (lower or upper case) letter and have one of the extensions `.R'', `.S'', `.q'', `.r'', or `.s''. "" Does this mean that each function sould go into a separate *.R file? I understand that I can save a given function as save(test,file="R/test.R") But I have many functions, should I make that each function go to a separate file? Is there any utility for doing this? Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 22 Jun 2001, Agustin Lobo wrote:> > Hi! > > The Writing R Extensions document (R-exts.pdf) states that, > for creating an R library, > > "" > The `R'' subdirectory contains R code files. The code files to be installed > must start with > a (lower or upper case) letter and have one of the extensions `.R'', `.S'', > `.q'', `.r'', or `.s''. > "" > > Does this mean that each function sould go into > a separate *.R file? > > I understand that I can save a given function as > > save(test,file="R/test.R") > > But I have many functions, should I make that each function > go to a separate file? Is there any utility for doing > this?You can use one of more files as you like. You can also just concatentate the small files into one large file via `cat''. Most packages use one file for each group of functions, as indeed do the R sources.> > Thanks > > Agus > > Dr. Agustin Lobo > Instituto de Ciencias de la Tierra (CSIC) > Lluis Sole Sabaris s/n > 08028 Barcelona SPAIN > tel 34 93409 5410 > fax 34 93411 0012 > alobo at ija.csic.es > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 22 Jun 2001, Agustin Lobo wrote:> > Hi! > > The Writing R Extensions document (R-exts.pdf) states that, > for creating an R library, > > "" > The `R'' subdirectory contains R code files. The code files to be installed > must start with > a (lower or upper case) letter and have one of the extensions `.R'', `.S'', > `.q'', `.r'', or `.s''. > "" > > Does this mean that each function sould go into > a separate *.R file? > > I understand that I can save a given function as > > save(test,file="R/test.R")No, no, no. This saves a binary version of the file. You need to use dump().> But I have many functions, should I make that each function > go to a separate file? Is there any utility for doing > this?One file or many is ok. Most people find it easier to write the functions in .R files to begin with, but the new 1.3.0 has an experimental function package.skeleton() that does some of the work of setting up a package. It is easier to find things in the documentation if you use our terminology: you are trying to create a package, not a library. A library is a place to put packages. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Well, thanks to you all I''ve been able to install my first little package. I''ve dumped some of my Splus(PC) functions to an ascii file (*.R), created the directory structure and the DESCRIPTION and INDEX files. Then I checked and installed with: R CMD INSTALL -l ~/.R/library Sutilpangea because I found that I have an .R directory in my home where a subdirectory .R/library has links to where the packages really are (/usr/lib/R/library). Therefore, I decided to keep my own packages in .R/library while the CRAN packages really stay in /usr/lib/R/library. Now the only problem is that, by default, R searches packages in /usr/lib/R/library because of the value of R_HOME:> system ("echo $R_HOME")/usr/lib/R It would be better if R would search packages in my .R/library directory, where R would find both my packages and the links for the CRAN packages. How can I change the deafault searching path for the packages? (I know I can always do library(xxx, lib.loc="/home/alobo/.R/library"), but it would be nicer having this as default). Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> On Tue, 26 Jun 2001 14:10:00 +0200 (MET DST), >>>>> Agustin Lobo (AL) wrote:> Well, thanks to you all > I''ve been able to install my first > little package. I''ve dumped > some of my Splus(PC) functions > to an ascii file (*.R), created > the directory structure and the > DESCRIPTION and INDEX files. Then > I checked and installed with: > R CMD INSTALL -l ~/.R/library Sutilpangea This is not a good idea, because the .R directory is a *temporary* directory that R uses (on unix), and basically is created newly every time you do help.start(), so your package will get deleted if you install it there. A typical place for private packages would be $HOME/lib/R but of course you''re free to use any place you like (except .R :-) > because I found that I have an .R directory > in my home where a subdirectory .R/library > has links to where the packages really are > (/usr/lib/R/library). Therefore, I decided > to keep my own packages in .R/library > while the CRAN packages really stay in > /usr/lib/R/library. > Now the only problem is that, by default, R > searches packages in /usr/lib/R/library > because of the value of R_HOME: >> system ("echo $R_HOME") > /usr/lib/R > It would be better if R would > search packages in my .R/library > directory, where R would find both my packages > and the links for the CRAN packages. > How can I change the deafault searching > path for the packages? (I know > I can always do library(xxx, lib.loc="/home/alobo/.R/library"), > but it would be nicer having this as default). One possible way to solve this problem: R searches all libraries in the environment variable R_LIBS, please read the documentation. Hope this helps, -- ------------------------------------------------------------------- Friedrich Leisch Institut f?r Statistik Tel: (+43 1) 58801 10715 Technische Universit?t Wien Fax: (+43 1) 58801 10798 Wiedner Hauptstra?e 8-10/1071 Friedrich.Leisch at ci.tuwien.ac.at A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch ------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi! Is there a function like the Splus For (not for) in R or is it just that such a function is not needed in R because of its enhanced loop performance? Thanks Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._