similar to: as.matrix.data.frame() in R 1.9.0 converts to character when it should (?) convert to numeric

Displaying 20 results from an estimated 3000 matches similar to: "as.matrix.data.frame() in R 1.9.0 converts to character when it should (?) convert to numeric"

2002 Oct 09
1
problems with missing values created by conversion using as.matri (PR#2130)
> version _ platform sparc-sun-solaris2.8 arch sparc os solaris2.8 system sparc, solaris2.8 status major 1 minor 6.0 year 2002 month 10 day 01 language R
2005 Oct 25
2
strptime problem for 2004-10-03 02:00:00
Hello, I at first thought this was a system or locale issue, but since it occurs on both Windows and Linux and only for 2004 (AFAIK) I report it. I have a problem with as.POSIXct for the hour between "2004-10-03 02:00:00 GMT" and "2004-10-03 02:59:59 GMT". In short, the 2 AM (GMT) hour in 2004 (but not in other years) is interpreted as 1 AM by strptime: (I use ISOdatetime
2009 Oct 14
1
using mapply to avoid loops
Hello, I would like to use mapply to avoid using a loop but for some reason, I can't seem to get it to work. I've included copies of my code below. The first set of code uses a loop (and it works fine), and the second set of code attempts to use mapply but I get a "subscript out of bounds" error. Any guidance would be greatly appreciated. Xj, Yj, and Wj are also lists, and s2,
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time starts. If I type (on R 1.8.1 on Gentoo Linux) > ISOdatetime(2004,4,4,0:4,0,0,"GMT") [1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST" [3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST" [5] "2004-04-03 23:00:00 EST" Giving the times
2009 Jan 19
1
maptools, sunriset, POSIX timezones
Hi ... I wonder if anyone can provide some insight into why the first three examples using the sunriset function (appended below, with results) give the correct answer, but the fourth generates and error. The first two use ISOdatetime with and without a time zone attribute, and the sunriset function returns the correct sunset time. The third and fourth adds 10 seconds to the ISOdatetime
2003 Oct 02
3
Query: weighting cells in histogram
I have the 'breaks' for the histogram ('hist') but I want weight the cells instead of using actual observations. I thought that using freq=FALSE implied that the numbers in 'x' were weights but this turned out to be wrong. Any help and/or comment is very much appreciated. Regards, M?rten M?rten Bjellerup Doctoral Student in Economics School of Management and Economics
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster for subscripting rows of large data frames; it avoids calling duplicated(rows) if there is no need to check for duplicate row names, when: i is logical attr(x, "dup.row.names") is not NULL (S+ compatibility) i is numeric and negative i is strictly increasing "[.data.frame" <- function (x, i, j,
2010 Apr 02
1
POSIX primer
I have not used POSIX classes previously and now have a need to use them. I have sports data with times of some athletes after different events. I need to perform some simple analyses using the times. I think I've figured out how to do this. I just want to confirm with others who have more experience that this is indeed the correct approach. If not, please suggest a more appropriate way.
2004 Jun 23
1
problem with tilde expansion in install.packages
In R 1.9.0 on Solaris/Sparc when I run, for example, install.packages("gregmisc", "~/R-local/lib"), instead of installing the `gregmisc' package in the directory /users/student/rpeng/R-local/lib the package gets installed in /users/student/rpeng/\~/R-local/lib, so the directory \~ is created in my home directory. This doesn't happen to me on Linux or Windows so I
2005 Jul 21
3
Rprof fails in combination with RMySQL
Dear R community, I tried to optimized my R code by using Rprof. In my R code I'm using MySQL database connections intensively. After a bunch of queries R fails with the following error message: Error in .Call("RS_MySQL_newConnection", drvId, con.params, groups, PACKAGE = .MySQLPkgName) : RS-DBI driver: (could not connect mylogin@mydatabase on dbname "myDB"
2017 Dec 01
1
Bug is as.matrix.data.frame with nested data.frame
Converting a data.frame with a nested data.frame to a matrix fails: x <- structure(list(a = data.frame(letters)), class = "data.frame", row.names = .set_row_names(26)) as.matrix(x) #> Error in ncol(xj) : object 'xj' not found The offending code is here, in the definition of as.matrix.data.frame (source/base/all.R): for (j in pseq) {
2009 Jul 02
1
help exporting to excel via xlsReadWritePro
I’m trying to export a file from R to excel using the xlsReadWritePro function and I keep getting the error below. I get the same error when I use the oledatetime function. My current date format is mm/dd/yyyy, which is how I want it in excel. Also is there anyway to export different datasets to multiple sheets similar to the ods function in SAS? <?xml:namespace prefix = o ns =
2009 Oct 29
3
Weird error: Error in xj[i] : invalid subscript type 'list'
I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] : invalid subscript type 'list'
2002 Mar 26
1
seq.POSIXt() with short time intervals
I was surprised when seq.POSIXt() returned a single value rather than a vector, from inputs that I thought were reasonable. Here's an example to illustrate: > t0 <- ISOdatetime(2002,6,24,0,0,10) ## expected a sequence of 16 times 1 second apart > seq.POSIXt(from=t0,to=t0+15,by='1 sec') [1] "2002-06-24 00:00:10 PDT" ## traces to this call >
2004 Mar 26
4
cbind/rbind fail on matrixes containing lists (PR#6702)
Today's R 1.9.0 beta: > m1 [,1] [,2] [,3] [,4] [1,] NA NA NA NA [2,] NA NA NA NA [3,] NA NA NA NA [4,] NA NA NA NA > class(m1[1,1]) [1] "list" > cbind(m1,m1) Error in cbind(...) : cannot create a matrix from these types > rbind(m1,m1) Error in rbind(...) : cannot create a matrix from these types > version _
2006 Oct 17
2
CTRL-C behaviour with RODBC on Solaris2.8
After loading the RODBC package version 1.1-7, Ctrl-C changes its behaviour and is quitting R and returning to the (unix-)command prompt on the solaris2.8 platform here. Here's what happened before and after loading RODBC > for (i in 1:10^5) rnorm(10) ^C > library(RODBC) > for (i in 1:10^5) rnorm(10) ^C bash-3.00$ platform sparc-sun-solaris2.8 arch
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function. The current implementation has two problems: 1. It doesn't check if a name matches an R keyword (like "function"). 2. The uniqueness algorithm is not invariant to concatenation. In other words, make.names(c("a","a","a"),unique=T) !=
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function. The current implementation has two problems: 1. It doesn't check if a name matches an R keyword (like "function"). 2. The uniqueness algorithm is not invariant to concatenation. In other words, make.names(c("a","a","a"),unique=T) !=
2009 Nov 04
4
unexpected results in comparison (x == y)
Dear readers of the list, I have a problem a comparison of two data from a vector. The comparison yields FALSE but should be TRUE. I have checked for mode(), length() and attributes(). See the following code (R2.10.0): ----------------------------------------------- # data vector of 66 double data X =
2017 Oct 09
1
Using response variable in interaction as explanatory variable in glm crashes R
>>>>> Jan van der Laan <rhelp at eoos.dds.nl> >>>>> on Fri, 6 Oct 2017 12:13:39 +0200 writes: > It is actually model.matrix that crashes, not glm. Same > crash occurs with e.g. lm. > model.matrix(dob_mon ~ dob_day*dob_mon, data = tab) > also crashes R. Yes, segmentation fault. It only happens when these are *logical*