USGS - science for a changing world
National Park Service.

USGS Status and Trends of Biological Resources   -   NPS Inventory and Monitoring

Learn R

R is a free software environment for statistical computing and graphics.
http://www.r-project.org/
Home | Getting Started | Schedule | References | FAQ | Discussion | Tom's site
For more information, please contact Paul Geissler (Paul_Geissler@usgs.gov).

The US Geological Survey (USGS) and National Park Service (NPS) offered a free short-course on R, a widely-used open-source (free) statistical package.using conference calls and live web demonstrations. The course has now ended, but the course materials and recordings of the presentations are available on this site. We plan on offering the course again in the Fall 2009. For more information or to be added to our mailing list, please send an email to Paul Geissler (Paul_Geissler@usgs.gov, 970-226-9482, USGS Status and Trends of Biological Resources Program) or
Tom Philippi (Tom_Philippi@nps.gov, 970-225-3586, NPS Inventory and Monitoring Program).

The course is designed for natural resource managers and is open to all who are interested without charge. R (the open-source version of S) provides a comprehensive environment for statistical analysis and graphics and is unrivaled in the availability of new, cutting-edge applications. It runs under most operating systems. Audio of the presentations is available either using Voice of IP through your computer speakers and optional microphone or headset or by calling a phone bridge long distance. Live video of the presentor's computer screen is available over the web. You can also share your computer's screen with other participants when asking a question or making a point. There are no specific prerequisites but some knowledge of statistics would be helpful. A basic knowledge of computers and the internet will be assumed.

R is a very powerful system for statistical computations and graphics, which runs on Windows, Unix and Mac computers. You can think of it as a combination of a statistics package and a programming language. It can be downloaded for free from http://www.r-project.org/ . The R Wiki provides an online forum http://wiki.r-project.org/rwiki/doku.php and documentation.
ADVANTAGES
•  With the increasing cost of commercial statistical package, a free package is very attractive. However, free does not imply second rate. R is a high quality package that is better than commercial package in many respects.
•  There are over 840 contributed packages (extensions) available for R to perform a great variety of statistical and graphical procedures.
•  R includes a powerful programming language for selecting, manipulating and transforming data.
•  R is interactive and supports data analysis, which should be interactive and exploratory.
•  Although SAS is the most common statistical package in general use, R (or S) is the most popular with statistical researchers (Faraway 2005: x).
•  New statistical methods often are available first in R. For example, GRTS analyses are only available in R at this time to my knowledge.
•  R can easily import and export data to and from Microsoft Access and Excel as well as text files.
DISADVANTAGES
•  R is harder to learn than commercial packages. Although it has a menu system for basic statistics, the menu is not as extensive as that of most commercial packages. Consequently most data manipulations and analyses are done from the command line.
•  Documentation for R is fragmented. There is substantial free documentation and guides, and you have the selection of several books you can buy on R.

PRESENTATIONS
Paul Geissler (USGS Status & Trends Program, Paul_Geissler@usgs.gov) and Tom Philippi (NPS Inventory and Monitoring Program, Tom_Philippi@nps.gov) will start by showing how to download and install R and the R Commander user interface. The first part of the course will address the needs of the casual user, who uses the menus to do common analyses and graphics. For the casual user, the free online documentation will probably be sufficient. Later we will introduce the R language, and provide an introduction to statistical procedures, using Michael Crawley (2007, The R Book, Wiley, 942 pages, $110 list price). We will also demonstrate the extended statistical analyses of selected data sets using R. We plan on following-up the introduction with modules on special topics on interest to natural resource managers. Suggestions of data sets to analyze and of additional topics will be appreciated.

Minimum computer requirements for Webinar are:
For PC-based Users
• Required: Windows® 2000, XP, 2003 Server or Vista
• Required: Internet Explorer® 6.0 or newer, or Mozilla® Firefox® 2.0 or newer (JavaScript™ and Java™ enabled)
• Internet Connection Required: cable modem, DSL or better recommended
• Recommended: Minimum of Pentium® class 1GHz CPU with 512 MB of RAM (2 GB of RAM for Windows Vista)
For Mac®-based Users
• Required: Mac OS® X 10.4 (Tiger®) or later
• Required: Safari™ 3.0 or newer, Firefox® 2.0 or newer; (JavaScript™ and Java™ enabled)
• Internet Connection Required: cable modem, DSL or better recommended
• Required: PowerPC G4/G5 or Intel processor, 512 MB of RAM or better
To Use VoIP
• Required: Fast broadband connection (384 kbps or more recommended)
• Required: Microphone and speakers (USB headset recommended)


SCHEDULE:
HawaiiAlaskaPacificMountainCentralEasternUTC
9:00-11:00 10:00-12:0011:00-1:0012:00-2:001:00-3:002:00-4:00 7:00-9:00
Link Topic Date Recording (topics) *
Topic 1 Downloading and setting up R and R Commander. Mon. Oct 27 LearnR1.wmv (1)
Topic 2 R Commander Menus Wed. Oct 29, Thr. Nov 6 LearnR2.wmv (1)
Topic 2 R Commander Menus, continued Mon. Nov 3 LearnR3.wmv (2)
Lab 1 Configuring R and data import/export (12:00 MT) Thr. Oct. 30  
Topic 3 Exploratory Data Analysis - duplicates topic 2, not covered this year    
Topic 4 Simple Statistics - duplicates topic 2 , not covered this year    
Topic 5 Graphics Wed. Nov. 5
Mon. Nov. 10
LearnR4.wmv (5)
Topic 6 Introduction to the R Language Mon., Nov 10
Wed. Nov. 12
LearnR6.wmv (5,6)
Topic 7 Classical tests, Crawley (2007) Chapters 8 and 15 Wed. Nov. 12
Mon. Nov. 17
LearnR7.wmv (6,7)
Topic 8 Linear Models Overview and Regression, Crawley (2007) Chapters 9 and 10 Wed. Nov. 19
Mon. Dec. 1
LearnR8.wmv (7,8)
Topic 9 Regression Diagnostics, Fox (2002), Chapter 6 Mon. Dec. 1 LearnR9.wmv (8-10)
Topic 10 Analysis of variance, Crawley (2007) Chapter 11 Wed. Dec. 3 LearnR10a.wmv (10)
Topic 11 Analysis of covariance, Crawley (2007) Chapter 12 Wed. Dec. 3 LearnR10b.wmv (10-13)
Topic 12 Generalized Linear Models - Count Data, Crawley (2007) Chapters 13 and 14. Wed. Dec. 3  
Topic 13 Count Data in Tables, Crawley (2007) Chapter 15    
Topic 14 Proportion Data, Crawley (2007) Chapter 16 Mon. Dec. 8 LearnR11.wmv (13-16)
Topic 15 Binary Response Variables, Crawley (2007) Chapter 17    
Topic 16 Generalized Additive Models, Crawley (2007) Chapter 18    
Topic 17 Mixed-Effects Models, Crawley (2007) Chapter 19 Mon. Jan. 5 LearnR12.wmv (17-19)
Topic 18 Non-linear Regression, Crawley (2007) Chapter 20    
Topic 19 Tree Methods, Crawley (2007) Chapter 21    
Topic 20 Multivariate Statistics, Crawley (2007) Chapter 23 Wed, Jan. 7 LearnR13.wmv
Topic 21 Spatial Statistics, Crawley (2007) Chapter 24 Mon., Jan 26 LearnR14.wmv
Topic 22 Time Series, Crawley (2007) Chapter 22 Mon., Jan 26  

Special Topics

Topic Presenter Date Registration Recording Handout
A General Approach to Modeling Biphasic Relationships Bill Beckon, FWS Thursday, Jan. 22, 2009 543920374 BiphasicRegression.wmv BiphasicRegression.doc
Linear Quantile Regression in R Brian Cade, USGS Thursday, March. 12, 2009 656477229    
Remember to register separately for each. All are at the above times.

Frequently Asked Questions
Question: I will have to miss a class. Are there make up classes?
Answer: Each class is is being recorded and is available on the website.

Question
: Who do I contact if I have problems or have a question.
Answer: Please contact Paul Geissler (Paul_Geissler@usgs.gov, 970-226-9482) and Tom Philippi (Tom_Philippi@nps.gov, 970-225-3586) if you have problems or do not understand something. If we can't resolve it by e-mail or over the phone, we can set up a one-on-one or small group interactive web session so we can see the problem.

Question: I'm enjoying your class. I'm wondering how many R classes you'll teach, and whether you'll do this again. The answers to that will dictate how important it is to keep up with what's going on, to read supplementary materials, etc.
Answer: We don't know how many classes. We plan to keep going as long as there is interest, as it is a big subject. We are now going over the basics, but we hope to get to more advanced topics and to invite others to present on areas they are working with. This is the second year for the course, and we plan to offer it annually.


References

To access the online help system enter the command help.start() . To search, click on "Search Engine & Keywords" .
You can also enter the command help(lm) where lm is the name of the command you want help on.

Many excellent, free references are available at the R-Project site (http://www.r-project.org/) under Documentation / Manuals. Don't forget the contributed documentation.
An Introduction to R (Verables, Smith & R Core Development team) http://cran.r-project.org/doc/manuals/R-intro.pdf provides a quick overview.
• The R FAQ (http://cran.r-project.org/doc/FAQ/R-FAQ.html) and Windows FAQ (http://cran.r-project.org/bin/windows/base/rw-FAQ.html) provides more information.
Data Import/Export (http://cran.r-project.org/doc/manuals/R-data.pdf)

Several good introductions to R statistics and graphics are available in the contributed library
Using R for Data Analysis and Graphics - Introduction, Examples and Commentary by John Maindonald (http://cran.r-project.org/doc/contrib/usingR-2.pdf  data http://wwwmaths.anu.edu.au/~johnm/r/dsets/)
Simple R by John Verzani (http://cran.r-project.org/doc/contrib/Verzani-SimpleR.pdf)
Practical Regression and Anova using R by Julian Faraway (http://cran.r-project.org/doc/contrib/Faraway-PRA.pdf) with examples and scripts available at http://www.stat.lsa.umich.edu/~faraway/book/
An Introduction to R: Software for Statistical Modeling& Computing by Petra Kuhnert and Bill Venables (http://cran.r-project.org/doc/contrib/Kuhnert+Venables-R_Course_Notes.zip) R can most easily be accessed using the R Commander graphical user interface.
Getting Started With the R Commander: A Basic-Statistics Graphical User Interface to R by John Fox http://socserv.mcmaster.ca/jfox/Getting-Started-with-the-Rcmdr.pdf

With so many commands, reference cards are very handy
R reference card by Jonathan Baron - 1 page (http://cran.r-project.org/doc/contrib/refcard.pdf)
R reference card by Tom Short - 4 pages (http://www.rpad.org/Rpad/R-refcard.pdf)

Text Books

Crawley, M. J. 2007. The R Book, Wiley, 942 pages, about $110. An excellent, comprehensive and very readable text. Building on the success of the author’s best selling Statistics: An Introduction using R, The R Book is packed with worked examples, providing an all inclusive guide to R, ideal for novice and more accomplished users alike. The book assumes no background in statistics or computing and introduces the advantages of the R environment, detailing its applications in a wide range of disciplines.
• Provides the first comprehensive reference manual for the R language, including practical guidance and full coverage of the graphics facilities.
• Introduces all the statistical models covered by R, beginning with simple classical tests such as chi-square and t-test.
• Proceeds to examine more advance methods, from regression and analysis of variance, through to generalized linear models, generalized mixed models, time series, spatial statistics, multivariate statistics and much more.
     Data are available at http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/ The author's page.

Maindonald, J. and J. Braun. 2007. Data analysis and graphics using R - an example-based approach (Second Edition), Cambridge University Press, 502 pages, about $80. DAAG package. This will be my primary source for the presentations on statistical analysis. they are the authors of the DAAG (Data Analysis and Graphics) package. They begin this example-based introduction to data analysis with a tutorial in R, and this allows them to demonstrate elementary concepts and methodologies for data analysis with real world examples drawn from their experience as teachers and consultants. The detailed discussion of regression methods that makes up the core of the book leads on to more advanced statistical concepts. As these are explained, the facilities that allow them to be implemented in the R system are illustrated. R code and data sets for all examples are available on the Internet. This allows mathematical content to be kept to a minimum while statistical and scientific issues are still covered in depth. This book is therefore suitable for either the researcher requiring practical skills in data analysis, or the student looking for examples of applications to complement a more theoretically oriented course. Only basic statistical knowledge is assumed, approximately that for a first undergraduate course, and the methods demonstrated are suitable for use in fields as diverse as biology, social science, medicine and engineering. See the book web sites for supplemental information and scripts http://www.stats.uwo.ca/DAAG/   http://wwwmaths.anu.edu.au/~johnm/r-book.html

Venables, W, N, and B. D. Ripley. 2002. Modern applied statistics with S, Springer. 495 pages, about $85. This excellent text is more advanced and detailed than Crawley 2007 and Maindonald, J. and J. Braun 2007, which applies equally to R and S. MASS package. Readers are assumed to have a basic grounding in statistics, and so the book in intended for would-be users of S-PLUS and both students and researchers using statistics. Throughout, the emphasis is on presenting practical problems and full analyses of real data sets. Many of the methods discussed are state-of-the-art approaches to topics such as linear, nonlinear, and smooth regression models, tree-based methods, multivariate analysis and pattern recognition, survival analysis, time series and spatial statistics. Throughout, modern techniques such as robust methods, non-parametric smoothing, and bootstrapping are used where appropriate. This third edition is intended for users of S-PLUS 4.5, 5.0, 2000 or later, although S-PLUS 3.3/4 are also considered. The major change from the second edition is coverage of the current versions of S-PLUS. The material has been extensively rewritten using new examples and the latest computationally intensive methods. The companion volume on S Programming will provide an in-depth guide for those writing software in the S language.

Fox, J. 2002. An R and S-Plus companion to applied regression. Sage, 275 pages, about $60. car package. A companion to a statistical text, which provides many easy-to-follow examples of using R (and S). John Fox is the author of R Commander. The book provides a valuable supplement to texts on regression analysis and linear models by showing readers how to put into practice the strategies and techniques involved in modern statistical methodology. It explains clearly the use of a very sophisticated and powerful statistical software system. And, while the examples and objectives are focused closely on regression and related techniques, the discussion successfully conveys general advice and principles for statistical computing with the S system. http://socserv.mcmaster.ca/jfox/Books/Companion/index.html

Venables, W. N. and B. D. Ripley. 2000. S Programming. Springer, 264 pages, about $90. It has an excellent explanation of the S language implemented in R, which is used for data selection and manipulation. I will not use this book directly, but it is a good source when you can't understand some of the free documentation. S is a high-level language for manipulating, analyzing, and displaying data. It forms the basis of two highly acclaimed and widely used data analysis software systems, the commercial S-PLUS and the Open Source R. This book provides an in-depth guide to writing software in the S language under either or both of those systems. It is intended for readers who have some acquaintance with the S language and want to know how to use it more effectively, for example, to build reusable tools for stream­lining routine data analysis or to implement new statistical methods.

Spector, P. 2008. Data Manipulation with R. Springer, 152 pages, about $49. Many users, especially those with experience in other languages, do not take advantage of the full power of R. Because of the nature of R, solutions that make sense in other languages may not be very efficient in R. This book presents a wide array of methods applicable for reading data into R, and efficiently manipulating that data. Most experienced R users discover that, especially when working with large data sets, it may be helpful to use other programs, notably databases, in conjunction with R. Accordingly, the use of databases in R is covered in detail, along with methods for extracting data from spreadsheets and datasets created by other programs. Character manipulation, while sometimes overlooked within R, is also covered in detail, allowing problems that are traditionally solved by scripting languages to be carried out entirely within R. For users with experience in other languages, guidelines for the effective use of programming constructs like loops are provided. Since many statistical modeling and graphics functions need their data presented in a data frame, techniques for converting the output of commonly used functions to data frames are provided throughout the book.

Murrell, P. 2006. R Graphics. Chapman & Hall. 301 pages about $64. R Graphics presents the first complete, authoritative exposition on the R graphical system. After an introductory overview of R graphics facilities, the presentation first focuses on the traditional graphics system, showing how to work the traditional functions, describing functions that are available to produce complete plots, and how to customize the details of plots. The second part of the book describes the grid graphics system - a system unique to R and much more powerful than the traditional system. The author, who was integral in the development of the grid system, shows, starting from a blank page, how it can be used to produce graphical scenes. He also describes how to develop new graphical functions that are easy for others to use and build on. Appendices contain a brief introduction to the R system in general and discuss how the traditional and grid graphics systems can be combined. Much of the information presented in this book cannot be found anywhere else.

Faraway, J. J. 2005. Linear models with R. Chapman & Hall, 229 pages, about $80. A more in-depth treatment of regression and analysis of variance. (http://www.stat.lsa.umich.edu/~faraway/LMR) Install the R package faraway. This more advanced text focuses on the practice of regression and analysis of variance. It clearly demonstrates the different methods available and more importantly, in which situations each one applies. It covers all of the standard topics, from the basics of estimation to missing data, factorial designs, and block designs, but it also includes discussions on topics, such as model uncertainty, rarely addressed in books of this type. The presentation incorporates an abundance of examples that clarify both the use of each technique and the conclusions one can draw from the results. A brief introduction to R is presented in an appendix, and all of the datasets used in the book are available for download from the Internet. The author assumes that readers know the essentials of statistical inference and have a basic knowledge of data analysis, linear algebra, and calculus. The treatment reflects his view of statistical theory and his belief that qualitative statistical concepts, while somewhat more difficult to learn, are just as important because they enable us to practice statistics rather than just talk about it.

Crawley, M. J. 2005. Statistics: an introduction using R. Wiley, 327 pages, about $50 paperback. An easy introduction, focused on undergraduates, postgraduates without statistics and those who wish to switch to R. (http://www.imperial.ac.uk/bio/research/crawley/statistics) Features step-by-step instructions that assume no mathematics, statistics or
programming background, helping the non-statistician to fully understand the methodology. Uses a series of realistic examples, developing step-wise from the simplest cases, with the emphasis on checking the assumptions (e.g. constancy of variance and normality of errors) and the adequacy of the model chosen to fit the data. The emphasis throughout is on estimation of effect sizes and confidence intervals, rather than on hypothesis testing. Covers the full range of statistical techniques likely to be needed to analyze the data from research projects, including elementary material like t-tests and chi-squared tests, intermediate methods like regression and analysis of variance, and more advanced techniques like generalized linear modeling.

Everutt B. S. and T. Hothorn. 2006. A handbook of statistical analyses using R. Chapman & Hall, 275 pages, about $53. It presents straightforward, self- contained descriptions of how to perform a variety of statistical analyses in the R environment. From simple inference to recursive partitioning and cluster analysis, the authors lead you methodically through the steps, commands, and interpretation of the results, addressing theory and statistical background only when useful or necessary. They begin with an introduction to R, discussing the syntax, general operators, and basic data manipulation while summarizing the most important features. Numerous figures highlight R's strong graphical capabilities, and exercises at the end of each chapter reinforce the techniques and concepts presented. All data sets and code
used in the book are available as a downloadable package from CRAN, the R online archive. Websites
R Labs for Vegetation Ecologists. This section of the Laboratory for Dynamic Synthetic Vegephenonenology (LabDSV) includes tutorials and lab exercises for a course in quantitative analysis and multivariate statistics in vegetation ecology. NCEAS Scientific Computing: R Language Short Course An Introduction to the R Programming Environment, K. A. Garrett, P. D. Esker, and A. H. Sparks Vegan: R functions for vegetation ecologists The Journal of Statistical Software issue on R for ecology

Discussion

Please send comments and suggestions to Paul and Tom. We will batch comments them and email them to participants who wish to receive them. Archive copies will be posted here. Current - These issues are being batched and will be emailed to participants who choose to receive them.


January 14, 2009

Brian: Thank you for conducting the webinar and for recording the sessions. However, I cannot access the LearnR10a or the LearnR13 video files from the website. Do you have any reason why this would be the case? Or any suggestions?

Paul: I had an extra period in the LearnR13.wmv file name, which I have now fixed. Thanks for letting me know. You can access the FTP server directly at ftp://ftpext.usgs.gov/pub/cr/co/fort.collins/Geissler/
     I need to rerecord LearnR10a and LearnR5.
************************************************

Francisco: I wanted to ask you whether there was a way to go back and go over a session you may have covered before. I have missed several when I have been either in the field or traveling.

Paul: I am recording the sessions and the recording are available on the website. There is often a delay in updating it, but the recordings are often available on the FTP site ftp://ftpext.usgs.gov/pub/cr/co/fort.collins/Geissler/ before the page is updated.
************************************************

Dave: Two things:
1) Do you happen to know of a tree program that uses validation data sets?
2) Are we going to cover ordination?

Paul: 1) Try
rm(list = ls()) # removes previous variables
d=read.table("http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/taxonomy.txt",header=T); attach(d); d
## Construct the key for the four taxa with the smallest error rate.
#     Taxon   Petals Internode    Sepal    Bract   Petiole     Leaf    Fruit
# 1       I 5.621498  29.48060 2.462107 18.20341 11.279097 1.128033 7.876151
# . . .
library(tree)
m1=tree(Taxon~.,d); m1
new=d[1:5,2:8] # Assume this is a set of new observations.
pred=data.frame(new,predicted=predict(m1,new)); pred
# Petals Internode    Sepal    Bract  Petiole     Leaf    Fruit predicted.I predicted.II predicted.III predicted.IV
# 1 5.621498  29.48060 2.462107 18.20341 11.27910 1.128033 7.876151           1            0             0            0
# 2 4.994617  28.36025 2.429321 17.65205 11.04084 1.197617 7.025416           1            0             0            0
# 3 4.767505  27.25432 2.570497 19.40838 10.49072 1.003808 7.817479           1            0             0            0
# 4 6.299446  25.92424 2.066051 18.37915 11.80182 1.614052 7.672492           1            0             0            0
# 5 6.489375  25.21131 2.901583 17.31305 10.12159 1.813333 7.758443           1            0             0            0
2) I am not planning on covering ordination, but if there is sufficient interest, I will try to organize a presentation.
************************************************

Chantal: In the non-linear regression example - the Michaelis-Menton curve was
presented as: a*age/(1+b*age)
    Whereas in the self-starting function example, it was presented as: a*b/(b*x)
      I am wondering where the "1+" comes from -- and in what cases do you fit the model with the "1+b*age" rather than simply the "b*age". (I am assuming the "1+" modifies the curve).

Paul: That is an excellent question.
     On pages 662 and 664, Crawley shows it as y=a*x/(1+b*x), but on page 674 he shows it as y=a*x/(b+x). I do not know which is correct, but a Google search found the following references that use y=a*x/(b+x):
http://www.graphpad.com/help/Prism5/prism5help.html?reg_michaelis_menten_enzyme.htm
http://www.chm.davidson.edu/erstevens/Michaelis/Michaelis.html
http://www.jstor.org/pss/3547060
************************************************

Devon: How long will the course videos remain posted? I’m a little behind and wanted to know if I should look at downloading all the sessions in the next week or so.

Paul: I plan to keep the videos up for the foreseeable future.
************************************************

Thomas: Thanks again for giving me the opportunity to take part in the R course. I found it very valuable and am already applying several features of R you taught me in my statistical analysis.
     I have downloaded all video lessons so I can go through the material in the future but I am a bit worried that the website might not be available in a few years time. Would it be possible for you to provide the contents as downloadable pdfs? This would really make this course perfect for me - a complete stand-alone course with video instructions and manual that I can access whenever I want.

Paul: Thanks for your kind words. I plan to keep the website up and to keep updating it for the foreseeable future, but of course I cannot guarantee anything for the long term. You can download web pages to your disk. Using Internet Explorer menu, click on "file" then "save as" and then either "web archive" or "web page complete".
************************************************

Lars : Do you know of any way to perform a non-parametric power analysis in R, specifically on a kruskal-Wallis multiple comparisons test? There does not seem to be a way under the pwr package that I can see. I have a data set that is very non-normal (more poisson or negative binomial; many zeros and decreasing numbers of 1’s and 2’s…) and need to calculate future sample size needs. Can you think of anything? Thanks for the course too by the way.

Paul: I suggest you try setting up a specific distribution and using the bootstrap to estimate the power.
I will provide an example below. If you have some existing data, then using an empirical distribution based on
that data would be better than assuming a distribution. See Crawley (2007) pages 319-322. If you have data,
I will be happy to work it out, if I can use it as a class example.
## Bootstrap power, comparing the power of nonparametric Kruskal-Wallis test with glm for Poisson treatments.
## for more information on distributions see http://cran.nedmirror.nl/web/views/Distributions.html
n=15; ymean=c(0.5,1.0,1.5); nrep=1000
pkruskal=numeric(nrep); pglm=numeric(nrep)
tmt=c(rep("A",n),rep("B",n),rep("C",n) ); tmt=factor(tmt)
for (irep in 1:nrep) {
  y=c(rpois(n,ymean[1]),rpois(n,ymean[2]),rpois(n,ymean[3]));
  m1=kruskal.test(y~tmt); pkruskal[irep]=m1$p.value;
  m2=glm(y~tmt,poisson); a2=Anova(m2); pglm[irep]=a2$"Pr(>Chisq)";
  }
cat("Power of Kruskal-Wallis test",sum(pkruskal<0.05)/nrep,"\n")
cat("Power of glm test",sum(pglm<0.05)/nrep,"\n")
# Power of Kruskal-Wallis test 0.665
# Power of glm test 0.735


January 4, 2009

Priscilla: I am having trouble updating the package Rcmdr to the newer version that John suggested. I do indeed have 1.4-3. I mirrored the CRAN site in CA-1 and 3 packages are listed to be updated - including RCmdr. However,R doesn't want to update it because it's "in use". I've tried a few things like exited out of Rcmdr (it's still "in use"), remove.package, but to no avail. Any tips? Thanks.

Paul: Rcmdr is in use because it is loaded automatically. If closing Rcmdr doesn't work, comment out (put a # before the lines) in Rprofile.site (see http://www.fort.usgs.gov/brdscience/LearnR1.htm).
# local({ old <- getOption("defaultPackages")
#       options(defaultPackages = c(old, "Rcmdr", "RcmdrPlugin.HH","RODBC","DAAG","MASS","lattice","sciplot","tree"))
#       })
and then close and restart R.
************************************************

To unsubscribe to messages about the course, you need to unsubscribe from both lists.
• Send an e-mail message to Paul_Geissler@usgs.gov
• When you receive a webinar notice with the subject "Reminder: Your Webinar is on ...", click on the link in "Please cancel your registration if you cannot attend."
************************************************

The website was down for several days because of a security issue, but it should be up now.
************************************************

Chip: I was trying to catch up on a week of lectures that occurred during the Wildlife Society conference and ran into some problems. The file LearnR5.wmv that was supposed to be graphics was actually from Topic 2 on beginning R Commander, and was very similar to LearnR2.wmv. I checked back on the web site to make sure that I hadn't renamed a file wrong. Could you please let me know if Topic 5 is in another file?
     Also, I have a request. Could you post 1 wmv file per lecture? That way it's easy to download the files needed when you miss a day. Rather than dealing with a wmv file that is a combination of 2 days, and then having to forward through trying to find the start of the second day. If that's possible, it would be helpful.
Thanks very much,

Paul: The first lecture on graphics is missing and I will need to rerecord it when I have time. Thank you very much for letting me know.
     Each wmv file is for a single day's lecture, although it may cover several topics of parts of topics.
************************************************

Steph: I understand R will do "quantile regression". Could you point me to the correct procedure?

Brian: The contributed library for quantile regression in R is the quantreg package developed by Roger Koenker. The rq() function in this package is the workhorse linear model for quantile regression. Nonlinear estimators and some nonparametric smoothers are also available, although not nearly as thoroughly developed as the linear rq() model.
************************************************

Greg: Do you know why RCmdr doesn’t load in 2.8.1 (the rprofile.site is same as was in 2.8.0)?

Tom: Were you using your previous R-cmdr (probably 1.4.3 or 1.4.4 from October), or did you grab a new Rcmdr (1.4.6)?
     If you had problems with 1.4.6 on R 2.8.1, the most likely issue is that you didn't get the new tcltk or utils packages the R-cmdr depends on. There should be some kind of an error message in the R window when Rcmdr fails to load.
     I tend to only update to 2nd order versions: 2.8, 2.9, etc., because I have enough packages (~50) that it takes a bit of time to re-grab everything.
************************************************
Nick: Is there there a way to control what gets printed in the output in R? I would like only the results to get printed to the output file, not all of the lines of code. Do you know how to turn off the echo of the lines of code? Thanks.

Paul: R Commander has many options, but I did not see an option not to echo the commands to the output file. I like that feature, because it keeps a record of exactly what was done. It is easy to edit the output to remove the commands, but, of course, it is an extra step


November 18, 2008

Arthur responded to Diana comment: I think taping is a great idea, but for some reason, I'm not able to fast forward (FF) or rewind - not sure if the file is corrupt? Or, just
not an option?"
     I found the following at http://www.microsoft.com/windows/windowsmedia/knowledgecenter/mediaadvice/0064.mspx#EKG, and it worked, for reviewing the recorded classes in Windows Media Player:
     Why can't I fast forward, rewind, or seek in a WMV file?
You probably can’t perform these actions because the file isn't indexed. If you have access to the file and it isn't protected, you can quickly
index the file yourself by using Windows Media File Editor, a utility that is available with Windows Media Encoder 9 Series.
     To index a WMV file by using Windows Media File Editor, do the following:
1. Open Windows Media File Editor.
2. On the File menu, click Open, and then select the file you want to index.
3. On the File menu, click Save and Index
     Thanks, Arthur!
************************************************

John: You might pass this on to Priscilla. The message window also didn't seem to work for me. I updated to R Commander 1.4-5 and the problem went away. I think many of us picked up 1.4-3 and it may have had a bug with the message window.
************************************************
November 6, 2008 Andrew: I can't seem to download session 3 in its entirety.  Each time I try to save it, it gives me a slightly different amount of the file, but I've only been able to get the first minute of the recording.  Any ideas? Paul: These are very large files.  If you are having problems downloading them with a browser, I suggest that you try an FTP client to download them, such as the open source FileZilla (http://filezilla-project.org/).
************************************************

Priscilla: I have not seen or heard this question addressed but I did notice a question about it near the beginning - the bottom screen of R-Commander doesn't display error message clearly most of the time. Sometimes it's ok but most of the time there are stretched-out graphics messing in up. Do you know how to fix this?

Paul: The message window in R Commander is very small, so messages often scroll off the viable window. You need to use the up and down arrows because the slider does not work well. ************************************************

Gabriela: I had downloaded the randomForest package when I was using a previous version of R. I have two versions of R on my computer and I thought that they would share the libraries. If I understand it well, each R version acts independently. [Yes] I have downloaded the package again and now it works. **************************************** Diana: I think taping is a great idea, but for some reason, I'm not able to fast forward (FF) or rewind - not sure if the file is corrupt? Or, just not an option?

Paul: I am also having that problem with some but not all the recordings. I am not sure what the problem is.
****************************************

Nick: I am confused by the switch function. Does switch always convert a character value to a numeric value? Can you give an example of when this function might be useful? Thanks.

Paul: switch is an alternative to if-else statements. For example:
x="a"; switch(x,a=1,b=,c=2,3) # 1
x="b"; switch(x,a=1,b=,c=2,3) # 2
x="c"; switch(x,a=1,b=,c=2,3) # 2
x="d"; switch(x,a=1,b=,c=2,3) # 3
x=runif(3); x; f="median"; switch(f, mean=mean(x), median=median(x), trimmed=mean(x,trim = .1))
November 6, 2008

Jeremiah: Is there any easy way to restart the Rcmdr if we close it but still leave the RGui window open? Currently, the only way I can figure out how to do this is to close and restart R. Thanks.

Paul: I have found it best to close and restart R, which also restarts Rcmdr. library(Rcmdr) does not seem to work to restart Rcmdr.
************************************************

Kelly: Those of us here at Washington Department of Fish and Wildlife finally got on to a live tutorial today and had a very pleasant experience. The only suggestion we had was perhaps post the questions along with your responses somewhere for others to see that may have missed the live version, for the sake of time and latter reference. Perhaps for time's sake, people can post questions to a chatroom of the sorts and you can later answer them instead of answering them during the live webinar time. Also by posting the questions and answers people can refer back to them later when they encounter the same issue or can't recall your answers and they won't have to replay and search through the recorded seminar.
    Other than that, this is the first time any of us have "learned" in this manner and it was very impressive!

Paul: I will see if the questions can be saved. I am answering and archiving general questions sent by email.
************************************************

Dave: I have just changed PCs and had to reinstall R. I am getting an error message I have not seen before:
     Attaching package: 'HH'
     The following object(s) are masked from package:car :
     vif
Do you recognize this and/or know what it means? Tom: That's not an error, that's a feature!
     Your installation is fine. One of the packages (car) includes a vif() function. That function is old, and there is a better vif() function in one of the other packages (possibly MASS, or something included in HH, which is required by rcmdrPlugin.HH). Therefore, when R loads packages, it knows to keep the other better version and "mask" the version included in car.
************************************************

Jamie: My only question regarding Topic 1 relates to Environmental Variables... Do I need to set some and, if so, how do I do it? I thought I had R_USER and R_HOME set but R doesn't seem to be seeing the settings; still defaults to My Documents.

Paul: Advice on setting a working directory from http://cran.r-project.org/bin/windows/base/rw-FAQ.html is
"After installation you should choose a working directory for R. You will have a shortcut to R-2.8.0\bin\Rgui.exe on your desktop and/or somewhere on the Start menu file tree, and perhaps also in the Quick Launch part of the taskbar. Right-click each shortcut, select Properties... and change the 'Start in' field to your working directory."
November 2, 2008

Cara: Can you direct me on where to find the possum dataset?

Paul: In R Commander menu, select Data - Data in packages - Read data from an attached package - DAAG (click in left column), possum (click in left column).
     This assumes that you have installed the DAAG package. If not install package from R Console.
     If DAAG is not loaded, enter library(DAAG).
**********************************************************************************

Sara: I had to sign on to the webinar last week using my personal email address, but I am already receiving updates on my work address.  I looked on the registrant list but didn't see this address on there.  Please remove this hotmail address from the mailing list for the R class.

Paul: There are two lists. I use the registration list at http://www.fort.usgs.gov/brdscience/learnR.htm to send these messages. Your personal email is not on this list. Webinar keeps a separate list and sends reminders. You will need to unregister your personal email with them and sign up with your work email.
**********************************************************************************

Kercia: I am wondering if you would be willing to post the list of weblinks that you use during your presentations on your website.  I know that all of those links can be found within the topic pages, but it seems to be a lot more convenient to have them all located in one place rather than having to scroll through the topic pages to find them. Paul: At the top of Topic 2, there is now a line " There is a separate page with a list of the links to definitions on these pages. "
**********************************************************************************

Jim: The Voip yesterday was a vast improvement vs. the phone bridge last week. It came in very good and was great not to hear the background noise from the outside phones.
**********************************************************************************

Thom: I noticed that several folks had problems with the message window in Rcmdr.  I have tried several times and mine does not work either.  I can't get the scroll buttons to work at all.  Could it be a glitch in 2.8.0 or something I did wrong while loading?
      Is there a file from the download that I can check to make sure the message window files loaded correctly?

Paul: I have not had that problem with 2.8.0. The message has only about 3 line, so I have to use the up and down arrows to see the messages.
**********************************************************************************

Mike: I suspect that part of the problem folks may have had with hearing you today may have to do with the mic on their speaker phones picking up room noise. I was having a lot of trouble hearing you as well, especially toward the end. However, I discovered during the last few minutes of the session that I could hear you perfectly if I put my speaker phone on mute.
**********************************************************************************

Devon: Wow, what a difference! I had been struggling last Wed and Thursday to find free call software for the computer and kept getting kicked off. One suggestion to others is to make sure they bring up their volume control and play with wave balance as well as master volume. Using headphones on the PC instead of speakers may also be an improvement.
    Glad to finally be able to listen to a full session!

November 2, 2008

Learn R - New phone service Seventy eight percent of the respondents to our questionnaire preferred the GotoWebinar phone bridge and VoIP where all participants are muted, but they can ask questions by either sending a text message or "raising their hands" to be unmated, compared to 11% who preferred the AI Telephone phone bridge where participants can mute their own phones and unmute them when they want to talk (http://www.pwrc.usgs.gov/brd/SurveyResults.cfm?survey=199). Twelve percent said that they cannot participate using a phone bridge that required them to pay for a long distance call, 45% prefer free VoIP but can use a phone bridge, 23% prefer the phone bridge, and 20% would not use VoIP. The GotoWebinar approach provides both a phone bridge and VoIP service. Twenty five percent favored repeating the sessions on a different day the following week, compared to 44% who preferred recording the sessions so they could be viewed at any time, which requires the GotoWebinar integrated phone bridge. These results indicate a strong preference for the GotoWebinar phone service (which is also less expensive). Consequently, we will switch to that service. Call 773-945-1010, Access Code: 689-689-314, the Audio PIN will be shown after joining the Webinar We will attempt to record the audio and video of the presentations and make them available over the web, and not repeat sessions, except for last week's presentations, which we had scheduled. This is our first experience with such a large group, and we encountered problems that were not apparent with smaller groups. Please bear with us as we try to work it out.
**********************************************************************************

Cathy: Here are my suggestions for making this course successful.
      You and Tom have shown great patience, so thank you! I think teaching courses on computer packages is difficult because there is such a range of expertise and knowledge, and for some reason everyone needs to put in their two cents, which doesn't work in this setting. So pick your level of instruction and let folks catch up on their own - or maybe schedule a special session or two to help real computer novices catch up. I think your goal of allowing discussion is admirable, but with this many people that won't work.
      Here is my suggestion. Mute everyone and conduct a lecture type format. People can send in their questions via email or the webinar but they should be addressed, again in a lecture format, either
1) at the end of the session (if that is practical) or
2) via email later, or
3) at the beginning of the next session.
The advantage of the last two options is that you can compile the questions and answer them more efficiently. Given that I am sure you are busy with your real job, I would do what works best for you on this one. I would not however, ask for questions throughout the session. It is not very efficient in this setting. On the labs, I thought Tom's presentation and demonstration yesterday was excellent - and hit the main points. I would have you do the demonstration, then assign us to do the task as homework on our own. We can then ask questions via email on all the weird problems we get (and R is full of them) in a procedure similar my above suggestions. You can address them either via a group email (like you are doing) or in a short session at the beginning of the next lab. As to VOIP vs phone bridge, VOIP would be nice but not if it is not working. I think we need to do what is successful. Bottom line, let's focus on getting to the material and less on the technology. Thanks again for your time on this! And I am happy to help with other suggestions.
**********************************************************************************

Jennie: I wonder if it would be possible to address some of the errors that come up when opening R.
I get
  there is no package called 'sciplot'
  there is no package called 'tree'
Warning: package tree in options("defaultPackages") was not found
**********************************************************************************

Paul: I think the problem is that the mirror you are using does not have those packages and so they were not installed. Try installing them from the R Console using the Berkeley, CA mirror.

Tom: We swamped their server!  160 requests for downscaled climate change projections: that's better interest in working through advanced projects
than I expected, even with 751 registered participants. I'll put a notice on my web pages, but I think that this message went to everyone with a backlogged request.
**********************************************************************************

Henry: Is it possible that your group can offer an in-class at UGGS in Colorado or Tom at NPS to learn the R-Language course using Crawford's book?   I am  a registrant in your online course but do not have phone or VoIp access options.  I do plan to read lessons on your website.  What is the name of your website where you post lessons and summaries of your lectures? I do not mine renting a hotel room and learn on-site at Colorado or anywhere where Tom is located and pay a reasonable tuition.. Thanks.  It is a great course.  And you both are doing the public a GREAT SERVICE. Yours sincerely,

Paul: Thank you very much for your interest in an in-person course. However, I think that travel restrictions will be a major problem for many participants. I suggest you see if a local university is offering a course in R.
**********************************************************************************

Rebecca: Yet another logistical issue with the webinar. I heard someone ask you about it in the session, but I did not hear your answer. When I try to enter a question, it still submits to "staff." How do I get my question to submit to you?
     Thanks! I'm really looking forward to this course, and I hope we can get all these admin issues cleared up soon. On that note, I much prefer when you are in "presenter" mode with all the phones muted. All it takes is for 1 or 2 people out of 700 to forget to mute their phone to make it really hard to hear and follow along.

Paul: So far the responses to the questionnaire are running strongly in favor of keeping the phones muted, except for those explicitly recognized to ask questions. So we will probably go with that approach if that is the sense of the group.
**********************************************************************************

Pat: Thanks for offering the Learn R class, I've been interested in learning R for a while now and this is a great way to get some experience with it. I got a lot out of the first few classes when you gave an overview of the different R commander menus and the various graphics options. The past few classes have been difficult to follow though. Would it be possible to slow the pace down a bit and give more of an explanation of what all the commands being copied and pasted from the website mean? I have no prior experience with R and no prior experience with S so the command language is totally new to me. Also I've found it difficult to follow what you are doing in class and keep notes at the same time.

Paul: I will try to slow down a bit. All the information is either on the website or in The R Book, so it should not be necessary to take notes. I realize that it is a lot of material, but I suggest that you just watch and listen to the presentation to get an overview. then you can go back to the website and spend time on each command. Please email us if you have questions or if something is not clear, as others probably have the same question.
**********************************************************************************

   
October 30, 2008
Darcy: Not sure what you could hear at your end, but on a number of occasions today, I could hear what sounded like group conversations, perhaps where a group of people were assembled for the course. Sometimes I could hear snatches--something about Santa Monica at one point, and then another time someone clearly on a phone call.
      I'm not sure how you can remind people more than you did today, but perhaps an email to participants ahead of each session (or the initial couple of sessions) might help. Particularly if people need to know to "re-mute" their phones using *6 once you take the global mute off (if they don't have an individual mute function on their phone). It seemed pretty clear that some participants did not understand that.
********************************************************************************** Amy: R commander is a new tool for me! I have been using Tinn R and I like that R commander has some of the built in script, great for beginners! It would have saved me hours (if not days) of struggling through R script. So would you recommend using R commander over Tinn R all the time?

Paul: I tried Tinn R briefly, but like R Commander better and use it exclusively. Others prefer Tinn R.
********************************************************************************** Gregory: Perhaps a somewhat sarcastic note, but it would seem that the inability to operate a mute button on a phone might contraindicate the ability to gain command of a complex statistics package.  <grin>
********************************************************************************** Ted: How do I access the web page with the links to the Wikipedia definitions of R functions etc.

Paul: The links are on the topic pages such as http://www.fort.usgs.gov/brdscience/LearnR2S.htm. I used a separate page for links during the presentation, so I did not have to sort through the topic pages.
**********************************************************************************

Roz: How does R deal with importing dates? Do you need to convert them to julian in order to obtain basic summary statistics? If so, is there a simple way to do this conversion in R, or do you recommend making the conversion before importing the data? I would like to ultimately display the data with calendar dates, so this would require converting results back to calendar from julian... what is the best way to work with dates in R? Paul: Dates are often problematic, but I tried importing Access dates and they were correctly imported into R without any conversion.
     If there is a problem, I suggest importing them as text and then converting them to dates in R using the as.Date() function.
     See help(Dates) and section 8.7 of http://cran.r-project.org/doc/contrib/usingR.pdf
     Phil Spector (2008, Data Manipulation with R, Springer) has a chapter (4) on dates.
     R has at least two package for dates:
http://cran.r-project.org/web/packages/chron/index.html
http://mirrors.dotsrc.org/cran/web/packages/date/index.html
********************************************************************************** John: How do I get R to automatically load R Commander and set a default CRAN mirror site?  I added the following lines suggested on the Topic 1 web page to my Rprofile.site file:
      Also, I downloaded the recommended packages to my hard drive (C:\R\packages); is there a way to tell R to look here for packages, then look at a CRAN mirror site if it can't find the package locally? Paul: I don't know if it makes any difference or not, but options is broken into to lines and there is a space before and after the mirror URL.  I suggest that you try saving Tom's http://bio.fiu.edu/R/Rprofile.site at C:\Program Files\R\R-2.8.0\etc\Rprofile.site
      Unless you lack administrative rights on your computer, you can install the packages directly from the mirror, either from the R console or through the command
install.packages(c("car","conf.design","corrgram","DAAG","effects","ellipse","faraway","gplots","lattice","leaps","lme4","lmtest","MASS","Rcmdr","RcmdrPlugin.HH","RODBC","sciplot","tree"))
     Tom has a work around at http://science.nature.nps.gov/im/monitor/stats/R/Installation.cfm Tom: Paul is right about the (lack of) new lines being the problem. R requires each statement to start on a new line (it doesn't have a statement or sentence ending flag like semicolons in SAS). Also, your email has the extra newline inside the quoted string for " <a href="http://..">http://.. </a>.", which gets parsed as an unmatched quote mark. # set a CRAN mirror local({r <- getOption("repos") r["CRAN"] <- " http://cran.stat.ucla.edu " options(repos=r)}) should work. [Indentation doesn't matter in R, so I use indentation to help identify blocks of statements.] As for installation of packages you've already downloaded to your hard drive, you can simply use the R Console, "packages" on the menu, then the bottom menu item "install packages from local zip files". Note that you want to keep your downloads as .zip files, not explicitly unzip them. [When I've set up laptops that might be used without internet access, I downloaded several hundred of the 1600+ packages and put them in an R/R-2.8.0/packages directory. At that point, one can set the directory for the local packages and not even have to use the file open window.]
********************************************************************************** Jennie: Two questions which i entered in the webinar chat, but which didn't seem to go through.
    1. When editing our RProfile. Save as text only format?
    2. Does R have a function for non-detect data? i.e., if some of our data is a number but some is non-detect, what procedure does it use for mean? Excludes that data? Paul: 1. Yes, save Rprofile.site as text. It is better to use notepad instead of word, because word uses nonstandard characters for quotes that R doesn't understand.
     2. Missing data is represented as NAs. Functions often have a parameter na.omit=True to leave out rows with missing values.
**********************************************************************************
Cheri:    I am finding it very hard right now with my workload to attend these classes at this time.  Will there be another one set up that I can do in another month?  I am sorry it is a program I am very interested in but two hour session right now are almost impossible. Paul: We plan to offer the course again next year.
**********************************************************************************
Glenn: Do you have a recommendation for a book or other documentation that covers writing R scripts?

John: I'm sure Paul and Tom have their favorites - my first 'go to' book is Venables and Ripley "Modern Applied Statistics with S" (MASS) but I have an older edition (3rd, 1999) - I think they took a lot of the programming info out of newer editions and moved it to "Programming in S".  I also have "Programming in S" which is very good and goes farther - it's probably more than you want.  The ability to write R functions could really simplify things like automating the processing of the climate data.  Probably not essential, but a good way to 'protect' less sophisticated users. (BTW, R is effectively the open-source version of S). But the absolute very best 'first course' in R programming is attached to this email. I've asked Tom for a newer version and he thought he had one but I need to ping him again. Most of the R texts use the R command line, and this is really writing scripts one line at a time.  R commander provides the 'scripts' it produces, so if you examine these you're going to get a good dose of R script writing anyway.  What you won't get from the course, at least in the short term, is a consideration of R-specific programming issues, like environments, why to vectorize whenever possible and avoid loops (especially nested loops), and some other stuff that becomes important when you deal with processing very large data files or doing (e.g., spatial) analyses where you create really large matrices. I also have a pdf of Ben Bolker's "Ecological Models and Data in R" (which might be published now - Princeton Univ. Press).  It's very good as a more advanced text with a strong emphasis on numerical techniques and likelihood-based analyses.
**********************************************************************************
Gregory: The R Book is on sale at amazon com for $76 new w/free shipping
**********************************************************************************
Donna: Please, mute everyone - it is almost impossible to listen with the beeping and office noises over your voice.  How about a live chat or something like that for questions? (I only lasted 5 minutes today - it was just too much noise for me).
**********************************************************************************
Stephanie:    I signed up for the NPS R online course because I need a refresher class.  I'd like to continue with the online course you have, but I don't have access to a long distance phone line.  Can I still take the class?  Is there a better way for me to review the R program? Paul: I will post all the material on the website, and you can follow the information in The R Book. VoIP and discount phone service is inexpensive, but they are not free. Perhaps you could look into these options.
**********************************************************************************
Kercia: Every time I close the R Console, another box opens with a question asking if I want to "Save workspace image?".  At this point I'm not sure when I should answer "Yes" or when I should answer "No".  If I do answer "Yes", does a new file get saved somewhere on my computer each time?  If so, where are those files being saved?  Thanks for your help! Paul: Saving workspace images can be a great help if you are working on a problem and want to come back to it later, but it can also save a lot of useless information. Answer No unless you plan on coming back and working on the same problem. Yes, a file is save in the default Rdirectory on your computer.
**********************************************************************************
Heather: I tried to load a dataset from an .xls file into R commander. One of the numeric columns did not load. I even asked it to print (dataset), but it only gave me a partial list. When I tried to do any summary stats, that missing column was also missing from the options. Any suggestions? Thanks, Tom: We'll be dealing with .xls files in the lab today, precisely dealing with pathologies. If you would be willing to let others see your .xls file, you could send it to me for use in the lab. Otherwise, I'm trying to put together demo .xls files with several of the most common and obvious pathologies. From the R-Data documentation (quoted on my NPS R Data i/o page): The most common R data import/export question seems to be `how do I read an Excel spreadsheet'. ... The first piece of advice is to avoid doing so if possible! If you have access to Excel, export the data you want from Excel in tab-delimited or comma-separated form, and use read.delim or read.csv to import it into R. (You may need to use read.delim2 or read.csv2 in a continental European locale that uses comma as the decimal point.) Exporting a DIF file and reading it using read.DIF is another possibility. Excel files can have more than 1 sheet (you can specify which sheet to import). Excel files can have "stuff" in any cell: mixed numerals and characters in the 1345th row of a nominally numeric column, formulas, inserted objects (e.g., graphs), or even macros. "stuff" are not data! R (or SAS or any program expecting data) will properly choke on them. Saving the spreadsheet to a .csv file will get rid of the "stuff", replacing formulas with their values, and otherwise producing something that may be a dataset. If you must read from spreadsheets, and you know what you are doing in terms of ODBC, the package RODBC has functions for reading and writing .xls spreadsheet files (odbcConnectExcel()) and .xlsx files (odbcConnectExcel2007()). If you have a spreadsheet open (not just Excel, but OpenOffice or any other spreadsheet), you can select the block of cells you wish to import, copy them to the clipboard (ctrl-c), and then read them into an R data object with readClipboard() or read.table(file="clipboard").
**********************************************************************************
Krystalynn: I was able to download the NPSpecies_demo.mdb using this address
http://science.nature.nps.gov/im/apps/npspp/workingdata.cfm
I hope this helps some of those people who could not access the file using the link on the Lab1 site.
**********************************************************************************
Lil: Would you please add my name to the list of people that receive the emails of the batch comments. Paul: Your email address was wrong in our database, but I have corrected it. Others should check their entry in http://www.fort.usgs.gov/brdscience/CourseParticipants.htm?course=Introduction%20To%20R%2008&action=list&return=LearnR.htm
**********************************************************************************
October 29, 2008

Milind: I missed the first session. I was planning to dial through a VoIP facility only, as I do not have international outgoing telephone services at home.
     That effectively means I cannot participate....:-)
     Please do update if VoIP becomes a viable option technically. Paul: We tried to offer VoIP and deeply regret that it did not work out. There are some discount phone services such as Skype, but they are not free. You can search on Google for other options.
     We will try to make the notes available on the website (http://www.fort.usgs.gov/brdscience/LearnR.htm) so that those who cannot participate or have to miss a session can still learn the material, either on its own or in conjunction with The R Book.
**********************************************************************************
Noel: Interesting secession today. Between the "ding" sounds, I got the gist of the secession. Question: I have installed version 2.8.0 and the packages listed on the NPS website, but when I open R, I only get the initial R Console screen. To view the Remote Commander GUI, I have to either input "library(Rcmdr)" or select Rcmdr from "Load Packages" under Packages on the toolbar.
     No matter how many times I've rebooted the computer or closed and reopened R, the only way I can view the Remote Commander is as above. Is this correct? Noel

Paul: To get R Commander and other packages to load automatically and to set the CRAN mirror (download site), edit
C:\Program Files\R\R-2.8.0\etc\Rprofile.site with NotePad or other word processor and add the following statements
local({ old <- getOption("defaultPackages")
      options(defaultPackages = c(old, "Rcmdr", "RcmdrPlugin.HH","RODBC","DAAG","MASS","lattice","sciplot","tree"))
      })
# set a CRAN mirror
local({r <- getOption("repos") r["CRAN"] <- "http://cran.stat.ucla.edu" options(repos=r)})
**********************************************************************************
Luis: I could not sign up into Webinar, because they ask for a credit card.... even for the Free trial.

Paul: We have subscribed to Webinar as presenters, so you do not need to in order to participate.  There is no cost to you and you will not need to enter a credit card number if you use the URL link Webinar sent you when your registered for the course with Webinar (https://www1.gotomeeting.com/register/656685716).
********************************************************************************** Brian: Thanks for today's first R lesson. It appears that there are only going to be a few people in the class using R on Mac OS X. If those people would like to form a Macintosh/R-users group for the duration   of this course so that we can handle Mac-specific installation,   configuration, and usage issues without bothering the majority of the   participants, they can email me at bmccloskey@usgs.gov.
********************************************************************************** Neil: There seems to be a problem with the file for adding the schedule to an Outlook calendar.  I imported the calendar and got no courses scheduled for November or the first half of December.  Starting in mid-December, courses were scheduled 7 days a week.
     The original calendar (sent out before the course time change) seemed to be correct, other than the fact that it was an hour off.

Paul: Thanks for letting us know. That is a function of GotoWebinar.
**********************************************************************************

Jonathan: One question: I noticed that there was a difference between what you and Tom had added to your Rprofile.site file and what was provided on the Learn R Topic one session.      What is the difference between using just the "Rcmdr"  and the "RcmdrPlugin.HH" ?? I tried adding the "Rcmdr" to my Rprofile.site in addition to those shown at top, but when I shut down and reran R, the R Commander did not automatically load. Are they basically the same plug-in and you only one of them in the Rprofile.site??
Thanks,

Tom: Just for further clarification, Rcmdr is the core GUI system, and if you look on the packages list there are 4 or 5 plugins available that extend it: .HH, .Export, .IPSUR, etc.  These plugins are extensions, not replacements for Rcmdr.  The second Rprofile.site that you show loads only the standard Rcmdr.  The first Rprofile.site (web page) that you show has RcmdrPlugin.HH, and because RcmdrPlugin.HH requires the Rcmdr package, the Rcmdr package is also automatically loaded, the same as if it were explicitly in the defaultPackages list.  [Rcmdr requires the tcltk package, so you'll see messages that tcltk is loaded first even though it isn't listed in the defaultPackages.]  I try to avoid such hidden dependencies and loadings, so my defaultPackages explicitly lists Rcmdr and RcmdrPlugin.HH:
local({
      old <- getOption("defaultPackages")
      options(defaultPackages = c(old,
"Rcmdr","RcmdrPlugin.HH","RODBC","DAAG","MASS","lattice","sciplot","tree","foreign"))
      })

I get both the R Console and the R Commander windows open when I start R, so I'm not sure why it doesn't work for you.  R is case-sensitive, so the package name is "Rcmdr", but that's what you put in your email.  There should be an error message or warning in the R Console window.  My startup gives the following:

Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading required package: car
Rcmdr Version 1.4-3
Loading required package: HH
Loading required package: lattice
Loading required package: grid
Loading required package: multcomp
Loading required package: mvtnorm
Attaching package: 'HH'
        The following object(s) are masked from package:car :
        vif
Loading required package: leaps
Loading required package: MASS
**********************************************************************************

Nancie : Are all the sessions going to be 'dial in'? If so this will not work very well from my setup here.

Paul: Yes, we had major problems trying to use VoIP yesterday, so we regret that the only option will be dialing in to the AI Telephone phone bridge.
**********************************************************************************

Travis: I heard you tell another participant in the R workshop about a website that gave instruction for how IT folks can grant you access to download packages, etc. for R. Can you share the website with me? Or can you tell me how our IT guy can set my computer up so that I can download packages, new versions of R, etc.? Thank you! And THANK YOU very much for organizing and presenting the workshop. I appreciate it so much.

Paul: I suggest that you look at Tom's site at http://science.nature.nps.gov/im/monitor/stats/R/Installation.cfm
**********************************************************************************
October 17, 2008 Thiago: Aa couple of questions about the R course:
1) For those of us that are not from NPS, is there any chance you could make at least some of the GCM results available for download, so we can use it to follow along? It might be better didactically than using one's own data.
2) Is there anyway to record the webinars in case people miss all instances of a class? I've watched a couple of recorded webinars before and they were still helpful without the interactive component.
Thank you for great initiative!

Paul: I think Tom will make a subset of the GCM results available so you can work with them.
     Instead of recording the presentations, I am attempting to cover the same material either at the course website or by reference to a text book, primarily Crawley's The R Book. There are a lot of details to keep track of, so references will be essential. I hope that reference to the website and text books will be a more useful approach then recording the sessions. There are also section 508 compliance issues with recording sessions.
**********************************************************************************

Thom: I have downloaded the R 2.8.0 version since it was the most recent version. Is that going to be a problem?

Paul: R-2.8.0 was released on Oct. 20. Yes, it will be a good idea to always work with the latest release, and I will soon upgrade. There do not appear to be any major changes, so the R-2.7.2 should also work. Several others has asked the same question.
**********************************************************************************

Noel: The R Book is on sale at Amazon for $78.02; http://www.amazon.com/gp/offer-listing/0470510242/ref=dp_olp_2.
**********************************************************************************
Eric: I am able to download and install R just fine, yet when I go to open the application it gives me the following error: “The application failed to initialize properly (0xc000007b). Click on OK to terminate the application.” I have tried to re-download and install R but I receive the same error. Do you have any idea why I might be receiving this error? Any suggestions to remedy the problem?

Paul: A Google search for the 0xc000007b error yields some response that may be helpful. It seems to be an operating system problem, possibly due to a virus, unrelated to R. Unfortunately the advice does not seem to be consistent. You may want to try one of the following, search some more, or ask for computer support.
http://www.thinkdigit.com/forum/showthread.php?t=43776
http://www.techsupportforum.com/microsoft-support/windows-xp-support/200229-application-failed-initialize-properly-0xc000007b.html
http://forums.asp.net/p/1221888/2194164.htm#2194164
http://www.vistax64.com/vista-mail/92104-initializing-error-0xc000007b.html

Eric: I ran several registry cleaners which didn’t seem to do the trick, and then noticed Section 2.2 “Other Strange Crashes” in the R FAQ. It mentions that some low level crashes might be due to bugs in device drivers. After updating/re-installing 23 drivers on my computer I can now start the program. I am fairly certain it was the audio driver that was responsible. Looking forward to the course!
**********************************************************************************

Andrew: I have just signed up for the course.
     I will miss all of next week, the first week. So I'm wondering how to plan my calendar for the next weeks/months of class.
     Does that mean I will start class on Tuesday November 4, with my first lab on Thursday November 6? If so that seems to mean I will need to skip the
normal second class date on Monday Nov 3rd. So does that mean there is no easy way to get on the Monday/Wednesday cycle, and I should expect to
always be on a Tuesday/Thursday cycle?
     (I wonder how I'm going to fare with a stats course when I can't even start without being muddled by a calendar schedule) Paul: Travel and other commitments are a part of everyone's schedule. To minimize the impact on the course, each session is repeated on a different day the following week. Both the original and the repeat session will cover the save material.
     If you miss the first week, you can participate in
Monday, session 3
Tuesday session 1
Wednesday session 4
Thursday session 2
Then you can participate in ether the Monday/Wednesday sessions or the Tuesday/Thursday sessions.
     We do not plan on repeating the labs.
**********************************************************************************

Dawn: We have a few people that are interested in learning r that won’t be able to attend the live seminar due to teaching conflicts, would it be OK if record it?

Paul: Please feel to record the Learn R sessions. However, each session is repeated the next week on a different day to minimize conflicts.

>Welcome Message October 23, 2008

Welcome to the course on learning R, a free software environment for statistical computing and graphics, which will be presented by conference calls with live web demonstrations. The course starts next Monday, October 27. There will be two-hour presentations on Monday and Wednesday of each week, repeated on Tuesday and Thursday the following week for those who have conflicts or are on travel. There will be a lab session working through examples on Thursdays, after the regular session. You need to register for both this course and the Webinar. Daylight time ends Sun., Nov. 2. The times are:
Hawaii 8:00-10:00
Alaska 10:00-12:00
Pacific 11:00-1:00
Mountain 12:00-2:00
Central 1:00-3:00
Eastern 2:00-4:00
UTC 6:00-8:00
There will not be a session of Tue. Oct. 28, but the lab on Thur. Oct. 30 will start at the regular presentation time (above) and focus on configuring R and data import/export. We are not sure how long it will take to get through the material with this schedule, but we will post dates for the other topics the week before the presentations on the course website (http://www.fort.usgs.gov/brdscience/learnR.htm). The first session on Oct 27 and Nov 4 will check out the audio and video presentation and the installation of R, R Commander, and the packages, so we will be ready to start the presentations on Oct 29 and Nov 6. Experience has shown that there are often problems getting the systems to work for everyone, and this will be a troubleshooting session. Please try to install R, R commander, and the packages before this session. This requires administrative permission on your computer, so some will have to have them installed by their IT support staff. You (or your IT staff) may find Tom's NPS R installation page helpful: http://science.nature.nps.gov/im/monitor/stats/R/Installation.cfm Starting on Oct 29 and Nov 6, Paul will introduce R, using the R Commander menus. This will be a quick survey to show you what features are available using the menus, with a more details discussion coming later in the course. Free on-line documents and standard statistical texts should be sufficient for this part of the course. Occasional users may only wish to participate in this first part of the course. If you are serious about using R, you will want to learn the R command language, because the menus, although helpful, are quite limiting. You will need to learn this language to use the full potential of R. Paul will work through Crawley (2007, The R Book, Wiley, 942 pages, $110 list price) chapters 1, 2, 4, 6, 8-21, 23, 24. Don't confuse this book with his Statistics, an Introduction Using R (327 pages). On Thursdays, Tom will present lab sessions applying and extending that week's material to real examples, with complications and problems that do no occur in textbook examples. Similar to undergraduate science labs, participants should attend that week's lecture and be familiar with the general procedures beforehand in order to get the most from the lab session. The first session on Oct. 30 will focus on importing data from databases and specialized file formats. While anyone is welcome to join the lab sessions, the examples will be targeted at NPS participants, using subsets of NPS datasets. Groups of participants from other agencies may wish to perform similar work with their own datasets, and may be able to find in-house experts to help them. The current (overly ambitious) intent is to build 2 or 3 "projects" as threads that will continue across lab sessions and weekly topics, and might generate useful products. One project will generate summary statistics and graphs of climate change predictions downscaled to individual parks or locations. During the first lab, participants will use the ncdf package to import and examine the downscaled GCM projection results for their parks downloaded in netCDF format. Subsequent lab sessions will use that dataset (among others) for exploratory data analysis and summary statistics, and then graphing.

We also invite guest lecturers to present sessions on the areas of R they are using and on interesting analyses and graphics. R is vast and very few people are familiar with all of R. Please contact Paul or Tom if you would like to present some of your work to the group, have a challenging problem, or would like to present an advanced feature of R. We hope to transition to special topics, after covering the basics of R. The course will evolve, depending on interest. TO PARTICIPATE, you will also need to register for the Webinar (https://www1.gotomeeting.com/register/656685716) to see the live web demonstrations.
You have three options to listen to the audio presentations.
*AI-Telephone phone bridge: Call the phone bridge in United States long distance: 319-279-1000, and enter PIN 940658. *4 raises volume, *6 puts the call on mute. These lines allow you to ask questions. PLEASE mute you phone when you are not talking to avoid the accumulation of room noises. We have 400 lines, which should be sufficient, but if not you can use one of the other options.
* GoToWebinar phone bridge: Call the phone bridge in United States long distance: 703-259-9001, Access Code: 124-456-298. The audio PIN will be shown after joining the Webinar. You will not be able to ask questions on these lines, only listen.
* GoToWebinar VoIP. Listen to the presentation through your computer without having to call a long distance telephone number. You will need a fast Internet connection, a microphone and speakers (a USB headset is recommended). For more information go to https://www1.gotowebinar.com/en_US/webinar/pre/faq.tmpl In a few minutes, we will also send the next installment of the discussion. If you have opted to receive course emails, you will receive it. If you wish to change your settings to either start or stop receiving these discussion emails, go to the participant page (http://www.fort.usgs.gov/brdscience/CourseParticipants.htm?course=Introduction%20To%20R%2008&action=list&return=LearnR.htm) and update your entry, setting "Receive e-mails about course" to either Yes or No. The discussion will also be posted on the course web page. Paul and Tom
-------------------------------------------
Paul H. Geissler, Ph.D.
US Geological Survey
Status & Trends of Biological Resources Program
Coordinator, National Park Monitoring Project
USGS Fort Collins Science Center
2150 Centre Ave., Building C, Fort Collins, CO 80526-8118
970-226-9482, FAX 970-226-9452
Paul_Geissler@usgs.gov (please do NOT send e-mail to Paul E. Geissler
PGeissler@usgs.gov)
http://biology.usgs.gov/status_trends/ It is easy to lie with statistics.
It is hard to tell the truth without statistics.
Andrejs Dunkels, quoted by Maindonald & Braun
-------------------------------------------
Tom Philippi, Ph.D.
Quantitative Ecologist
Inventory and Monitoring Program
National Park Service
1201 Oakridge Drive, Suite 150
Ft. Collins, CO 80525-5589
Tom_philippi@NPS.gov (970) 225-3586
Fax (970) 225 3597
http://science.nature.nps.gov/im/monitor
-------------------------------------------
October 22, 2008
Ted: I have been having trouble getting the recommended set of packages, and since we work for a gov't agency and only I have admin privileges, I am
trying to get everything installed before to save a little time. Can you help me out?
     This is what I get when I try to navigate to: http://bio.fiu.edu/R
Forbidden. You don't have permission to access /R/ on this server.

Tom: There's no index page on my bio.fiu.edu mirror, but only blind links:
http://bio.fiu.edu/R/R-2.7.2-win32.exe
http://bio.fiu.edu/R/recommended_contribs.zip
http://bio.fiu.edu/R/recommended_documentation.zip
      I just rechecked these links, and they work for me. If you still have problems, let me know.

*********************************************************************

Carl: According to this page the class is scheduled for 1:00 - 3:00 Central, but
the confirmation page sent after registering for the webinar lists the schedule as:
"This Webinar is held every week on Monday, Tuesday, Wednesday and Thursday, from: Oct 27, 2008 to Jan 15, 2009 12:00 PM - 2:00 PM CST" Paul: Thank you very much for spotting the problem with the Webinar. It should be 12:00-2:00 mountain time, 1:00-3:00 central time. I have corrected the Webinar time.
********************************************************************** Norma: I am registered for the course, as well as another colleague here at the refuge. I believe your message indicates that we will download R during the first lesson, yet there is information following your 10/15 email about which version to download. Do I wait for the course to start or download the information asap prior to the course? Thanks,

Paul: It will be better to download and set up R ahead of time. I should have said that we will be helping folks who had problems installing R during the first session. The installation requires administrative privileges, so it may be necessary to have your IT person install it.
     I am using R 2.7.1 although R 2.7.2 has been released and I will update my copy. There are also beta releases.
****************************************************************************************

Bryan: There have been some comments on problems with the MASS/MASS(VR) package. The NC mirror has neither, but has a VR package which appears to be the same thing. Also, the FL mirror appears to be down.

Tom: Yes VR is the newer name of the Venables & Ripley MASS package.
     I recommend the ucla mirror of cran, even though its physically far away from Florida. It appears to have the newest R2.7.2 binaries for osX, while
sunsite.unc.edu has only old versions. Use cran.stat.ucla.edu with username anonymous and password your email address.
     At one time UFL had a CRAN mirror, but their mirror server has been flaky for redhat and cygwin for years, so I recommend avoiding it.
     I don't have access to a Mac here, so I too won't be much help on the installation (which shouldn't be a problem) or the GUI & file naming
issues.
*************************************************************************************
Thomas: I am very excited about the R course. As I live and work in Greece I am a bit worried that my department will incur a high cost due to the international calls to your phone bridge. Could I (and the other members of our lab that have signed up) use the webinars only for watching/listening? I know that we wouldn't be able to ask questions but it's better than not being able to take part at all. Also this would allow us to take the course from home (the course finishes at 10pm local time).

Paul: Have you investigated the cost of Voice over IP (VoIP)? If you Google VoIP, you will get a lot of hits. Also try Google "discount international calls" for other options. We are not planning to use the Webinar phone service, because it would not allow participants to ask questions. Thomas: Skype is fairly cheap but it will add up and the problem is that there is virtually no way of anyone of us being able to claim the money spent on VoIP back from our department. We'd also get into trouble for using the available departmental conference facilities for long calls to the US every week.
     As I said we wouldn't mind too much not being able to ask questions. Is the Webinar phone service free for us users and is it fully web based (no phone required)? Couldn't you offer the Webinar phone service for those participants that can't afford to call and don't mind not being able to ask questions? Paul: I will try using the conference capability to call both the Webinar and AI Telephone, so that participants can use either the Webinar or AI Telephone service. The advantage of AI Telephone is that it allows participants to ask questions. Webinar notes that participants wishing to connect to audio using VoIP will need a fast Internet connection, a microphone and speakers (a USB headset is recommended). For more information go to https://www1.gotowebinar.com/en_US/webinar/pre/faq.tmpl
**************************************************************************************

Jennie: Paul, is it correct that the class will also be offered on the 28th and 30th as shown in the Webinar Registration?

Paul: There will not be a session on Oct 28 and only a lab on Oct 30,as the first two session will be repeated on Tue. and Thur. the following week. I needed to set up Webinar with a regular repeating pattern.
*************************************************************************************

Dennis: I was thinking about taking your R course that begins next week, and I wondered if you could give me a rough estimate as to the duration (i.e., 3 weeks, 6 weeks, etc.)
     Thanks so much. Looks like a great course! Tom: The duration is variable, with different stopping points for different needs. I suspect (and hope!) that some participants will just take the first 3-4 weeks: learning how to get data in and out of R, how to perform simple analyses via the R Commander GUI, and how to generate basic, appropriate graphs (topics 1-5). After the 4th week we will introduce the S language and writing commands. The next ~4-5 weeks will include more advanced but standard statistical analyses (regression, ANOVA, etc.) and more advanced graphics. We may complete that section before Christmas & New Year's. After that, I hope to have time to offer a series of shorter, smaller sessions on more advanced topics. For instance, choosing and generating GRTS-like sample draws would take 2 weeks (3-4 sessions). Analyzing species composition (vegetation) data might require 6 sessions to cover approaches & theory, then using vegan and labdsv for ordination, classification, and producing informative graphics.
     My Thursday labs (aimed at NPS folks) will both use real data (and thus find real problems) and try to generate useful products. For example, I'm putting together a project where each participant downloads downscaled climate change projections for their park, learns how to get that netCDF data into R the first week (quite simple, actually), uses those projection results in the exploratory data analysis and simple statistics the second week, and then generates meaningful graphics (e.g., are high or low temperatures projected to change more) the third or fourth week. Because such data are actually complex longitudinal or time series, if folks are interested we could have a session in January or February for more complex analyses, but by the end of the 5th topic we will have a valid, simple presentation of what the global circulation models predict for that park.
*************************************************************************************
David: A colleague in the States sent me the very interesting information on the web course in R that you will be offering. I'm writing to ask if it would be possible to full participate in the course without buying the text, Michael Crawley (2007, The R Book , Wiley, 942 pages, $110 list price). At that price, and having to order from the States, many of us in the Third World won't be able to participate. Is there any way to download a pdf file of the book, hopefully free or at a reduced rate, for Third-World scientists?
     Thanks for any advice, and good luck with this interesting course.
     Regards from Costa Rica, Paul: There are several excellent but brief free documents on R available on the web, see http://www.fort.usgs.gov/brdscience/LearnR.htm#References
The course website will show examples and their output. I will describe them during the lectures, but what you will miss is the background on the statistics which is available in The R Book. However, you will find much of the same material in other statistics texts. I hope you will be able to learn much about R from the course without The R Book, but it would be helpful.
     You will need to contact the publisher (Wiley.com) about any possible discounts.
     We will offer the lectures using VoIP, so you will not need to pay for a long-distance phone call. Tom: http://cran.r-project.org/other-docs.html lists several downloadable references in Spanish, and even some in Portuguese. My recommendation for ecologists is probably Kuhnert & Venables' Introduction to R, a 360 page set of notes they developed for CISRO, linked both on cran and on Paul's references page, but only in English.
     Unfortunately, while the datasets from the Crawley book are available for download, none of his R scripts are. My Thursday lab sessions will be independent of the Crawley book, and will try to present links to all necessary documentation.

Paul: Many of Crawley's R scripts are available on the course website (http://www.fort.usgs.gov/brdscience/LearnR.htm).
*************************************************************************************
Cristina: Your upcoming course on R seems very interesting, but unfortunately I have 2 weeks of travel in a row exactly when the course is given. Could you please let me know where I can subscribe to receive information if this course is ever taught again? Paul: The course will probably continue for a few months, so I would not be discouraged if you have too miss two sessions. I hope the course website and the references will be sufficient to for folks to follow along, if they have to miss sessions.
     This is the second year we have offer the R course, and we hope to offer it annually. This year it is considerably expanded and improved over the first time.
*************************************************************************************
Daniel: Although it says on the website that Webinar is free, I cannot find a way to subscribe but the free 30-day trail. After
that, one is supposed to pay ~999/mo. Am I doing something wrong, or we are supposed to pay for that? Paul: No, we have subscribed to Webinar as the presenters, so you do not need to as a participant. To participate in the Webinar, go to https://www1.gotomeeting.com/register/656685716

Learn R – Update October 14, 2008 Welcome to the short course on learning the R statistical system. It will start on October 27, with sessions on Monday and Wednesday, repeated the following week on Tuesday and Thursday. In addition to registering for this course, you also need to register for the webinars at https://www1.gotomeeting.com/register/656685716 in order to see the live web demonstrations. We will use a separate conference line and not use the one that comes with the webinar, because that one does not allow you to ask questions. I will provide call-in information shortly before the course starts. As of October 14, we had 359 participants registered. Please tell others who may be interested about the course. They can learn more and register at http://www.fort.usgs.gov/brdscience/learnR.htm. We will batch the questions and comments and send them periodically. If you do not wish to receive notices and discussion about the course, you can click on participants from the course page (http://www.fort.usgs.gov/brdscience/CourseParticipants.htm?course=Introduction%20To%20R%2008&action=list&return=LearnR.htm) and update your record setting "Receive e-mails" to "No". If you set this parameter to "No", this will be the last e-mail you receive about this course. You will still be registered and can get updates and view the discussion from the website. We are not sure how long the course will last, because we do not know how long it will take to cover the material. We will start with downloading and installing R. Then we will cover menu driven analyses for the casual user, followed by a look at R graphics. Then, Paul plans to work through Crawley (2007, The R Book) chapters 1, 2, 4, 6, 8-21, 23, 24. Tom will have a lab with discussions of examples on Thursdays, following the regular presentation. We will invite those working with R to present sessions on their areas of expertise and hope to follow the structured course with special topics relating to natural resources. Please contact us if you would like to volunteer to present a session. The course will evolve in response to your interest. We will appreciate suggestions. We plan to skip the weeks of Thanksgiving (Nov. 24), Christmas (Dec. 22), and New Year (Dec. 29). Comments and questions we have received so far are listed below. Cheers,
Paul and Tom
********************************************************
Tom: One can use anonymous ftp instead of http to most if not all mirrors, e.g., to cran.stat.ucla.edu, then go to the public/CRAN/bin/windows/base and public/CRAN/bin/windows/contrib/2.7/ I have mirrored the r 2.7.2 installer for windows at an .edu site in the eastern US:
http://bio.fiu.edu/R/R-2.7.2-win32.exe (31MB)
and your recommended set of packages at:
http://bio.fiu.edu/R/recommended_contrib.zip
and a subset of the free pdf documentation at:
http://bio.fiu.edu/R/recommended_documentation.zip (4.8MB) For NPS folks, I have mirrored onto the NPS intranet at:
http://www1.nrintra.nps.gov/im/monitor/Rcourse/R-2.7.2-win32.exe
http://www1.nrintra.nps.gov/im/monitor/Rcourse/recommended_contrib.zip
http://www1.nrintra.nps.gov/im/monitor/Rcourse/recommended_documentation.zip My recommended documentation are the R Development Core team intro, admin (for installation) and data guides, plus the Kuhnert & Venables CSIRO lecture notes.
********************************************************
Kerry: I am trying to figure out how the conference call will work and how we can see the presentations at the same time. I was trying to arrange a phone for the conference call with the IT person at my university and he was overly complicating it I think and going to charge $90 for me to use the conference phone in the department. Paul: You will need to call our phone bridge long distance. I will provide you with a PIN to sign on about a week before the course. There are several low cost long distance telephone options, including voice over IP (VoIP) such as Skype. Google "discount long distance phone". Discount phone service does not require a special phone but VoIP does.
***************************************************
Kerry: Well, I've got R on my computer and I entered the command line: install.packages(c("car","conf.design","corrgram","DAAG","effects","ellipse","faraway","gplots", "lattice","leaps","lme4","lmtest","MASS(VR)","Rcmdr","RcmdrPlugin.HH","RODBC","sciplot","tree"))
And it sent back a warning:1: package ‘MASS(VR)’ is not available. I was wondering what I could do to fix this. Paul: The Name of the Venables and Ripley's 'Modern Applied Statistics with S package is MASS although it is listed as MASS(VR) on the menu. Note that R is the open source version of S, a statistical language. Thus the correct command is:
install.packages(c("car","conf.design","corrgram","DAAG","effects","ellipse","faraway","gplots", "lattice","leaps","lme4","lmtest","MASS","Rcmdr","RcmdrPlug
in.HH","RODBC","sciplot","tree"))
*****************************************************************************
Dave: I was not able to successfully download all of the packets you recommend for your R class. How should I proceed? I am attaching the download process log, it hopes that it will help you recognize what happened. I used NC as the mirror. Paul: I suggest trying to install the effects, gplots and tree package from the R Console menu. Select "Packages", then "Install Package(s)", select a mirror and then select the packages. Note that in the notes I listed MASS(VR) in the install command. It should be MASS in the command, but MASS(VR) in the menu. Please let me know if this works. Dave: That worked. Thanks. I changed my CRAN mirror from NC to IA, which also might have helped. The first time I tried NC today, it gave me a very abbreviated list (~10) of packages.
*************************************************************
Jeremiah: It’s not entirely clear to me how long this course goes for. From the website, it looks like it will occur (at least) on Monday and Wednesday, October 27th and 29th and also be re-broadcast (do-overs) on Tuesday and Thursday, November 4th and 6th. Is that correct? Based on the number of topics that will be covered, it looks like it might go for several weeks. So, will it be on any other dates in successive weeks (e.g., every M and W for 3, 4, 5 etc. weeks and repeated on T and Th of the following weeks; stuttered)? Thanks for the clarifications. I just need to know for scheduling. Paul: I also don't know how long the R course will go, as it depends on how long it takes to cover the topics and on the interest of the participants. The first few sessions will cover the basics. The R Book is 942 pages long. Although, I do not intend to cover everything in the book, it is still a lot of material to cover. I expect that the course will go into the new year, with a break for the holidays and possibly other courses.
***********************************************************
Tony: I just registered for the R short course and I had a comment and question. First, I am hosting a group of people (10-15) in a conference room to participate in the course. We have been involved with some of your courses in the past and have been pleased. Since someone else was in charge before, I am new to the conference call/computer presentation methods. I have figured most details out but was wondering if I need a certain program on the computer in able to follow along with the presentation? Thanks for your help and for putting on great courses. Paul: It is a good idea to participate in a group because you can share comments during the presentation. However, I suggest that each person register for the course so they will receive notices by e-mail and can participate in the on-line discussion.
I will distribute call-in and Webinar information, about a week before the course starts. It will be easy to install the Webinar client on your computer. We do not start the conference call and Webinar service too far in advance to avoid paying for services we are not using.
****************************************************
Jim: I just got denied use of this software on my computer since the software apparently connects and runs through a central computer in Austria? Anyone else have software security issues with this? Paul: To run R, one needs to download the program and packages from a nearby site (mirror). There are mirrors throughout the world with copies of the program and packages, including several in the US. Austria is near the start of the list alphabetically (behind Argentina and Australia), while the US mirrors are at the end of the list alphabetically. It is possible that Austria was selected because it was near the top of the list. I think picking one of the US mirrors will solve the problem.
**********************************************
Chris: Going through the console menu, I did install MASS(VR), but "RcmdrPlugin.HH" and "lme4" are not listed. There are "Rcmdr.HH", "Rcmdr", and "lmeSplines" packages, however. Are these the ones that I need by any chance? Paul: I used the USA(MI) mirror and was able to see the "RcmdrPlugin.HH" and "lme4"packages. I don't know but you might try another mirror. Please let me know if this works. Chris: I still can't see those packages, and I'm suspecting it may be because I currently am running version 2.4.0 of R. I just put in a request to our IT people to upgrade my version of R. Let's hope that works. If it does work, then it may be a good thing to send out a notice to the people who have registered to make sure they have an up to date version of R. I'll let you know how this turns out. I don't know how long it will take for IT to get this upgrade done (which may be another reason to notify people early). I've checked multiple mirrors (certainly not all though), including the Michigan one. I've also checked other computers here, and the ones with version 2.7 can find the packages but the ones with 2.4 cannot.  

Thanks to USGS Fort Collins Science Center for hosting this page for the USGS Biology Science Staff.

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
Page Contact Information: Paul_Geissler@usgs.gov