background preloader

Code School - Try R

Code School - Try R

heather.cs.ucdavis.edu/~matloff/r.html Professor Norm Matloff Dept. of Computer Science University of California at Davis Davis, CA 95616 R is a wonderful programming language for statistics and data management, used widely in industry, business, government, medicine and so on. And it's free, an open source product. Downloading R: R is available for Linux, Windows and Mac systems. You can download R from its home page. For Ubuntu Linux or other Debian-related OSs, a more direct method is: % sudo apt-get install r-base Learning R: There is a perception among some that R has a steep learning curve, but I disagree. I'll list a few tutorials below (not necessarily the best, just ones I know of). "When in doubt, try it out!" Here are some resources that I might recommend for learning R: A nice centralized collection of R resrouces. Advanced R: R Programming Tools: One of the most debated topics in R online discussions is that of programming tools for R, of which there are many. People you can talk to:

Usability Requirements Template - Super User Friendly The primary purpose of Usability Requirements is to ensure that the system meets the expectations of its users with regard to its ease-of-use. The expectations of users who have disabilities and employ assistive technologies must also be included. The work product is used to: · Provide baseline guidance to the user interface developers on user interface design. · Establish performance standards for usability evaluations. · Define test scenarios for usability test plans and usability testing. · Document feedback on the usability of the accessibility features and technical accessibility enablement of the system. Note: Accessibility may be conceptually linked to disability; but accessibility also means that people who have older technology, such as modems and earlier versions of browsers, can use the product equally as well as people with the latest technology, such as hardware, software, and Internet connections. Download the Template from the Attachments Section Below

An Introduction to R Table of Contents This is an introduction to R (“GNU S”), a language and environment for statistical computing and graphics. R is similar to the award-winning1 S system, which was developed at Bell Laboratories by John Chambers et al. It provides a wide variety of statistical and graphical techniques (linear and nonlinear modelling, statistical tests, time series analysis, classification, clustering, ...). This manual provides information on data types, programming elements, statistical modelling and graphics. This manual is for R, version 3.1.0 (2014-04-10). Copyright © 1990 W. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Preface This introduction to R is derived from an original set of notes describing the S and S-PLUS environments written in 1990–2 by Bill Venables and David M. Comments and corrections are always welcome. Suggestions to the reader 1.1 The R environment Try ?

Matrix Construction There are various ways to construct a matrix. When we construct a matrix directly with data elements, the matrix content is filled along the column orientation by default. For example, in the following code snippet, the content of B is filled along the columns consecutively. > B = matrix( + c(2, 4, 3, 1, 5, 7), + nrow=3, + ncol=2) > B # B has 3 rows and 2 columns [,1] [,2] [1,] 2 1 [2,] 4 5 [3,] 3 7 Transpose We construct the transpose of a matrix by interchanging its columns and rows with the function t . > t(B) # transpose of B [,1] [,2] [,3] [1,] 2 4 3 [2,] 1 5 7 Combining Matrices The columns of two matrices having the same number of rows can be combined into a larger matrix. > C = matrix( + c(7, 4, 2), + nrow=3, + ncol=1) > C # C has 3 rows [,1] [1,] 7 [2,] 4 [3,] 2 Then we can combine the columns of B and C with cbind. > cbind(B, C) [,1] [,2] [,3] [1,] 2 1 7 [2,] 4 5 4 [3,] 3 7 2 Deconstruction

R FAQ: How does R handle missing values? R FAQ How does R handle missing values? Version info: Code for this page was tested in R Under development (unstable) (2012-02-22 r58461) On: 2012-03-28 With: knitr 0.4 Like other statistical software packages, R is capable of handling missing values. However, to those accustomed to working with missing values in other packages, the way in which R handles missing values may require a shift in thinking. On this page, we will present first the basics of how missing values are represented in R. Very basics Missing data in R appears as NA. x1 <- c(1, 4, 3, NA, 7)x2 <- c("a", "B", NA, "NA") NA is the one of the few non-numbers that we could include in x1 without generating an error (and the other exceptions are letters representing numbers or numeric ideas like infinity). is.na(x1) is.na(x2) We can see that R distinguishes between the NA and "NA" in x2--NA is seen as a missing value, "NA" is not. Differences from other packages We can try the equivalent in R. x1 < 0 x1 == NA NA options in R na.omit(g)

Related: