similar to: Cause of Error 1:nrow(X) : argument NA / NaN

Displaying 20 results from an estimated 300 matches similar to: "Cause of Error 1:nrow(X) : argument NA / NaN"

2007 Apr 24
0
Bug in xYplot() with method = 'filled bands'
Dear r-helpers, I have been bitten by a cryptic comment in the help page for xYplot(). Here is some code from Madeline Bauer, one of the authors, which is essentailly the code on the help page for xYplot(): # This example uses the summarize function in Hmisc to # compute the median and outer quartiles. The outer quartiles are # displayed using "filled bands" set.seed(111) dfr
2005 May 13
5
Conflict between xtable and Hmisc when using Sweave?
Dear R users, The Sweave code below runs fine, as it is. However, an error occurs when the line 'library(xtable)' is uncommented: Error: chunk 1 Error in "label<-"(`*tmp*`, value = "month") : no applicable method for "label<-" Is anybody aware of this and knows a workaround? Thanks, Sander. *******************
2007 Jun 16
2
Visualize quartiles of plot line
Hello, I'm currently using a simple plot to visualize some mean values. I'm having ~200 datapoints on the x-axis, each has 10 records. I'm currently plotting only the mean value of each of the datapoints. What I need is a way to visualize the quartiles/error/whatever of these points. I thought about boxplots, but I have to many points on the xaxis - it would be impossible to see
2008 Dec 06
0
Inversing a non-monotonic spline
I have developed a GAM model in order to predict Y using 4 X variables. 2 of these X's are factors, and 1 is a spline. Part of the data looks like: Days WRM variety PWM O_EC 31 75 1 90 234 31 79 1 78 283 31 82 1 92 281 31 84 1 96 213 31 99 2 69 247 31 100 2 77 324 31 104 2 74 259 31 118 2 81 282 31 61 3 58 478 31 98 3 83 429 31 98 3 70 379 31 156 3 87 467 31 78 4 56 283 31 97 4 67 282 31
2010 Jul 25
0
Redefine NROW and NCOL to be compatible with nrow and ncol for S3 classes with own dim function?
Dear R-developers, I am currently trying to develop a package with some customized container classes and found an issue with the functions NROW and NCOL. I guess that I can simply work around the problem by redefining these functions in my own package (Yet, I do not know whether that will work cleanly everywhere). Nevertheless, I thought that perhaps one might think about to redefine these
2006 May 30
2
Help with adding minutes to time
Dear R Helpers, I need to read time from a .csv file which is formated as chartime (09:12:00) below. I need to add one minute (cf chartime2). Then I need to output the value just as 09:13 without the seconds for writing a csv file and input in another program. I get it with the following reproducible example but I can't help thinking that there must a less clumsy way to do that ! Thanks
2012 Oct 09
2
Error in matrix (unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, : attempt to set an attribute on NULL
I am using Donlp2 package to solve a non-linear problem, but there's an error I always meet: Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, : attempt to set an attribute on NULL I have been suffering from this bug for a long time. I'll be very grateful if somebody could help me -_- -- View this message in context:
2011 Feb 01
1
kmeans: number of cluster centres must lie between 1 and nrow(x)
Dear R, Can't I cluster a dataset into k clusters where k is exactly the number of observations? I have version 12.2 installed. See this example > a <- matrix(1:100, 20) > kmeans(a, 20) Error: number of cluster centres must lie between 1 and nrow(x) This is a bit ad-hoc but I known R from version 2.12 allows number of clusters to be one. So I guess allowing number of clusters to be
2001 Jun 01
1
v matrix of svd(X) loses dimensions if nrow(X)==1 (PR#963)
Dear R-developers I'm not very sure whether this is really a bug and not a feature: > is.matrix(svd(matrix(1:12,nrow=1))$v) [1] FALSE In all other cases the $v component is a matrix. Also, the $u component always seems to be a matrix as indicated in the doc. My R-version: > version _ platform i686-pc-linux-gnu arch i686 os linux-gnu
2004 Mar 06
3
as.matrix(1:10,nrow=1) not work (PR#6650)
Full_Name: Xiong Guanglei Version: 1.8.1 OS: Linux Submission from: (NULL) (202.38.103.50) > as.matrix(1:10,nrow=1) Error in as.matrix(1:10, nrow = 1) : unused argument(s) (nrow ...)
2019 May 17
0
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
>>>>> Gabriel Becker >>>>> on Thu, 16 May 2019 15:47:57 -0700 writes: > Hi Hadley, > Thanks for the counterpoint. Response below. > On Thu, May 16, 2019 at 1:59 PM Hadley Wickham <h.wickham at gmail.com> wrote: >> The existing behaviour seems inutitive to me. I would consider these >> invariants for n vector
2011 Feb 22
3
nrow()
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 columns where my data is "1" in the second col. R isn't removing the
2009 Mar 17
1
- help - predicting with glmnet/lars for dataframes with different nrow then the train set
Hello I'm having trouble using lars and glmnet functions to predict on a new data set with different nrow then the original : for instance: ============= log.1 = glm(temp.data$TL~(.),temp.data,family = binomial,x=TRUE,y=TRUE) nrow(test.data) != nrow(temp.data # == TRUE Val.frame = model.frame(log.1,test.data) # returns a data frame with the variables needed to use log.1
2008 Mar 14
2
using nrow to identify one row
Hi fellow R-users, I have run into a problem when trying to identify the number of rows in a matrix. Say we have an arbitrary 5 by 5 matrix called temp: temp <- matrix(norm(25), nrow=5) The problem is that nrow(temp[1,]) returns NULL. I would like it to return 1 because in my larger program I am indexing the rows of large matrices according to another variable and I need to test when the
2019 May 16
0
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
The existing behaviour seems inutitive to me. I would consider these invariants for n vector x_i's each with size m: * nrow(rbind(x_1, x_2, ..., x_n)) equals n * ncol(rbind(x_1, x_2, ..., x_n)) equals m Additionally, wouldn't you expect rbind(x_1[i], x_2[i]) to equal rbind(x_1, x_2)[, i, drop = FALSE] ? Hadley On Thu, May 16, 2019 at 3:26 PM Gabriel Becker <gabembecker at
2010 Mar 17
2
Using nrow with summaryBy
Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to use nrow(), but this doesn't appear to be working I'm able to replicate the same results with an example from the summaryBy docs:
2012 Feb 04
1
RFC: Proposal to make NROW() and NCOL() slightly more general
The help has > Description: > 'nrow' and 'ncol' return the number of rows or columns present in 'x'. > 'NCOL' and 'NROW' do the same treating a vector as 1-column matrix. and > x: a vector, array or data frame I'm proposing to extend these two convenience functions to also work ``correctly'' for generalized versions of
2023 Sep 23
2
NROW and NCOL on NULL
Dear list, I do not know what would be the 'correct' answer to the following but I think that they should return the same value to avoid potential problems and hard to debug errors. Regards, Simone --------------------------------------- > NCOL(NULL) [1] 1 > NROW(NULL) [1] 0 > sessionInfo() R version 4.3.1 RC (2023-06-08 r84523 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit)
2011 Feb 02
1
pass nrow(x) to dots in function(x){plot(x,...)}
Dear Rers, I have a function to barplot() a matrix, eg myfun <- function(x, ...) { barplot(x , ... )} (The real function is more complicated, it does things to the matrix first.) So I can do: m1 <- matrix(1:20,4) myfun(m1) myfun(m1, main="My title") I'd like to be able to add the number of rows of the matrix passed to the function to the "..." argument, eg
2019 May 16
0
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Hi Gabe, ? ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C"))) ? # [1] 2 ? ncol(data.frame(aa="a", AA="A")) ? # [1] 2 ? ncol(data.frame(aa=character(0), AA=character(0))) ? # [1] 2 ? ncol(cbind(aa=c("a", "b", "c"), AA=c("A", "B", "C"))) ? #