Re: [R] as(, "numeric") vs as.numeric()

2016-02-01 Thread Erik Wright
function." But clearly the result is different in each case. If the help for as() is correct, then as(1:10, "numeric") should also return doubles, and the second argument is not ignored. Erik > On Feb 1, 2016, at 8:16 AM, Franklin Bretschneider wrote: > > Dear Erik

[R] as(, "numeric") vs as.numeric()

2016-02-01 Thread Erik Wright
Hi everyone, Could someone please explain this R behavior to me: > typeof(as.numeric(1:10)) [1] "double" > typeof(as(1:10, "numeric")) [1] "integer" I expected "double" in both cases. In the help for the "as" function it says: "Methods are pre-defined for coercing any object to one of the basi

[R] Building R on RHEL 5

2012-01-20 Thread Erik Wright
Hello, I am trying to upgrade to the latest R release on a machine running Red Hat el5.  Previously I was successful at building R 2.11, but now I am having troubles with R 2.14. Configure goes fine, but then make throws a lot of errors (output below).  Any idea what I am doing wrong this time

[R] Non-negative least squares for sparse matrix

2011-07-14 Thread Erik Wright
Hello, I am attempting to solve the least squares problem Ax = b in R, where A and b are known and x is unknown. It is simple to solve for x using one of a variety of methods outlined here: http://cran.r-project.org/web/packages/Matrix/vignettes/Comparisons.pdf As far as I can tell, none of th

Re: [R] Compress string memCompress/Decompress

2010-07-12 Thread Erik Wright
Hi Seth, Can you recreate the example below using dbWriteTable? Thanks!, Erik On Jul 11, 2010, at 6:13 PM, Seth Falcon wrote: > On Sun, Jul 11, 2010 at 11:31 AM, Matt Shotwell wrote: >> On Fri, 2010-07-09 at 20:02 -0400, Erik Wright wrote: >>> Hi Matt, >>> &

Re: [R] Compress string memCompress/Decompress

2010-07-09 Thread Erik Wright
ob >> query <- paste("INSERT INTO Compress (id, data) VALUES (1, ", > + string.sqlite, ");", sep="") >> dbGetQuery(con, query) > NULL > >> #recover the blob, decompress, and convert back to a string >> result <- dbGetQuery(con, &q

[R] Compress string memCompress/Decompress

2010-07-09 Thread Erik Wright
Hello, I would like to compress a long string (character vector), store the compressed string in the text field of a SQLite database (using RSQLite), and then load the text back into memory and decompress it back into the the original string. My character vector can be compressed considerably

Re: [R] .Call function crashes initializing matrix

2010-04-11 Thread Erik Wright
** set a breakpoint in malloc_error_break to debug Any idea why this is happening? Thanks again!, Erik On Apr 10, 2010, at 5:35 PM, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behal

[R] .Call function crashes initializing matrix

2010-04-10 Thread Erik Wright
Hello, I have a C function that I call from R using .Call. I recently discovered a bug in my code, and I am not sure if it is a problem with what I am doing in C or if it has something to do with my use of .Call. I have narrowed my problem down to these two C statements: int size = 5000; doubl

Re: [R] Rprintf not updating

2010-04-05 Thread Erik Wright
in, Erik On Apr 5, 2010, at 4:00 PM, Sharpie wrote: > > > Erik Wright wrote: >> >> Hi Charlie, >> >> I like your idea of updating an R progress bar from C, but I don't at all >> understand how to call txtProgressBar from C. I have looked at Writ

Re: [R] Rprintf not updating

2010-04-05 Thread Erik Wright
wrote: > > > Erik Wright wrote: >> >> Hello all, >> >> I am using Rprintf in a C for loop (from .Call) to print a progress >> indicator showing the current percent complete. The loop I am doing is an >> time intensive call to another function. I ha

[R] Rprintf not updating

2010-04-05 Thread Erik Wright
Hello all, I am using Rprintf in a C for loop (from .Call) to print a progress indicator showing the current percent complete. The loop I am doing is an time intensive call to another function. I have noticed that Rprintf does not print to the R-window until the entire loop has been completed.