Message-ID: <1386727436255-4681987.post@n4.nabble.com>
Date: 2013-12-11T02:03:56Z
From: Long Vo
Subject: Splitting a vector
In-Reply-To: <1386651093.85766.YahooMailNeo@web142605.mail.bf1.yahoo.com>
This does what I needed. However, as the output is a list object, is there
any way to apply a function to such object? For example if I want to compute
the mean for the 4th subvectors, I can't simply use:
#####
Y=split(X,as.numeric(gl(length(X),3,length(X))))
mean(Y[4])
#####
as the error message shows "argument is not numeric or logical"
--
View this message in context: http://r.789695.n4.nabble.com/Splitting-a-vector-tp4681930p4681987.html
Sent from the R help mailing list archive at Nabble.com.