similar to: The R Inferno

Displaying 20 results from an estimated 5000 matches similar to: "The R Inferno"

2009 Sep 17
2
r-inferno.pdf with detailed table of contents and bookmarks
Hi, I don't find a r-inferno.pdf that has detailed table of contents and bookmarks. If it is possible, can somebody help generated one and post it on line? Regards, Peng
2012 Jul 17
3
complexity of operations in R
Hello! I am optimizing my code in R and for this I need to know a bit more about the internals. It would help tremendously if someone could link me to a page with O()-complexities of all the operations. In this particular case, I need something like a linked list with O(1) insertLast/First ability. I can't preallocate a vector since I do not know the final size of the list ahead of time. The
2012 Jan 26
2
What does [[1]] mean?
I know that [] is used for indexing. I know that [[]] is used for reference to a property of a COM object. I cannot find any explanation of what [[1]] does or, more pertinently, where it should be used. Thank you. [[alternative HTML version deleted]]
2009 Mar 31
2
Programming objects in R
I am planning a project where an object-oriented approach would be appropriate, and for a number of reasons I would prefer using either Python or R. My problem at the moment is to find out how to do OO programming in R. Are there any introductory texts anywhere ? Tom -- +----------------------------------------------------------------+ | Tom Backer Johnsen, Psychometrics Unit, Faculty of
2012 Apr 17
3
Can a matrix have 'list' as rows/columns?
After a lot of processing I get a matrix into M. I expected each row and column to be a vector. But it is a list. R-Inferno says... "Arrays (including matrices) can be subscripted with a matrix of positive numbers. The subscripting matrix has as many columns as there are dimensions in the array—so two columns for a matrix. The result is a vector (not an array) containing the selected
2024 Mar 24
1
an issue about subsetting a vector
As with a lot of things in R, the behaviour is counterintuitive but (arguably) logical. The key (maybe) is that `a[-x]` does not mean "take all of the elements of a except those indicated by `x`, but rather, "negate x, then take all but the negative elements". In other words, -integer(0) is integer(0) (we multiply *each of the elements of integer(0)* by -1, but
2011 Nov 11
3
Why does length("") == 1?
It seems obvious to me that the empty string "" is length 0. cheers Worik [[alternative HTML version deleted]]
2012 Mar 03
1
"Global" Variable in R
Dear all, I would like to ask you if there is a way to define a global variable in R? I am having a bunch of function and I think the easier would be to have a global function defined at some point... Would that be possible? Regards Alex [[alternative HTML version deleted]]
2010 Dec 23
1
speed issues? read R_inferno by Patrick Burns: & a memory query
Hi, I'm just starting out with R and came across R_inferno.pdf by Patrick Burns just yesterday - I recommend it! His description of how 'growing' objects (e.g. obj <- c(obj, additionalValue) eats up memory prompted me to rewrite a function (which made such calls ~210 times) so that it used indexing into a dimensioned object instead (i.e. obj[i, ] <- additionalValue). This
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi, Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop: x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)} I get the error message: Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix Any ideas??? Appreciate any thoughts.
2012 Mar 05
2
no partial matching of argument names after dots argument - why?
I noticed that the argument names after the dots argument are not partially matched. foo <- function(one, two, ...){ one + two } > foo(o=1, t=2) [1] 3 foo <- function(one, ..., two){ one + two } > foo(o=1, t=2) Fehler in one + two : 'two' fehlt Can someone explain me the reason for this behavior? THX Mark ???????????????????????????????????? Mark Heckmann Blog:
2011 Dec 23
3
if statement problem
Hello, I want to do fisher test for the rows in data file which has value less than 5 otherwise chi square test .The p values from both test should be stored in one resulted file. but there is some problem with bold if statement. I don't know how implement this line properly. x = cbind(obs1,obs2,exp1,exp2) a = matrix(c(0,0,0,0), ncol=2, byrow =TRUE) #matrix with initialized values
2012 Dec 15
3
How to speed up the for loop by releasing memeory
Dear list; How can I speed up the run of following code (illustrative) #======================================================================== con<-vector("numeric") for (i in 1:limit) { if(matched data for the ith item found) { if(i==1) {con<-RowOfMatchedData } else {con<-rbind(con,matchedData)} } }
2009 Mar 18
3
numeric equality
Dear all, I am totally confused by the following R output, but don't have a clue for it. > a <- 1 - 0.2 > a == 0.8 [1] TRUE > a <- 1 - 0.8 > a == 0.2 [1] FALSE > a <- 1 - 0.5 > a == 0.5 [1] TRUE > a <- 1 - 0.6 > a == 0.4 [1] TRUE > a <- 1 - 0.9 > a == 0.1 [1] FALSE My R version is Windows XP R version 2.8.1 (2008-12-22).
2011 Dec 11
3
how to assign a value?
Hi there, I hope to modify values in a vector or matrix in the following code: for (i in 1:9) { assign(paste("a.", i, sep = ""), 1:i) get(paste("a.", i, sep = ""))[i] <- i+50 } I get the following error message: Error in get(paste("a.", i, sep = ""))[i] <- i + 50 : target of assignment expands to non-language object
2011 Feb 16
1
incomplete final line
Hi, I work like this: > data<?read.table('E:/my documents/r/consumer.xls',header=TRUE) Warning message: In read.table("E:/my documents/r/consumer.xls", header = TRUE) : incomplete final line found by readTableHeader on 'E:/my documents/r/consumer.xls' could someone shoot the trouble for me ? thx sorry for trouble ,im a newbie. -- View this message in
2012 Nov 22
1
Optimizing nested function with nlminb()
I am trying to optimize custom likelyhood with nlminb() Arguments h and f are meant to be fixed. example.R: compute.hyper.log.likelyhood <- function(a, h, f) { a1 <- a[1] a2 <- a[2] l <- 0.0 for (j in 1:length(f)) { l <- l + lbeta(a1 + f[j], a2 + h - f[j]) - lbeta(a1, a2) } return(l) } compute.optimal.hyper.params <- function(start, limits, h_, f_) { result
2014 Aug 06
2
Subscripting Matrices
There seems to be a result type difference when subscripting a 6 x 1 matrix as compared to a 3 x 2 matrix that is caused by the ncol = 1 compared to ncol > 1. > ThinMatrix <- matrix(1:6,ncol=1) > ThinMatrix [,1] [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,] 6 > FatMatrix <- matrix(1:6,ncol=2) > FatMatrix [,1] [,2] [1,] 1 4 [2,] 2 5
2012 May 20
4
R Memory Issues
---------- Forwarded message ---------- From: Emiliano Zapata <ezapataika@gmail.com> Date: Sun, May 20, 2012 at 12:09 PM Subject: To: R-help@r-project.org Hi, I have a 64 bits machine (Windows) with a total of 192GB of physical memory (RAM), and total of 8 CPU. I wanted to ask how can I make R make use of all the memory. I recently ran a script requiring approximately 92 GB of memory to
2009 Jul 31
2
[LLVMdev] llvm-gcc build of inferno/plan 9 'mk' fails
hello, I'm attempting to build the inferno source tree using either of native LTO or jit'd bins and having no obvious luck. im using macports (current as of this email) llvm-2.5 and llvm-gcc on a macbook pro (x86) following the inferno directions verbatim will use 'cc' as the compiler and just works. the build tools are different from the naive build tools as follows: