Installing R packages without admin rights on MS Windows

Transcript

1 2014-11-19, 9:42 PM Installing R packages without admin rights on MS Windows mages' blog (http://www.magesblog.com/) FOLLOW BY EMAIL Installing R packages without admin Email address... Submit rights on MS Windows 26 Apr 2012 07:26 (2012-04-26T07:26:00+01:00) " admin ! POPULAR POSTS , installation (http://www.magesblog.com/search/label/admin) , packages (http://www.magesblog.com/search/label/installation) (http://www.magesblog.com/search/label/packages) R , , Tutorials (http://www.magesblog.com/search/label/R) Windows (http://www.magesblog.com/search/label/Tutorials) , (http://www.magesblog.com/search/label/Windows) (http://www.magesblog.com/2013/02/first-steps- of-using-googlevis-on-shiny.html) First steps of using googleVis on shiny (http://www.magesblog.com/2013/02/first-steps- of-using-googlevis-on-shiny.html) have done a fantastic job with The guys at RStudio (http://4.bp.blogspot.com/- shiny . It is really easy to build web apps with R using shiny. With the help of Joe Ch... gPumYtOux4w/T5JqOHuzWlI/AAAAAAAAAPs/MS_ARyFDXp8/s1600/IMG_2425.jpg) Is there a life outside the office? (http://www.magesblog.com/2012/11/datatable- Photo: Markus Gesmann rocks-data-manipulation-fast.html) It is not unusual that you will not have admin rights in an IT controlled office environment. But then Data.table rocks! Data manipulation the fast way in again the limitations set by the IT department can spark of some creativity. And I have to admit (http://www.magesblog.com/2012/11/datatable- R that I enjoy this kind of troubleshooting. rocks-data-manipulation-fast.html) I really should make it a habit of using data.table . The other day I ended up in front of a Windows PC with R installed, but a locked down The speed and simplicity of this R package are "C:\Programme Files" folder. That ment that R couldn't install any packages into the default astonishing. Here is a simple exampl... directory with the version R-X.Y.Z (replace "C:\Programme Files\R\R-X.Y.Z\library" number of R installed). install.packages Never-mind, there is an option for that, the libs function. argument in the library statement then as well. Fair However, I have to use the same argument also in the enough, yet it is more convenient to set the directory somewhere globally. (http://www.magesblog.com/2013/03/how-to-use- optim-in-r.html) How to use optim in R First of all I decided that I wanted to install my R packages into C:\Users\MyNAME\R , a folder to (http://www.magesblog.com/2013/03/how-to-use- MyNAME which I had read/write access (replace , or the whole path with what works for you). The R optim-in-r.html) .libPaths(c("C:\\Users\\MyNAME\\R", .libPaths())) will make this directory command the default directory for any additional packages I may want to install, and as it is put at the front A friend of mine asked me the other day how she will find them first as well. of my search path, library could use the function optim in R to fit data. Of course there are functions for fitting da... The next step is to enable R to execute the above command at start up. For that I created the R file C:\Users\MyNAME\R\Rconfigure_default.R with the following content: Say it in R with "by", "apply" and friends (http://www.magesblog.com/2012/01/say-it-in-r- with-by-apply-and-friends.html) 1 Iris versicolor By Danielle Langlois License: CC-BY- Page 1 of 5 http://www.magesblog.com/2012/04/installing-r-packages-without-admin.html

2 2014-11-19, 9:42 PM Installing R packages without admin rights on MS Windows 2 ##+Rconfigure_default.R SA R is a language , as Luis Apiolaza pointed out in 3 utils ) library( his recent post . This is ab... 4 ##+Using+Internet+Explorer+proxy+settings+is 5 ##+often+helpful+in+an+IT+controlled+environment 6 ) setInternet2( TRUE 7 ##+PreKselect+my+nearest+CRAN+mirror+in+London 8 ' repos ' http://cran.ma.imperial.ac.uk/ ) = options( 9 ##+Set+default+directory+for+user+installed+packages .libPaths(c( " ,+.libPaths())) R MyNAME \\ Users \\ C: \\ " (http://www.magesblog.com/2012/09/interactive- web-graphs-with-r-overview.html) view raw (https://gist.github.com/mages/2472835/raw/Rconfigure_default.R) Rconfigure_default.R ❤ hosted with (https://gist.github.com/mages/2472835#file-rconfigure_default-r) GitHub by Interactive web graphs with R - Overview and (https://github.com) googleVis tutorial (http://www.magesblog.com/2012/09/interactive- web-graphs-with-r-overview.html) to my desktop with the target set to: Rgui.exe Finally I added a new shortcut to Today I feel very lucky, as I have been invited to the "C:\Program Files\R\R-2.X.Y\bin\i386\Rgui.exe" R_PROFILE_USER="C:\Users\MyNA to give a Royal Statistical Society conference ME\R\Rconfigure_default.r" tutorial on interactive web graphs wi... (http://www.magesblog.com/2012/05/interactive- reports-in-r-with-knitr-and.html) Interactive reports in R with knitr and RStudio (http://www.magesblog.com/2012/05/interactive- (http://1.bp.blogspot.com/-G-11GvF3a- reports-in-r-with-knitr-and.html) at the R Last Saturday I met the guys from RStudio in Finance conference in Chicago. I was curious to find out what RStudio could offer. I... Q/T5g7dwfPwwI/AAAAAAAAAP4/VfXbQ0P0iIA/s1600/photo.PNG) Job done. R will happily install any new packages locally and find them as well when I use (http://www.magesblog.com/2011/12/fitting- . For more information see also the library (hhttp://cran.r- or require R FAQs distributions-with-r.html) . project.org/faqs.html) Fitting distributions with R (http://www.magesblog.com/2011/12/fitting- distributions-with-r.html) (https://plus.google.com/share? + Fitting distribution with R is something I have to do u=http://www.magesblog.com/2012/04/installing-r-packages-without- once in a while, but where do I start? A good admin.html&t=Installing R packages without admin rights on MS Windows) starting point to learn more about dis... $ (http://www.facebook.com/sharer.php? u=http://www.magesblog.com/2012/04/installing-r-packages-without- admin.html&t=Installing R packages without admin rights on MS Windows) % (http://twitter.com/intent/tweet?text=Installing R packages without admin (http://www.magesblog.com/2012/06/transforming- rights on MS Windows&url=http://www.magesblog.com/2012/04/installing-r- subsets-of-data-in-r-with.html) packages-without-admin.html) Transforming subsets of data in R with by, ddply & (http://www.linkedin.com/shareArticle? and data.table mini=true&url=http://www.magesblog.com/2012/04/installing-r-packages- (http://www.magesblog.com/2012/06/transforming- without-admin.html&title=Installing R packages without admin rights on MS subsets-of-data-in-r-with.html) Windows) Transforming data sets with R is usually the Related Posts starting point of my data analysis work. Here is a scenario which comes up from time to time: t... Page 2 of 5 http://www.magesblog.com/2012/04/installing-r-packages-without-admin.html

3 2014-11-19, 9:42 PM Installing R packages without admin rights on MS Windows (http://www.magesblog.com/2012/12/changing- colours-and-legends-in-lattice.html) Changing colours and legends in lattice plots (http://www.magesblog.com/2012/12/changing- Visualising the seasonality of colours-and-legends-in-lattice.html) Atl... plots are a great way of displaying Lattice multivariate data in R. Deepayan Sarkar, the author (http://www.magesblog.com/2014/10/visualising-seasonality-of-atlantic.html) of lattice, has written a fantastic book ab... (http://www.magesblog.com/2012/05/interactive- html-presentation-with-r.html) Running RStudio via Docker in Interactive HTML presentation with R, googleVis, the C... knitr, pandoc and slidy (http://www.magesblog.com/2012/05/interactive- (http://www.magesblog.com/2014/09/running-rstudio-via-docker-in-cloud.html) html-presentation-with-r.html) Tonight I will give a talk at the Cambridge R user about googleVis . Following my good group with knitr experience and RStudio to create... BLOG ARCHIVE High resolution graphics with R ► 2014 (http://www.magesblog.com/search?updated- min=2014-01-01T00:00:00Z&updated-max=2015-01- (http://www.magesblog.com/2013/10/high-resolution-graphics-with-r.html) 49 ( 01T00:00:00Z&max-results=49) ) ► 2013 (http://www.magesblog.com/search?updated- (http://www.magesblog.com/2012/05/next-kolner-r-user-meeting-6-july- Newer Post min=2013-01-01T00:00:00Z&updated-max=2014-01- 2012.html) 01T00:00:00Z&max-results=50) ) ( 54 (http://www.magesblog.com/2012/04/from-guardians-data-blog- Older Post 2012 (http://www.magesblog.com/search?updated- ▼ visualising.html) min=2012-01-01T00:00:00Z&updated-max=2013-01- ( 01T00:00:00Z&max-results=50) ) 59 ► December mages' blog 8 Comments Login ! (http://www.magesblog.com/2012_12_01_archive.html) ) ( 4 Favorite Sort by Best Share ★ ⤤ ► November (http://www.magesblog.com/2012_11_01_archive.html) Join the discussion... ) ( 5 October ► (http://www.magesblog.com/2012_10_01_archive.html) Christian Kaas 9 months ago • ) 5 ( Thanks Markus I googled my way through a lot of failed attempts before finding this site. This was exactly ► September what i needed. Thanks for putting this on your blog! (http://www.magesblog.com/2012_09_01_archive.html) Reply • • Share › △ ▽ ( ) 4 ► August • a year ago Danièle (http://www.magesblog.com/2012_08_01_archive.html) How would you proceed with R Studio? ) 5 ( I am newbie at R and have no adminsitration rights which does not help! Thanks! http://www.magesblog.com/2012/04/installing-r-packages-without-admin.html Page 3 of 5

4 2014-11-19, 9:42 PM Installing R packages without admin rights on MS Windows Thanks! ► July Reply Share › • • △ ▽ (http://www.magesblog.com/2012_07_01_archive.html) ( ) 4 Mod a year ago > Danièle • Markus Gesmann ► June Alternatively you can store the above code in the .Rprofile located in your working (http://www.magesblog.com/2012_06_01_archive.html) directory. RStudio will read this file on start up. Read the RStduio documentation ( 5 ) for more details: http://www.rstudio.com/ide/doc... May ► • Reply • Share › △ ▽ (http://www.magesblog.com/2012_05_01_archive.html) Richard Todd • a year ago ( 5 ) Lloyd's IT giving you a hard time? Good guide this, insurance needs to wake up and ▼ April embrace creativity. (http://www.magesblog.com/2012_04_01_archive.html) Share › • Reply • △ ▽ ) 4 ( Installing R packages without admin rights on MS • andrezalook 2 years ago W... what if the problem is to download the packages? (http://www.magesblog.com/2012/04/installing- I have no permission to download stu ff . r-packages-without-admin.html) Share › Reply • • △ ▽ From the Guardian's data blog: Visualising risk Mod andrezalook 2 years ago Markus Gesmann > • (http://www.magesblog.com/2012/04/from- ee or beer, try to understand why the have ff Well, talk to the IT guys, buy them co guardians-data-blog-visualising.html) locked down your rights. What are the risks? What are the business benefits on Sweeping through data in R the other hand if you were able to install packages. Would those business benefits (http://www.magesblog.com/2012/04/sweeping- outweigh the risks? If they do, then you are in a pretty good position to negotiate. through-data-in-r.html) Reply Share › • • ▽ △ Review: Kölner R Meeting 30 March 2012 (http://www.magesblog.com/2012/04/review- andrezalook Markus Gesmann > 2 years ago • kolner-r-meeting-30-march-2012.html) ahaha, ok (: March ► • • Share › Reply ▽ △ (http://www.magesblog.com/2012_03_01_archive.html) cmdlintips 2 years ago • 7 ) ( Nice.. Here my post on how to install packages locally in from terminal ► February http://cmdlinetips.com/2012/05... (http://www.magesblog.com/2012_02_01_archive.html) Share › • Reply • ▽ △ 6 ( ) January ► WHAT'S THIS? (http://www.magesblog.com/2012_01_01_archive.html) ALSO ON MAGES' BLOG ( 5 ) Annotation charts and histograms with Sankey diagrams with googleVis • googleVis 8 months ago 23 comments ► 2011 (http://www.magesblog.com/search?updated- 7 months ago • 9 comments January Weiner — Just a minor thing -- I am min=2011-01-01T00:00:00Z&updated-max=2012-01- the author of the riverplot package :-) is This — George Dontas it. do I I When how 16 ) ( 01T00:00:00Z&max-results=16) dbl-click the .html file the chart is shown I ... (or runApp, correctly. when But Phase plane analysis in R GrapheR: A GUI for base graphics in R 5 comments 3 months ago 1 comment • 16 days ago • MY BLOG LIST annoporci Brilliant! I didn't know — Markus Gesmann — Nice, thanks for sharing.I much Maple's than plots phase about the package. prefer CRANberries CRANberries Matlab/Octave. freeware, I prefer ... For (http://dirk.eddelbuettel.com/cranberries) (http://dirk.eddelbuettel.com/cranberries) New package ilc with initial version 1.0 (http://dirk.eddelbuettel.com/cranberries/2014/11/19#ilc_1.0) Privacy Subscribe Add Disqus to your site ) ✉ d R bloggers R bloggers (http://www.r- (http://www.r- bloggers.com) bloggers.com) Trading The Odds Volatility Risk Premium: Addressing Data Mining and Curve-Fitting (http://www.r-bloggers.com/trading-the-odds- volatility-risk-premium-addressing-data-mining- and-curve-fitting/) Seth's Blog Seth's Blog (http://sethgodin.typepad.com/seths_blog/) (http://sethgodin.typepad.com/seths_blog/) The wrong question to ask yourself before crowdfunding (http://feeds.feedblitz.com/~/79015699/0/sethsblog~The- wrong-question-to-ask-yourself-before- Page 4 of 5 http://www.magesblog.com/2012/04/installing-r-packages-without-admin.html

5 2014-11-19, 9:42 PM Installing R packages without admin rights on MS Windows crowdfunding.html) Freakonometrics Freakonometrics (http://freakonometrics.hypotheses.org) (http://freakonometrics.hypotheses.org) Reinterpreting Lee-Carter Mortality Model (http://freakonometrics.hypotheses.org/17931) Tim Harford Tim Harford (http://timharford.com) (http://timharford.com) Finance and the jelly bean problem (http://timharford.com/2014/11/finance-and-the- jelly-bean-problem/) Portfolio Probe Portfolio Probe (http://www.portfolioprobe.com) (http://www.portfolioprobe.com) US market portrait 2014 week 46 (http://www.portfolioprobe.com/2014/11/15/us- market-portrait-2014-week-46/) Markus Gesmann CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc- sa/3.0/) Blogger Templates 2014 . Powered by © mages' blog mages' blog (http://templates.weblogtemplates.net/) Blogger . (http://www.blogger.com/) (http://www.magesblog.com/) Page 5 of 5 http://www.magesblog.com/2012/04/installing-r-packages-without-admin.html

Related documents