r

How do I use `[` correctly with (l|s)apply to select a specific column from a list of matrices?

Consider the following situation where I have a list of n matrices (this is just dummy data in the example below) in the object myList mat <- matrix(1:12, ncol = 3) myList <- list(mat1 = mat, mat2 = mat, mat3 = mat, mat4 = mat) I want to select a specific column from each of the matrices and do something with it. This will get me the ...

How can I contribute to base R in small ways?

Occasionally I see small ways I could improve either R (recently the IQR command) and R documentation (just this week perhaps elaborating differences among and better interconnecting aggregate, tapply, and by). But I don't see a way to really make that contribution back. I looked into the developer site and it seems that my options are...

Problem with namespace installing rJava

I am installing rJava on a 64bit machine, running Windows XP, and am encountering the weirdest message. Below is the log. Has anyone seen this before? Thanks in advance. > install.packages("rJava") --- Please select a CRAN mirror for use in this session --- trying URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.12...

how to increase the speed of R CMD build when directory contains large unassociated files?

I have a R package in the directory ~/package; I also keep the output from my use of the package in the directory ~/package/out. When the content of ~/package/out gets very large, it takes minutes instead of seconds to build this package. Is there a way to have "R CMD build package" ignore the ~/package/out directory? ...

When developing an R package, do I have to recompile the package every time I make a change?

I am developing a package in R When I am debugging a particular function or set of functions, what is the best way to test the function? Do I have to either use source('function.R') or R CMD build each time I want to check my changes? (extra credit for associated emacs ess key-bindings) ...

in R, can I stop print(cat("")) from returning NULL? and why does cat("foo") return foo>

if I enter print(cat("")) i get NULL I want to use cat() to print out the progress of an R script, but I don't understand why it is returning "NULL" at the end of all of my concatenated strings, and more importantly, how to get ti to stop? Thanks in advance. ...

Creating R data frames and .rdata files from Java

What is the most memory efficient and easiest (yes, I know those are sometimes mutually exclusive) way to create an R data frame then save it to an .Rdata file using Java? Go easy on me though, I'm not a Java developer. ...

R Quality Assurance Techniques

Could you provide some insight into the techniques that you use to ensure the quality of your solutions. For example, sometimes, I like to test my result using stopifnot() to ensure I'm not receiving ridiculous results. Are there any other techniques or functions that you use in data processing to ensure that you're receiving the solutio...

How to search through pubmed using R, as is possible with Ruby?

I just came by the Ruby function ncbi.esearch_count Used in a recent post here (regarding the use of the word noval in publications), used to search in pubmed. And I wonder how can it be done using R (via maybe Rcurl, or other library(XML) functions)? Thanks. ...

What is R table function max size?

I'm using the R table() function, it only gives me 4222 rows, is there some kind of configuration to accept more rows? ...

Extraction from a string in R or Python

I have a csv file with addresses that include ',', empty space, numbers. I have two other files with city and zip codes. I want to read the address file and extract the city name and zip codes. As you will see below the addresses have no easy pattern and is randomly sprinkled with ',' spaces etc.Here is an example. Address file 123 Ri...