search for: subset

Displaying 20 results from an estimated 8907 matches for "subset".

2009 Feb 10
2
Bug in subsetting data frame (PR#13515)
Full_Name: Xin Lee Version: 2.8.0 OS: Windows XP Submission from: (NULL) (193.200.150.23) Dear developer I discover annoying bug in subsetting data frame. Here is reproducable examples: > data.frame <- data.frame(x = runif(5), y = runif(5), row.names = c('a','b','c','d','e') > subset <- data.frame['x'] > subset['a',] work > subset <- data.frame$x > sub...
2005 Nov 18
3
repeated %in%
Hi I have a list of vectors, each one of which should be a subset of the previous one. How do I check that this property actually holds? Toy problem follows with a list of length 4 but my list can be any length subsets <- list( l1 = 1:10 , l2 = seq(from=1,to=9,by=2), l3 = c(3,7), l4 = 3...
2008 Jul 07
3
subset() multiple arguments
This is what I would like to do and it works just fine. Is there a way to shorten this code so I don't have to subset a subset of a subset? d<-subset(subset(subset(subset(x, River.Mile<=202), River.Mile>3), Lagrangian=="Yes"), EventType=="Regular") Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for u...
2011 Nov 14
1
Subset of a subset?
Hi All- I have created a subset of my original csv for the times I am interested in (9, 12, 3). I have a subset for all of those times then each individually. I would like to have specific case studies to analyze individually for those times. For example, I want to look at 2009/06/01-2009/06/10. Is the easiest way to created a su...
2003 Aug 01
1
index all subsets of k of m items?
How can I efficiently index all choose(m, k) subsets of m items taken k at a time? For example, with (m, k) = (3, 2), the subsets are (1, 2), (1, 3), and (2, 3). I'd like a function something like "index.subsets(subset, k, m)" that would return 1, 2 or 3 for these 3 subsets. Examples: index.subsets(c(1,2), 2, 3) -> 1 index.s...
2005 Apr 28
2
Reconstruction of a "valid" expression within a function
Hello all, I have some trouble in reconstructing a valid expression within a function, here is my question. I am building a function : SUB<-function(DF,subset=TRUE) { #where DF is a data frame, with Var1, Var2, Fact1, Fact2, Fact3 #and subset would be an expression, eg. Fact3 == 1 #in a first time I want to build a subset from DF #I managed to, with an expression like eg. DF$Fact3, # but I would like to skip the DF$ for convenience # so I tried somethi...
2009 Jul 31
2
how use the subset?
hi ,everyone I want subtract some dataset by subset. >From the help running help(subset), ths information is "*subset(airquality, Day == 1, select = -Temp)* " while I running my script written as "*g1data<-subset(errdata, fac>12) *" ,it is wrong with the error information "*subset.default(newerrdata, fac>1...
2006 Oct 27
1
Using data and subset arguments in user-defined functions
Dear list, A while ago, I posted a question asking how to use data or subset arguments in a user-defined function. Duncan Murdoch suggested the following solution in the context of a data argument: data <- data.frame(a=c(1:10),b=c(1:10)) eg.fn <- function(expr, data) { x <- eval(substitute(expr), envir=data) return(mean(x)) }...
2009 Nov 21
3
"subset" or "condition" as argument to a function
Dear Rxperts! I was wondering if it is possible to write a function which can take in argument of a subset or condition.. Of course, I am aware of the alternate methods like coplot, par.plot, xyplot etc... I am specifically interested in using conditions/subsets with "plot".. A simple fragmented example is shown here.. pltit <- function(y,x,dat,dat1,dat2,sbst) { plot(y~x, data=dat, subset...
2023 Oct 21
1
Issue from R-devel: subset on table
My mistake! It does actually something else, which is incorrect. One could still use (although the code is more difficult to read): subset(tmp <- table(sample(1:10, 100, T)), tmp > 10) Sincerely, Leonard On 10/21/2023 10:26 PM, Leonard Mada wrote: > Dear List Members, > > There was recently an issue on R-devel (which I noticed only very late): > https://stat.ethz.ch/pipermail/r-devel/2023-October/082943.html &g...
2013 Feb 28
1
help for an R automated procedures
...data set and the script I have written to do that, sample by sample [ouch!])? Thanks in advance for your attention and all the best (ghcv@hotmail.com). [Bellow is an example is the codes I've used to accomplish my goals, sample by sample, which can exemplify the complexity of the procedures: #Subsetting the data (v1-v11 are continuous "predictors"): species 1 at locality 1 (all data [5520 cases] are on a vector called 'morfo') sp1.loc1<-morfo[which(spps=="sp1" & taxoc=="loc1"),] #getting only the observations of sp1 (species 1) at loc1 (locality 1)...
2003 Jun 19
2
Subseting by more than one factor...
Is it possible in R to subset a dataframe by more than one factor, all at once? For instance, I have the dataframe: >data p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 pred 1 0 1 0 0 0 0 0 0 0 0 0.5862069 4 0 0 0 0 0 0 0 0 0 1 0.5862069 5 0 0 0 0 0 0 1 0 0 0 0.5862069 6 0 0...
2009 Feb 05
3
subset problem (reducing from six to two levels)
Hi all, I have got a seemingly simple problem (I am an R starter) with subsetting my data set, but cannot figure out the solution: I want to subset a data set from six to two levels, so that all analyses are done only with these two remaining levels. I tried TOTAL<-read.delim('total.csv',header=T) SUBSET.OF.TOTAL<-subset(TOTAL, FactorX %in% c("Level1&quot...
2018 Dec 12
4
Subset dentro de un for
Muy buenas. Quiero hacer un loop en el que en cada iteración se hace un subset con el que se queda con las muestras para la que cierta variable es positiva. Si hago esto, sale bien: df2<-subset(df, subset = var1>0) Pero he probado así (y de no sé cuantas formas más), antes de hacer el for, y no sale: GT<- c("var1","var2", ? ) df2<-sub...
2012 Jan 21
4
Create subset using variable
I am trying to create a loop that will perform a series of analyses. I am using geeglm from geepack, which fails if there are any null values. Creating a subset solves this, but do not seem to be able to set the subset dynamically based on a changing variable. while (j <= y.num) { strSubset = as.character(df.IV$IV[j]) #Gives column name in quotes df.data.sub = subset(df.data, strSubset>=0) #subset dataset is not created # analyses o...
2010 Jun 09
1
counting across leves of factors
...ave maybe 5000 observation. And i need to do table where is in every raw 1 of possible combination of this factors and the numbur how many time is this combination in my dataset. I wrote one code, but this is very slow and dumb. it looks like this: i<-0 for(i1 in levels(hivdat$pohl)){ a<-subset(hivdat,hivdat$pohl==i1) for(i2 in levels(a$vekF)){ b<-subset(a,a$vekF==i2) for(i3 in levels(b$ekstF)){ c<-subset(b,b$ekst==i3) for(i4 in levels(c$zam)){ d<-subset(c,c$zam==i4) for(i5 in levels(d$saman)){ e<-subset(d,d$saman==i5) for(i6 in levels(e$test)){ f<-subset(e,e$test==i6) for(...
2014 Jan 06
2
Exact FLAC subset constraints
I mean that the first statement [Subset streams must use one of 192/576/1152/2304/4608/256/512/1024/2048/4096 (and 8192/16384 if the sample rate is >48kHz).] published on https://www.xiph.org/flac/documentation_tools_flac.html#flac_options_blocksize page IS NOT EQUAL to second statement [The blocksize bits in the frame header must be...
2007 Dec 20
1
custom subset method / handling columns selection as logic in '...' parameter
Dear R-helpers & bioconductor Sorry for cross-posting, this concerns R-programming stuff applied on Bioconductor context. Also sorry for this long message, I try to be complete in my request. I am trying to write a subset method for a specific class (ExpressionSet from Bioconductor) allowing selection more flexible than "[" method . The schema I am thinking for is the following: subset.ExpressionSet <- function(x,subset,...){ } I will use the subset argument for rows (genes), as in default method....
2009 Jan 20
5
Problem with subset() function?
Hi all, Can anyone explain why the following use of the subset() function produces a different outcome than the use of the "[" extractor? The subset() function as used in density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) appears to me from documentation to be equivalent to density(mydf[mydf$ht >= 150.0 & mydf$wt...
2009 Aug 24
2
Assigning value of subset argument in "subset" function
Dear R users, I am using "subset" function to filter out specific conditions and would like to use the value of subsetted argument as a name of an object. Specifically, from the following statement: a <- subset(dat, dat$x == "A" & dat$xx == 1 & dat$xxx == "AB" & dat$y == "B"...