r

Moving an R Plot header

Hi, I was trying to create a graph in R Plot and was just wondering if there was any way to move the side header lable closer to the graph. I've made the font smaller and put the lable into two lines, but when I put it into two lines the top line falls off the screen and the bottom line is rather far away from the numbered Y-Axis of ...

Can you use R terminal commands on a Mac computer?

Hi, I wrote some code in school to basically bring up different graphs from R and I had wanted to use it on a mac computer. Is there are way to use R terminal commands on a mac computer and is there a place where I could get more information about these mac R Terminal commands? Thanks so much! ...

Extend my Java application with R?

Im building an application that i want to have extended with modules that does some nr crunching and i would like to have R for that. What are my best options for extending my Java application with R? ...

How do I plot a classification graph of a SVM in R

I have an svm in R and I would now like to plot the classificaiton space for this machine. I have found some examples on the Internet, but I can't seem to make sense of them. My R script is as follows: library(e1071) day_of_week <- c(0,1,2,3,4,5,6) holiday <- factor( c(T, F, F, F, F, F, T) ) model <- svm(day_of_week, holiday) plot(mode...

Getting rid of axis values in R Plot

Hi, i was just wondering if there was a way to get rid of axis values, either the x axis or y axis respectively, in an r-plot graph. I know that axes = false will get rid of the entire axis, but i would only like to get rid of the numering. Thanks so much! ~Sam ...

How to reduce size of R plots in EPS format?

I have a histogram with several hundred items, for which I do a Q-Q plot. This results in EPS that is 2.5 megabytes large. This is too much for a figure that is only going to be included in a publication and is not going to be viewed at 100x magnification. Is there any option in R to somehow output smaller EPS? I have searched docs to n...

Best introductory level "R" programming language book?

Possible Duplicate: Books for learning the R language As subject states, I need recommendation for "Introcudion to" R language book. ...

Tutorial Using R on an Amazon Ec2 using just browser for building a regression model

Assume I have huge huge data and no money for hardware for more RAM for R AND software like Windows or any non open source . Just an internet connection. and an university Amazon ec2 account. Could you please guide me to a step by step- copy and paste coding tutorial on building a model using any Package on Amazon ec2. Note- I know BI...

Most mature sparse matrix package for R?

There are at least two sparse matrix packages for R. I'm looking into these because I'm working with datasets that are too big and sparse to fit in memory with a dense representation. I want basic linear algebra routines, plus the ability to easily write C code to operate on them. Which library is the most mature and best to use? So ...

convert data from many rows to many columns in R?

I have data that comes out of a DB in a normalized way with a field for year, state, and value. I would like to do analysis on the data and need it formatted where each year is a field and not a record.So I would like the data where each record is a state and then theres a field for each year and each value for those fields are the value...

R function for testing if a vector contains a given element

In R, how do you test a vector to see if it contains a given element? ...

Are there any programming challenges out there for R users?

Are there any websites or blogs with programming challenges specifically for R users? ...

Native vs ODBC database connections with R

I understand that some databases have native support in R (e.g. MySQL) but you can connect to other DBs like MS SQL Server using RODBC. How much speed improvement does one gain for reading/writing with the native drivers vs. RODBC? What other DBs have native drivers in R? Is reading faster or slower than writing generally? ...

Memory Usage in R

After creating large objects and running out of RAM, I will try and delete the objects in my current environment using rm(list=ls()) When I check my RAM usage, nothing has changed. Even after calling gc() nothing has changed. I can only replenish my RAM by quitting R. Anybody have advice for dealing with memory-intensive objects wi...

Cumulative sums, moving averages, and SQL "group by" equivalents in R

What's the most efficient way to create a moving average or rolling sum in R? How do you do the rolling function along with a "group by"? ...

Finding Multiple Elements in a Vector

Suppose I have the following vector: > x <- sample(1:10,20,replace=TRUE) > x [1] 8 6 9 9 7 3 2 5 5 1 6 8 5 2 9 3 5 10 8 2 How can I find which elements are either 8 or 9? ...

Manipulating Network Data in R

I have a data frame detailing edge weights among N nodes. Is there a package for working with this sort of data? For example, I would like to plot the following information as a network: p1 p2 counts 1 a b 100 2 a c 200 3 a d 100 4 b c 80 5 b d 90 6 b e 100 7 c d 100 8 c e 40 9 d e 60...

In R, what is the difference between the [] and [[]] notations for accessing the elements of a list?

R provides two different methods for accessing the elements of a list or data.frame- the [] and [[]] operators. What is the difference between the two? In what situations should I use one over the other? ...

Debugging tools for the R language

Hi everybody, After learning R about 9 months ago, I am finally graduating from debugging by using print() statements every other line. I am now a pretty constant user of browser() and debug(). I have recently become aware of a few more tools: traceback(), trace(), and recover(). Does anybody have advice on when (and how) to use th...

Writing functions in R, keeping scoping in mind

I often write functions that need to see other objects in my environment. For example: > a <- 3 > b <- 3 > x <- 1:5 > fn1 <- function(x,a,b) a+b+x > fn2 <- function(x) a+b+x > fn1(x,a,b) [1] 7 8 9 10 11 > fn2(x) [1] 7 8 9 10 11 As expected, both these functions are identical because fn2 can "see" a and b when it executes. But ...