[R] Invitation to connect on LinkedIn
LinkedIn Scott Hyde requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Scott Accept invitation from Scott Hyde http://www.linkedin.com/e/qlt6CtWzi7sEoE_As_C0_wMfEZD2c-gGLFL6LO/blk/I1794815568_2/1BpC5vrmRLoRZcjkkZt5YCpnlOt3RApnhMpmdzgmhxrSNBszYOnPwSdjkNe3gVdP59bTBHrmdzpD5nbP4Oe30PdPsRc34LrCBxbOYWrSlI/EML_comm_afe/ View invitation from Scott Hyde http://www.linkedin.com/e/qlt6CtWzi7sEoE_As_C0_wMfEZD2c-gGLFL6LO/blk/I1794815568_2/39ve3oRdj4Ud3ATckALqnpPbOYWrSlI/svi/ -- DID YOU KNOW you can use your LinkedIn profile as your website? Select a vanity URL and then promote this address on your business cards, email signatures, website, etc http://www.linkedin.com/e/ewp/inv-21/ -- (c) 2010, LinkedIn Corporation [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] a --no-save option for Rprofile.site?
I need to set up Rcmdr for use in a testing center that uses Windows. Since it is in a testing center, we don't want to have data saved, and want it cleared (or never saved) each time R or Rcmdr is run. The method I used to get Rcmdr to run automatically is to add the lines: defpack = getOption(defaultPackages) mylibs = c(lattice,MASS,Matrix,m343linalg) if(Sys.getenv(RCMDR) == TRUE) mylibs = c(mylibs,Rcmdr) options(defaultPackages = c(defpack,mylibs)) - to the file C:\Program Files\R\R-2.9.1\etc\Rprofile.site I then placed a shortcut to Rgui on the desktop and renamed it Rcmdr. The contents of the Target being replaced with C:\Program Files\R\R-2.9.1\bin\Rgui.exe --sdi RCMDR=TRUE I've found that I can use --no-save after the RCMDR=TRUE above that will do what I want -- don't save any data after exiting. However, this isn't the most secure -- a student only has to delete the option, or start R a different way. Is there a way to place an option or statement in Rprofile.site file to accomplish the same thing? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Starting RCmdr from the Commandline (and a shortcut) in Windows
I thought I'd share the experience I had in getting Rcmdr to start automatically when R starts up. I'd read of solutions that would start Rcmdr every time R started up, but I didn't want it to start every time, only when I wanted it to. First, I created a shortcut on the desktop to R and changed its name to Rcmdr. Next, I changed the target of the shortcut to (edit the version number if needed): C:\Program Files\R\R-2.9.1\bin\Rgui.exe --sdi RCMDR=TRUE I added the options --sdi (I like this interface the best) and created the RCMDR=TRUE environmental variable. Next, I edited the Rprofile.site file in the etc directory of the R installation and added the following lines to the bottom: defpack = getOption(defaultPackages) mylibs = c(lattice,MASS,Matrix) if(Sys.getenv(RCMDR) == TRUE) mylibs = c(mylibs,Rcmdr) options(defaultPackages = c(defpack,mylibs)) Note that mylibs is the list of libraries that I wanted autoloaded. Although Matrix will autoload lattice, I didn't want it to announce it every time R started, so I loaded it first. Now clicking on Rcmdr on the desktop starts up Rcmdr (in addition to R), and starting up R regularly does not start Rcmdr, which is what I wanted! I hope someone else may find this useful! -Scott * Scott K. Hyde Assistant Professor of Statistics and Mathematics College of Math and Sciences Brigham Young University -- Hawaii Laie, HI 96762 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Return variable assignments from a function
I'd like to perform return variable assignments like matlab. For example, the following function would return A, B, and c to the script that called it. = function [A,B,c] = simple(m,n) A=[ 3 2; 3 3] B=m c=1:n = I'd like to do similar assignments in R, but I seem to be able to only return one variable. I tried to use a list to return all the arguments, but then each has to be referred to using the list. For example: = simple - function(m,n) { A=matrix(c(3,3,2,3),2,2) B=m c=1:n list(A=A,B=B,c=c) } stuff=simple(2,3) stuff $A [,1] [,2] [1,]32 [2,]33 $B [1] 2 $c [1] 1 2 3 = Then I could assign each variable like this (which is what I'd like to avoid): = A=stuff$A B=stuff$B c=stuff$c rm(stuff) #stuff isn't needed anymore. = I've even toyed with the superassignment operator, which also works, but I think it doesn't work for functions of functions. The following example works. = simple2 - function(m,n) { A - matrix(c(3,3,2,3),2,2) B - m c - 1:n } stuff2=simple2(2,3) stuff2 [1] 1 2 3 A [,1] [,2] [1,]32 [2,]33 B [1] 2 c [1] 1 2 3 = In the example below, I call the function ten inside the function nine. I'm expecting that the variable b should change only in the function nine (and not in the global environment). In other words, I think the line (nine) b= 9 should be (nine) b= 10. Can someone help me know how to do this correctly? -Scott = nine = function(a) { b - 9 ten(a) print(paste((nine) b=,b)) } ten = function(d) { b - 10 print(paste((ten) b=,b)) print(paste((ten) d=,d)) d } nine(5) [1] (ten) b= 10 [1] (ten) d= 5 [1] (nine) b= 9 b [1] 10 = [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Cross Compiling
Hello All, I have a Linux computer and do all of my work from it. However, I teach also, which means that many of my students use windows. Hence, I need to create packages that work under windows as well as Linux. I have tried to follow the directions at http://cran.r-project.org/doc/contrib/cross-build.pdf which is the document Building Microsoft Windows Versions of R and R packages under Intel Linux. This has been very helpful. However, the file R_Tcl.zip is no longer available, so I cannot compile R for Windows using the make R command as described in the document. Is it necessary to have the Tcl sources in there? If it is, how should the directions be modified to enable the complete compilation of R? None of my code contains C, Fortran, or any other language. It is just plain R code. I would think that this would be easier to convert over. Is it? I tried the following and it seems to work, but I'd like to know if it is safe. 1. Build package with pre-compiled binary package option R CMD build --binary pkgname 2. convert the resulting tar.gz file to a zip archive. 3. Install it on a windows machine. This process successfully works when I install it on a windows machine, but I have no idea how safe it is. -- * Scott K. Hyde Assistant Professor of Statistics and Mathematics School of Computing Brigham Young University -- Hawaii __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Create a local repository
I'd like to create a small local repository that would be used to install a package for a class of students at their home. I don't want to upload it to CRAN, as I don't think it should be disseminated at that level. What I'd like to do is: where=http://mysite.com/; install.packages(mypackage,contriburl=where) When I try this, (after placing my mypackage_1.0.tar.gz file in the main directory of http://mysite.com/, it responds, in R, when I want to install the package: Warning: unable to access index for repository http://mysite.com/ What do I need to do? -Scott -- * Scott K. Hyde Assistant Professor of Statistics and Mathematics School of Computing Brigham Young University -- Hawaii __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.