d is faster.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Rainer
> Schuermann
> Sent: Friday, September 09, 2011 5:44 AM
> To: r-help@r-project.org;
Thank you very much :)
stat.kk
--
View this message in context:
http://r.789695.n4.nabble.com/Subset-function-tp3801397p3801626.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mai
No :(
I dont have a condition on variable but on row name. My data frame looks
like (from your example):
> x
xin xout
Peter1 14
Tom 8 5
Jane 16 884
Paul 114
Cathy 8 5
Rainer provided an example of subsetting by the value of a variable in the
data frame. Below is an example of subsetting by the value of the row
name of the data frame.
df <- data.frame(var1=1:10, var2=letters[1:10], var3=sample(10),
row.names=month.abb[1:10])
subset(df, subset = row.name
Does that help:
> x
xin xout
1 1 14
2 85
3 16 884
4 1 14
5 85
6 16 884
> subset( x, x$xin > 7, select = xout )
Hi,
can anyone help me how to use 'subset' function on my data frame?
I have created data frame 'data' with a few variables and with row names.
Now I would like to subset rows with concrete row names.
Using data[] I know how to do it. But I dont know how to formulate the
subset condition:
subset(
On Tue, 2 Feb 2010, David Katz wrote:
Thanks, that helps! Subset creates a new context where a name clash can
occur. So if I don't want to check for that possibility, I should use a
special kind of index like .sch, or avoid subset:
for(sch in school.list){
print(sch)
print(input.data[input.d
Thanks, that helps! Subset creates a new context where a name clash can
occur. So if I don't want to check for that possibility, I should use a
special kind of index like .sch, or avoid subset:
for(sch in school.list){
print(sch)
print(input.data[input.data[,school.var] == sch,])}
which work
Hi:
Try this for your second loop instead:
for(s in school.list){
print(s)
print(subset(input.data, sch == s))
}
[1] 1
sch pop
1 1 100
2 1 200
[1] 2
sch pop
3 2 300
4 2 400
Don't confound the 'sch' variable in your data frame with the
index in your loop :)
HTH,
Dennis
On Mon,
I was surprised to see this unexpected behavior of subset in a for loop. I
looked in subset.data.frame and it seemed to me that both versions should
work, since the subset call should be evaluated in the global environment -
but perhaps I don't understand environments well enough. Can someone
enli
On Tue, 14 Apr 2009, Andrew McFadden wrote:
Hi all
I know this must be an easy one so sorry for the trouble. I would like
to select a list of variables within a factor
The following example is given in help for subset:
subset(airquality, Temp > 80 select = c(Ozone, Temp))
So how do I select
Hi all
I know this must be an easy one so sorry for the trouble. I would like
to select a list of variables within a factor
The following example is given in help for subset:
subset(airquality, Temp > 80 select = c(Ozone, Temp))
So how do I select all temperatures of 90 and 80 ie Temp = c(80,9
I think that you can use split fot this,
see ?split
On Thu, Jul 3, 2008 at 6:25 PM, Lana Schaffer <[EMAIL PROTECTED]> wrote:
> Hi,
> I am using this subset statement and it works
> outside a function.
> LIS[[i]]<- lapply(LI, subset, select=cov[[i]])
> However, wrapped inside a function this stat
Hi,
I am using this subset statement and it works
outside a function.
LIS[[i]]<- lapply(LI, subset, select=cov[[i]])
However, wrapped inside a function this statement
produces the same values for every LIS[[1]] which
is only the first subset of LI.
Does anyone know why is not working correctly ins
14 matches
Mail list logo