[R] cannot base64decode string which is base64encode in R

2013-08-02 Thread Qiang Wang
Hi, I'm struggling with encode/decode strings in R. Don't know why the second example below would fail. Thanks in advance for your help. succeed: s <- "saf" x <- base64encode(s) y <- base64decode(x, "character") fail: s <- "safs" x <- base64encode(s) y <- base64decode(x, "character") [[al

Re: [R] cannot base64decode string which is base64encode in R

2013-08-04 Thread Qiang Wang
e5T"(\xe1\xbf\xce}\xc4C\x9b\xbb\x87\xdf\x9fl\xc9\xf8V\xcdqk6' Most part of the result is correct except several characters near the end. I don't know where the problem is. On Sat, Aug 3, 2013 at 3:49 PM, Enrico Schumann wrote: > On Fri, 02 Aug 2013, Qiang Wang writes: >

Re: [R] cannot base64decode string which is base64encode in R

2013-08-06 Thread Qiang Wang
aised from a web api which requires submitted strings to contain a null character. On Tue, Aug 6, 2013 at 1:43 AM, Enrico Schumann wrote: > On Mon, 05 Aug 2013, Qiang Wang writes: > > >> On Sat, Aug 3, 2013 at 3:49 PM, Enrico Schumann >wrote: > >> > >>> On Fri

[R] About the scope of a variable and the save() method

2012-09-29 Thread Qiang Wang
In the following test, the variable x is supposed to be modified within the function test.save.x. It works as expected util using the save command. # initialize x.file x <- 1 save(x, file="x.file") rm(x) # Remove x from R_GlobalEnv exists("x") # FALSE # define test test.save.x <- function(){ save