similar to: Attempting to access an R list from within C code

Displaying 20 results from an estimated 500 matches similar to: "Attempting to access an R list from within C code"

2011 May 13
1
issue with odfWeave running on Windows XP; question about installing packages under Linux
Good morning R community, I have two questions (and a comment): 1) A problem with odfWeave. I have an odf document with a table that spans multiple pages. Each cell in the table is populated using \sexpr{<R stuff>}. This worked fine on my own machine (windows 7 box using any R2.x.y, for x>=11) and on a colleagues machine (Windows XP box running R2.11.1). However, on a third machine
2010 Mar 22
7
How to reference a select_tag within a form
Hi All, Inside my app\views\expenses\new.html.erb file, I had the code: <% form_for(@expense) do |f| %> [snip] <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <br /> <div id="vendor_droplist> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple
2011 Jun 19
1
hello about proxy configuration
dear everyone system:windows XP R2.13.0 I download the windows binary from website and successfully install it ,because I use a proxy server ,when I follow the instrction as follows: I set a system property R_HOME=C:\Program Files\R\R-2.13.0 " R_HOME\bin\i386\Rgui.exe http_proxy=http://211.83.105.140:808/" error:: '\i' is an unrecognized escape in character string starting
2011 Jun 23
3
problem (and solution) to rle on vector with NA values
Hello there R-help, I'm not sure if this should be posted here - so apologies if this is the case. I've found a problem while using rle and am proposing a solution to the issue. Description: I ran into a niggle with rle today when working with vectors with NA values (using R 2.31.0 on Windows 7 x64). It transpires that a run of NA values is not encoded in the same way as a run of other
2005 Oct 18
2
loading packages - mac user
Hi, I'm using a Mac, I've downloaded R (base), and I'm trying to download the package R Commander. I thought I had already done this (both from the web and from within R) but it doesn't seem to be working - it's not there as a "search()" reveals. However, there are plenty of files on my system linked with Rcmdr - located in
2009 Dec 17
2
issue with using rm: cannot generate on-the-fly list
Hello, I have the following problem when trying to use rm: In a top level script file I have a loop iterating over some index. The loop is not contained within a function, so the scope of variables declared in the loop is global. Within this loop I generate several variables which should be removed at the end of each iteration. To do this, I wrote a function to clean up the workspace. An example
2011 Aug 17
1
A question about using getSrcDirectory() with R/Rscript
Good morning R-help, I have an idiot question: I would like to use getSrcDirectory() and friends to allow me to identify where an R file has been called from when invoked using Rscript. If I understand the documentation correctly, the following example should work: In file test.R: options(keep.source=T) fn<-function(x){x<-x+1} srcDir<-getSrcDirectory(fn) print(srcDir) I
2010 Feb 26
3
Preserving lists in a function
Dear R users, A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults. However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R: myfunction=function( list1=list
2006 Jun 26
0
sortables and accept question
i did some searching through the archives and didn''t really find an answer to my question, so i''m going to just ask it. i have a situation where there are 3 sortable lists. list1, list2, and list3 i need list2 to accept divs from all 3 lists, but list1 and list3 to only accept divs from the list1 and list3 i''ve added two classes to the divs in my sortables: .rail
2013 Jan 10
1
merging command
HI Eliza, You could do this: set.seed(15) mat1<-matrix(sample(1:800,124*12,replace=TRUE),nrow=12) # smaller dataset #Your codes ?list1<-list() ?for(i in 1:ncol(mat1)){ ? list1[[i]]<-t(apply(mat1,1,function(x) x[i]-x)) ? list1} ?x<-list1?? x<-matrix(unlist(x),nrow=12) x<-abs(x) ?y<-colSums(x, na.rm=FALSE) z<-matrix(y,ncol=10) ?z<-as.dist(z) ?z ?# ?? 1?? 2?? 3?? 4?? 5??
2010 Mar 15
1
rbind, data.frame, classes
Hi, This has bugged me for a bit. First question is how to keep classes with rbind, and second question is how to properly return vecotrs instead of lists after turning an rbind of lists into a data.frame list1=list(a=2, b=as.Date("20090102", format="%Y%m%d")) list2=list(a=2, b=as.Date("20090102", format="%Y%m%d")) rbind(list1, list2) #this loses the
2008 Oct 27
2
IRB error message (dyld: NSLinkModule() error)
Hi folks, I''m new to Rails. I picked up Simply Rails 2 by Patrick Lenz a few weeks ago and I finally sat down to get stuck into it. I have Rails installed on my iMac (OS X Leopard) and I can load up the Rails Welcome screen at localhost:3000 without any issues. My problem is with running IRB within Terminal. If I try to run: irb> 1 I receive the error: dyld: NSLinkModule() error
2007 Oct 15
1
The "condition has length > 1" issue for lists
I have the following code: list1 <- list() for (i in list.files(pattern="filename1")){ x <- read.table(i) list1[[i]] <- x } list2 <- list() for (i in list.files(pattern="filename2*")){ x <- read.table(i) list2[[i]] <- x } anslist <- vector('list', length(list1)) for(i in 1:length(list1)) if (list1[[i]] & list2[[i]] >1)
2011 Jan 20
1
syntax for a list of components from a list
I'm attempting to generalise a function that reads individual list components, in this case they are matrices, and converts them into 3 dimensional array. I can input each matrix individually, but want to do it for about 1,000 of them ... This works array2 <- abind(list1[[1]],list1[[2]],list1[[3]],along=3) This doesn't array2 <- abind(list1[[1:3]],along=3) This doesn't either
2011 Nov 21
1
Creating a list from all combinations of two lists
R-helpers: Say I have two lists of arbitrary elements, e.g.: list1=list(c(1:3),"R is fun!",c(3:6)) list2=list(c(10:5),c(5:3),c(13,5),"I am so confused") I would like to produce a single new list that is composed of all combinations of the "top level" of list1 and list2, e.g.: listcombo=list(list(list1[[1]],list2[[1]]),list(list1[[1]],list2[[2]]
2009 Oct 30
2
Names of list members in a plot using sapply
Hi R users: I got this code to generate a graphic for each member of a lists. list1<-list(A=data.frame(x=c(1,2),y=c(5,6)),B=data.frame(x=c(8,9),y=c(12,6))) names1<-names(list1) sapply(1:length(list1),function(i) with(list1[[i]],plot(x,y,type="l",main=paste("Graphic of",names1[i])))) Is there a more elegant solution for not to use two separate lists? I would like to
2012 Jun 19
1
Possible bug when using encomptest
Hello R-Help, ----------------------------------------------------------------------------------------------------------------------------------------- Issues (there are 2): 1) Possible bug when using lmtest::encomptest() with a linear model created using nlme::lmList() 2) Possible modification to lmtest::encomptest() to fix confusing fail when models provided are, in fact, nested. I have
2011 Feb 06
1
Applying 'cbind/rbind' among different list object
Hi, I am wondering whether we can apply 'cbind/rbind' on many **equivalent** list objects. For example please consider following: > list1 <- list2 <- vector("list", length=2); names(list1) <- names(list2) <- c("a", "b") > list1[[1]] <- matrix(1:25, 5) > list1[[2]] <- matrix(2:26, 5) > list2[[1]] <- 10:14 > list2[[2]] <-
2012 Apr 19
1
question about lists
I am new to R, and I have been running into the following situation when I mistype a variable name in some code: > list1 <- list( a=1, b=2 ) > list2 <- list( a=1 ) > list2$b <- list1$c > list2 $a [1] 1 I would think at the point where I am trying to reference a field called "c" -- that does not exist -- in list1, there would be an error flagged. Instead, list1$c
2004 Jan 24
1
loop variable passage and lists
I cannot understand why the following expression is accepted (and gives the expected result: to set column 3 and 4 of the first element of list1 -a data.frame list- as first element of list2): > list2[[1]]<-list1[[1]][3:4] ...while this one is not (to do the same iteratively from the first to the eleventh element of list1): > for (i in 1:11){list2[[i]]<-list1[[i]][3:4]} Error in