search for: list3

Displaying 20 results from an estimated 20 matches for "list3".

Did you mean: list
2010 Feb 26
3
Preserving lists in a function
...the function codes below into R: myfunction=function( list1=list (variable1=1, variable2=2, variable3=3), list2=list (variable1="variable1", variable2="variable2", variable3="variable3"), list3=list (variable1="character", variable2=24, variable3=c(0.1,0.1,0.1,0.1), variable4=TRUE)) {return(list(list1=list1,list2=list2,list3=list3))} By definition, the values associated with each variable in the lists would be the default unless...
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 for list1 and list3, and .center for list2. i then added the appropriate accept options to my sortables code. seems...
2011 Feb 08
2
Extrcat selected rows from a list
...of 14000 selected rownames  from List 1 Now, I want to extract all the 104 columns of List1  matching with the 14000 selected rownames from List2.  Psedocode will be something like this: match rownames(List2) with rownames(List1) extract selected matched 104 coloumns from (List1) strore in-> List3 So the resulting List3 will contain 14,000 rows and 104 coloumns. How do I do it in R ? Regards, P Barah Department of Biology, Norwegian University of Science & Technology (NTNU)  Realfagbygget, N-7491 Trondheim, Norway [[alternative HTML version deleted]]
2004 Jun 02
1
How to iterate through two objects of class "list" fast?
...e data (list1) the second list2 contains the e.g linear model for each element of list 1. list2 <- lapply(list1,mylm,response) I obtain list 2 by something like this. now I have a function myfunc which takes an element from list1 and the coresponding element from list2 does something and .... list3[[x]] <- myfunc(list1[[x]],list2[[x]]) Until now I am runnign this in a for(x in 1:length(list1)) loop. But "for" loops are slow especially if list3 is HUGE. What can I do? Sincerely Eryk
2012 Oct 10
7
multiple t-tests across similar variable names
Hi everyone- I have a dataset with multiple "pre" and "post" variables I want to compare. The variables are named "apple_pre" or "pre_banana" with the corresponding post variables named "apple_post" or "post_banana". The variables are in no particular order. apple_pre orange_pre orange_post pre_banana apple_post post_banana person_1
2005 Jul 21
1
again, a question between R and C++
Dear R Users, I want to make a call from R into C++. My inputs are List1, List2, List3, IntegerID. The amount of elements of the lists and their type depend on IntegerID. Typical elements of a given list can be vectors, doubles, and even other lists. I want to return also a list (whose nature will depend also, possibly, on IntegerID). What I want to do is to call these 4 inputs from...
2006 Mar 03
13
Listing help
Hi, I''ve created a Rails application and am having a problem listing by a particular category in an associated table. I followed the instructions found at the O''Reilly tutorial (http://www.onlamp.com/pub/a/onlamp/2005/03/03/rails.html?page=3) but have not had success. Can anyone please outline a better set of instructions than in the "Showing Recipes in a
2012 Jul 05
2
vector entry in matix
hi, i'm trying to figure out if there's any possibility to write a whole vector into a matrix or data.frame or something like that. i don't mean transormation. Here an example: [,1] [,2] [1,] "a" "d" [2,] "b" "e" [3,] "c" "f" where e.g. a is a<-c(0,1) vector of length 2, b a vector of length 4,... (i know that
2002 Oct 14
1
Question: concatenating lists
...t size. How do I combine the lists to get a new list such that each component of this list contains the components of the individual lists? An example may explain most clearly what I need. Suppose I have three lists: list1 <- list(a=1:2,b=matrix(1,2,2)) list2 <- list(a=3:5,b=matrix(-1,3,3)) list3 <- list(a=6:9,b=matrix(5,4,4)) The result should give me something like: $a: [,1] [,2] [,3] [1,] 1 3 6 [2,] 2 4 7 [3,] NA 5 8 [4,] NA NA 9 $b: , , 1 [,1] [,2] [,3] [,4] [1,] 1 1 NA NA [2,] 1 1 NA NA [3,] NA NA NA NA [4,...
2004 Feb 04
5
Date Time Conversion problems...
...3,1/13/2003,TIDEA,1005.36 "Way, Shawn",1/2/2003,AP15043,1/2/2003,1/9/2003,JS ,1000 "Vo, Hoang",1/7/2003,SO17440,1/8/2003,12/31/2003,USFi-,3705 "Harrold, Paul",1/10/2003,AP15122,1/13/2003,1/14/2003,FishM,65.06 Old Code: library(lattice) data <- read.csv("h:\\list3.csv",header=TRUE) data2 <- data.frame(Name=data$UserName,Date=data$RequestDate,Vendor=data$Vendor,Cost= data$Total) data2$Date <- strptime(as.character(data2$Date),format="%m/%d/%Y") start <- strptime(c("1/01/2003"),format="%m/%d/%Y") end <- strptime(c...
2009 Oct 12
1
Creating object referant from argument name
Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something<-function(input){ id<-substring(input,3,3) j<-list1 if(id==2)j<-list2 if(id==3)j<-list3 if(id==4)j<-list4 ...} Instead of all these if() arguments, I was hoping to use something like: j<-paste("list",substring(input,3,3),sep="") but this just assigns j the value of "listx" of _character_ mode, instead of the actual object 'listx'. Is there...
2014 Mar 06
1
Create dataframe in C from table and return to R
...(lsnm,0,mkChar("int")); SET_STRING_ELT(lsnm,1,mkChar("string")); for ( i = 0 ; i < 3; i++ ) { SET_STRING_ELT(dfStr,i,mkChar(ab[i])); INTEGER(dfint)[i] = sn[i]; } SET_VECTOR_ELT(df,0,dfint); SET_VECTOR_ELT(df,1,dfStr); setAttrib(df,R_NamesSymbol,lsnm); //PROTECT(dfm=LCONS(dfm,list3(dfm,R_MissingArg,mkFalse()))); UNPROTECT(4); dfm = PROTECT(lang2(install("data.frame"),df)); SEXP res = PROTECT(eval(dfm,R_GlobalEnv)); UNPROTECT(2) } ------------------------------------------------------------------------ It works fine but i want it the other way the output is pri...
2011 Dec 28
3
transparency using plot+points with sp classes
How can I make one point graphics with transparency These are all sp classes: plot(polygons_area,axes=TRUE,asp=1.5,main="Title",xlab="Latitude", ylab="Longitude") points(observations2000,type = "p",pch=21,col="green") points(observation1999,type = "p",pch=21,col="blue") points(reference.points,type =
2007 May 16
2
substitute "x" for "pattern" in a list, while preservign list "structure". lapply, gsub, list...?
I am experimenting with some of the common r functions. I had a question re:using "gsub" (or some similar functions) on the contents of a list. I want to design a function that looks at "everything" contained din a list, and anytime it finds the text string "pattern" replace it with "x". I also wish to preserve the "structure" of the original
2012 Aug 01
4
apply function over same column of all objects in a list
Hello. Please forgive me if this problem has already been posted (and solved) by someone else ... I can't find it anywhere though it seems so very basic. Here it is: I have a list comprised of several matrices, each of which has two columns. > list [[1]] [,1] [,2] [1,] 1 3 [2,] 2 4 [[2]] [,1] [,2] [1,] 5 7 [2,] 6 8 [[3]] [,1] [,2]
2004 Jun 23
5
assigning from multiple return values
I know that if I have a function that returns multiple values, I should do return(list(foo, bar)). But what do I do on the recieving end? fn <- function(x) { return(list(foo, bar)) } I know that at this point I could say values.list <- fn(x) and then access values.list[1] values.list[2] But that's hideous. I'd rather be able to say something like list(local_foo, local_bar)
2013 Feb 19
1
data format
Hi, Try this: el<- read.csv("el.csv",header=TRUE,sep="\t",stringsAsFactors=FALSE) ?elsplit<- split(el,el$st) ? datetrial<-data.frame(date1=seq.Date(as.Date("1930.1.1",format="%Y.%m.%d"),as.Date("2010.12.31",format="%Y.%m.%d"),by="day")) elsplit1<- lapply(elsplit,function(x)
2012 Jul 02
4
Assigning a vector to every element of a list.
I have a vector d of unknown length, and a list b of unknown length. I would like to replace every element of b with d. Simply writing b<-d does not work as R tries to fit every element of d to a different element of d, and b<-rep(d,length(b)) does not work either as it makes a list of length length(d)*length(b) not a list of length(b). I know how to do this with a for loop, but I feel that
2009 Apr 15
6
Intersection of two sets of intervals
Hi, Algorithm question: I have two sets of "intervals", where an interval is an ordered pair [a,b] of two numbers. Is there an efficient way in R to generate the intersection of two lists of same? For concreteness: I'm representing a set of intervals with a data.frame: > list1 = as.data.frame(list(open=c(1,5), close=c(2,10))) > list1 open close 1 1 2 2 5
2016 Aug 18
5
[PATCH v2 0/4] New getprogname module
Hi, as discussed in [1], this series adds a new getprogname module. All it does is providing a getprogname function, much like what is found on e.g. *BSD systems, and using it in gnulib instead of progname. Also, using it explicitly by modules avoids gnulib users the need of either use the progname module (GPL), or to provide program_name (and call set_program_name manually, which is not always