)[1]}))
Hope this helps,
Josh
On Thu, Mar 10, 2011 at 5:11 PM, Aaron Polhamus aaronpolha...@gmail.com
wrote:
Dear list,
I couldn't find a solution for this problem online, as simple as it
seems.
Here's the problem:
#Construct test dataframe
tf - data.frame(1:3,4:6,c
Dear list,
I couldn't find a solution for this problem online, as simple as it seems.
Here's the problem:
#Construct test dataframe
tf - data.frame(1:3,4:6,c(A,A,A))
#Try the apply function I'm trying to use
test - apply(tf,2,function(x) if(is.numeric(x)) mean(x) else unique(x)[1])
#Look at
, for
whatever reason R doesn't read it that way. I would be very grateful for any
advice on how I can either alter my approach entirely (I am sure there is a
far more elegant way to regrid data in R) or a simple fix for this rounding
error.
Many thanks in advance,
Aaron
--
Aaron Polhamus aaronpolha
Greetings,
My goal is to create a Markov transition matrix (probability of moving from
one state to another) with the 'highest traffic' portion of the matrix
occupying the top-left section. Consider the following sample:
inputData - c(
c(5, 3, 1, 6, 7),
c(9, 7, 3, 10, 11),
c(1, 2, 3,
),]
For the second, I don't know!
HTH,
Ivan
Le 12/2/2010 09:46, Aaron Polhamus a écrit :
Greetings,
My goal is to create a Markov transition matrix (probability of moving
from
one state to another) with the 'highest traffic' portion of the matrix
occupying the top-left section
5 matches
Mail list logo