Re: [R] NROW doesn't equal length(x)

2011-11-01 Thread R. Michael Weylandt
mat = "%MM/%DD/% >> %H:%M:%:S") >> >> I would appreciate any help in converting this data frame into xts.  I am >> not sure is the NROW issue is the reason behind the failure or is it the >> data formate >> >> thanks >> >&

Re: [R] NROW doesn't equal length(x)

2011-11-01 Thread R. Michael Weylandt
this data frame into xts.  I am not > sure is the NROW issue is the reason behind the failure or is it the data > formate > > thanks > > > - Original Message - > From: "R. Michael Weylandt " > > To: Muhammad Abuizzah > Cc: "r-help@R-projec

Re: [R] NROW doesn't equal length(x)

2011-10-28 Thread MacQueen, Don
And to further the example, length() of matrix is not equal to the number of rows either. > mm <- matrix(1:6, ncol=2) > length(mm) [1] 6 > dim(mm) [1] 3 2 Also, NROW() and nrow() are different; I'd be cautious about using NROW without making sure I understood the difference. > NROW function (x)

Re: [R] NROW doesn't equal length(x)

2011-10-27 Thread R. Michael Weylandt
Data frame is list internally so length(df) = ncol(df) M On Oct 27, 2011, at 2:44 PM, Muhammad Abuizzah wrote: > Hi, > > I am converting a data.frame to xts. the data.frame is 4 columns and 1000 > rows. I get a message that "NROW (x) must match length(order.by) > class is data.frame, mode i

[R] NROW doesn't equal length(x)

2011-10-27 Thread Muhammad Abuizzah
Hi, I am converting a data.frame to xts.  the data.frame is 4 columns and 1000 rows.  I get a message that "NROW (x) must match length(order.by) class is data.frame, mode is list when I run  dim(x)   # I get  1000     4   #which is consistent with 1000 rows and 4 columns NROW (x)  # I get 1000

Re: [R] nrow()

2011-02-22 Thread Sandra Stankowski
Thanks. I made it! Best wishes, S. Am 22.02.2011 17:41, schrieb Erik Iverson: Sandra Stankowski wrote: is.na function does'nt seem to work, but maybe I'm just dealing with it in a wrong way. here's an example > m <- c(2, 3, 5, 6, 3, 7, -99, -99, 6) > n <- c(1,1,1,1,1,2,2,2,2) so my mat

Re: [R] nrow()

2011-02-22 Thread Sandra Stankowski
is.na function does'nt seem to work, but maybe I'm just dealing with it in a wrong way. here's an example > m <- c(2, 3, 5, 6, 3, 7, -99, -99, 6) > n <- c(1,1,1,1,1,2,2,2,2) so my matrix contains certain missing values > m[m==-99] <- NA > o <- data.frame(m, n) > o m n 1 2 1 2 3 1 3 5 1

Re: [R] nrow()

2011-02-22 Thread Erik Iverson
Sandra Stankowski wrote: is.na function does'nt seem to work, but maybe I'm just dealing with it in a wrong way. here's an example > m <- c(2, 3, 5, 6, 3, 7, -99, -99, 6) > n <- c(1,1,1,1,1,2,2,2,2) so my matrix contains certain missing values Thank you for the example. You're construct

Re: [R] nrow()

2011-02-22 Thread Mohamed Lajnef
Hi Sandra, What about ?is.na function ? Hope this help Regards, ML Le 22/02/11 16:11, Sandra Stankowski a écrit : > NROW(data[jan,16] != NaN) -- Mohamed Lajnef,IE INSERM U955 eq 15# Pôle de Psychiatrie# Hôpital CHENEVIER

Re: [R] nrow()

2011-02-22 Thread Peter Ehlers
?is.nan Peter Ehlers On 2011-02-22 07:11, Sandra Stankowski wrote: Hey there, I tried to count the number of rows, where my data isn't NaN in a certain column. this was my guess: (given is a data frame with 2069 rows and 17 cols) NROW(data[jan,16] != NaN) ("jan" is defined this way: jan<-

Re: [R] nrow()

2011-02-22 Thread Erik Iverson
Sandra, Please provide a small, reproducible example of this issue. You probably want to use ?is.nan and not the inequality operator. Similar example, contrast: x <- NA is.na(x) x == NA Sandra Stankowski wrote: Hey there, I tried to count the number of rows, where my data isn't NaN in a cer

[R] nrow()

2011-02-22 Thread Sandra Stankowski
Hey there, I tried to count the number of rows, where my data isn't NaN in a certain column. this was my guess: (given is a data frame with 2069 rows and 17 cols) NROW(data[jan,16] != NaN) ("jan" is defined this way: jan <- which(data[,2]==1, arr.ind= TRUE)) but I only get the number of c