Re: [R] Parsing "back" to API strcuture

2012-09-17 Thread Eric Fail
Problem solved by Josh O'Brien on stackoverflow, http://stackoverflow.com/questions/12393004/parsing-back-to-messy-api-strcuture/12435389#12435389 some_magic <- function(df) { ## Replace NA with "", converting column types as needed df[] <- lapply(df, function(X) { if(any(i

Re: [R] Parsing "back" to API strcuture

2012-09-13 Thread Eric Fail
Dear Jim, Thank you for your response I appreciate your effort! It is close, I must admit that. What I am looking for is an object that is identical to 'RAW.API,' or at least in the stricture (I guess i do not need the ","`Content-Type`" = structure(c("text/html", "utf-8"), .Names = c("", "charse

Re: [R] Parsing "back" to API strcuture

2012-09-12 Thread jim holtman
This is close, but it does quote the header names, but does produce the same dataframe when read back in: > RAW.API <- > structure("id,event_arm,name,dob,pushed_text,pushed_calc,complete\n\"01\",\"event_1_arm_1\",\"John\",\"1979-05-01\",\"\",\"\",2\n\"01\",\"event_2_arm_1\",\"John\",\"2012-09-02\

[R] Parsing "back" to API strcuture

2012-09-12 Thread Eric Fail
Dear R experts, I'm reading data from an online database via API and it gets delivered in this messy comma separated structure, > RAW.API <- > structure("id,event_arm,name,dob,pushed_text,pushed_calc,complete\n\"01\",\"event_1_arm_1\",\"John\",\"1979-05-01\",\"\",\"\",2\n\"01\",\"event_2_arm_1\