search for: subsets

Displaying 20 results from an estimated 8864 matches for "subsets".

Did you mean: 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
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 ) I need all(subsets[[4]] %in% subsets[[3]]) & all(subsets[[3]] %in% subsets[[2]]) & all(subsets[[2]] %in% subsets[[1]]) I can writ...
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
2011 Nov 14
1
Subset of a subset?
...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 subset of ss? I haven't been able to figure out the easiest way since I created by subsets based on the hour. Thanks for any help!! da=paste(Date) tiso= strptime(da,format="%d/%m/%Y %H:%M") tiso$h df1= data.frame(tiso, mv) ## creating a subset of 9am, 12pm and 3pm. ss= subset(mv, tiso$h==9| tiso$h ==12| tiso$h==15) ss9= subset(mv, tiso$h==9) ss12= subset(mv, tiso$h==12) ss...
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.su...
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
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>12),can not find fac*" and g1 in read
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)) } eg.fn(a,data) I've
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=sbst) lines(y~x,data=dat1, subset=subst) points(y~x,data=dat2,subset=subst) } pltit(profit,weeks,dat=zone1, sbst='group==1&sales>200') Cou...
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): >
2013 Feb 28
1
help for an R automated procedures
Dear, I would like to post the following question to the r-help on Nabble (thanks in advance for the attention, Gustavo Vieira): Hi there. I have a data set on hands with 5,220 cases and I'd like to automate some procedures (but I have almost no programming knowledge). The data has some continuous variables that are grouped by 2 others: the name of species and the locality where they were
2003 Jun 19
2
Subseting by more than one factor...
...(data,p4 == 1 && p6 == 1) or subset(data,p4==1 & p6==1). But it didn't work. Then I found a clumsy way to do it : subset(subset(data,p4==1),p6==1) Which works. But it soon gets very clumsy as the number of conditions increase (I end up with a really large number of nested subsets). Is there a simpler way to do that? --
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","Level2"))
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<-subset(df,
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,
2010 Jun 09
1
counting across leves of factors
I have dataframe with 17factors variables (for example every factor have 3levels) I have 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)){
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 0001-1110. The blocksize must be <=16384; if the sample
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:
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 <= 150.0, "age"])
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" & dat$yy == 2) I would to assign the value of the 3rd