[R] RGoogleDocs stopped working

2010-11-19 Thread Farrel Buchinsky
Harlan and Tal have had problems. I had lots too. I spent hours getting it
to work. Terrible process to go through but RGoogleDocs is so useful that
the time was worth it - I think!

My problems were overcome when

   1. I used the latest zip file by Duncan Temple Lang see below
   2. I inserted an options line that loosened the ssl security - do not
   know if that was a good thing or not but it got it to work

Duncan said:
"I have put an updated version of the source of the package with
these changes. It is available from
http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.tar.gz
There is a binary for Windows  in
http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.zip

Here is my script that works. Does yours look like this?

library(RGoogleDocs)
packageDescription("RGoogleDocs")
ps <-readline(prompt="get the password in ")
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem",
package = "RCurl"), ssl.verifypeer = FALSE))
sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps,
service ="wise"))
ts2=getWorksheets("OnCall",sheets.con) #OnCall is just the name of a
spreadsheet
names(ts2)
y2005<-sheetAsMatrix(ts2$y2005,header=TRUE, as.data.frame=TRUE, trim=TRUE)

Finally, I am willing to offer you a TeamViewer session where we can take
control of one another's computers and see if the problem is code or the
installation. I warn you that I am neither a programmer nor a developer,
just a very enthusiastic RGoogleDocs user who probably perseveres more than
is good for him.

Farrel Buchinsky

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Rcurl giving SSL grief

2010-08-10 Thread Farrel Buchinsky
Do you use RGoogleDocs? If so can you please try run a script now and tell
me if you get what I am getting?

Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : SSL
certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed

It came after I ran this:
library(RGoogleDocs)
ps <-readline(prompt="get the password in ")
sheets.con = getGoogleDocsConnection(getGoogleAuth("fx...@gmail.com", ps,
service ="wise"))
ts2=getWorksheets("OnCall",sheets.con)

I posted the question on StackOverflow at
http://stackoverflow.com/questions/3442781/rgoogledocs-or-rcurl-giving-ssl-certificate-problem
Is it a breach of etiquette to cross post?


Farrel Buchinsky

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RGoogleDocs not working for me with " wise" service

2010-06-09 Thread Farrel Buchinsky
Dear Duncan

I am not the only one who thinks RGoogleDocs is fantastic. See below. I
think it would save many people a lot of time and/or disappointment if
the omegahat site were updated to show/offer 0.4-1 instead of 0.4-0. Am I
correct in believing that I cannot change it, only you can? If so, then
sorry for asking you to do more work. However, that is the price you pay
when you do something so useful. Thanks.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Jun 9, 2010 at 18:17, Harlan Harris  wrote:

> It works! How fantastic a capability, and how embarrassing that I missed
> that version change! Thanks very much!
>
>  -Harlan
>
>
> On Wed, Jun 9, 2010 at 5:52 PM, Farrel Buchinsky  wrote:
>
>> Harlan Harris  harris.name> writes:
>>
>> >
>> > Hello,
>> >
>> > I'm trying to figure out how to use the RGoogleDocs package from
>> OmegaHat,
>> > and am having a bit of trouble. I emailed Duncan Temple Lang directly,
>> but
>> > didn't receive a response, so I thought I'd try here to see if anyone
>> else
>> > can help.
>> >
>> > I'm using 32-bit R 2.10.1 (Mac OS X), I built RGoogleDocs 0.4-0 from
>> source,
>> > and I'm using XML 3.1-0 and RCurl 1.2-0.
>> >
>> Are you able to access the conversation from Fri, Dec 11, 2009 at 20:07
>> titled
>> "Have you used RGoogleDocs and RGoogleData?"
>>
>> In that conversation Duncan Temple Lang referred to an updated version of
>> hte
>> source packages. The latest version is 0.4-1. When one goes to the
>> omegahat site
>> the links lead one to version 0.4-0 which is not the most recent. I was
>> having
>> problems with 0.4-0 and they were resolved by 0.4-1. Try it! You'll like
>> it!
>>
>> Here is what Dunacan Temple Lang wrote
>>
>> "I have put an updated version of the source of the package with
>> these changes. It is available from
>>
>>  http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.tar.gz
>>
>> There is a binary for Windows  in
>>  http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.zip
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RGoogleDocs not working for me with " wise" service

2010-06-09 Thread Farrel Buchinsky
Harlan Harris  harris.name> writes:

> 
> Hello,
> 
> I'm trying to figure out how to use the RGoogleDocs package from OmegaHat,
> and am having a bit of trouble. I emailed Duncan Temple Lang directly, but
> didn't receive a response, so I thought I'd try here to see if anyone else
> can help.
> 
> I'm using 32-bit R 2.10.1 (Mac OS X), I built RGoogleDocs 0.4-0 from source,
> and I'm using XML 3.1-0 and RCurl 1.2-0.
> 
Are you able to access the conversation from Fri, Dec 11, 2009 at 20:07 titled 
"Have you used RGoogleDocs and RGoogleData?" 

In that conversation Duncan Temple Lang referred to an updated version of hte 
source packages. The latest version is 0.4-1. When one goes to the omegahat 
site 
the links lead one to version 0.4-0 which is not the most recent. I was having 
problems with 0.4-0 and they were resolved by 0.4-1. Try it! You'll like it!

Here is what Dunacan Temple Lang wrote

"I have put an updated version of the source of the package with
these changes. It is available from

 http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.tar.gz

There is a binary for Windows  in
 http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.zip

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Form using R

2010-03-14 Thread Farrel Buchinsky
Tal Galili  gmail.com> writes:

> 
> Hi Nilza,
> I just wrote a more detailed answer to your question in the following post:
> Google spreadsheets + google forms + R = Easily collecting and importing
> data for analysis

on Fri, Mar 12, 2010 at 4:49 PM, Nilza BARROS  gmail.com> 
wrote:
> 
> > Hi, R users
> >
> > We can create a form using R?
> > I would like to create a form where the information can be read by R.
> > Itneeds to be updated daily because I have to tabulate the reasons for
> > delays
> > in the generation of numerical models products.


There is also a package called RGoogleData that can import data from Google 
Spreadsheets (even when they are not public). It has one benefit over 
RGoogleDocs; RGoogleData can download a spreadsheet as a csv file to your 
harddrive. You can then read the csv file into R - read.csv(). Those steps can 
easily be written into a script so that you do not have to manually futz with 
them each time. The benefit of the csv download is that it is very fast. Both 
the RGoogleDocs and the RGoogleData are slow in reading the spreadsheet into R. 
I understand, but may be wrong, that Google Stores all the data as HTML and its 
API spits it out as xml which these r packages then need to parse out line by 
line. The csv treatment by comparison is instantaneous. 

Only one big problem. As of a few months ago, RGoogleData has stopped working 
for me. I think it is still working for its writer, Adrian Dragulescu. Adrian 
has been very generous with his time in trying to help me. He predicts that he 
will go back to exploring his package once Google updates their API.

Try it out. I would love to hear what happens.

http://r-forge.r-project.org/projects/rgoogledata/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-28 Thread Farrel Buchinsky
Dear Adrian

Are you able to help me with problems that I am having with RGoogleData? I
would greatly appreciate it if you could give me some general trouble
shooting ideas or better yet if you could fix the problem.

I believe that I updated to the latest version of RGoogleData as evidenced
by
>  packageDescription("RGoogleData")
Package: RGoogleData
Type: Package
Title: An R interface to Google Data (Docs, Calendar, Contacts, Finance,
etc.)
Version: 0.2.0
Date: 2009-12-11
Depends: rJava
Author: Adrian A. Dragulescu
Maintainer: Adrian A. Dragulescu 
Description: Provide R access to Google Data API.
License: GPL-3
Repository: R-Forge
Repository/R-Forge/Project: rgoogledata
Repository/R-Forge/Revision: 6
Date/Publication: 2009-12-13 21:43:52
Packaged: 2009-12-14 21:05:13 UTC; rforge
Built: R 2.10.1; ; 2009-12-14 23:02:39 UTC; windows

-- File: C:/PROGRA~2/R/R-210~1.1/library/RGoogleData/Meta/package.rds

But Alas

My previous script has stopped working.

library(RGoogleData)
ps <-readline(prompt="get the password in ")
con <-googleConnect("fjb...@gmail.com",ps)
allXls <- getSpreadsheets(con)
xls <- allXls[[which(sapply(allXls, slot, "title") == "OnCall")]]
allWks <- getWorksheets(xls)# get the worksheets
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :
  java.lang.ClassCastException: com.google.gdata.data.TextContent cannot be
cast to com.google.gdata.data.OutOfLineContent


I also tried:

target <-downloadDocument(doc="OnCall",
filepath="C:/Users/fbuchinsky/Documents/My Dropbox/OnCalltrial.csv",
fileformat="csv", sheetIndex=1)
Error in regexpr("%3A", d...@key) :
  trying to get slot "key" from an object of a basic class ("character")
with no slots

Farrel Buchinsky


Sent from Pittsburgh, Pennsylvania, United States

On Thu, Dec 10, 2009 at 10:38, Adrian Dragulescu wrote:

>
> I will try to have something in place by Monday to allow you to download a
> specific sheet not default to the first.  I will let you know.
>
> Adrian
>
>
> On Thu, 10 Dec 2009, Farrel Buchinsky wrote:
>
>  Thank you Adrian. Your response was very informative.
>>
>> ?downloadDocument filled me with excitement untill I read, "If you try to
>> download a spreadsheet with multiple worksheets into a 'csv' or 'tsv'
>> format, only the first worksheet will be downloaded."
>>
>> So now there is a convenient fast way to read data under two circumstances
>>
>>  1. if the spreadsheet has been
>> published<
>> http://blog.revolution-computing.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html
>> >
>>  2. if one only wants the first sheet (RGoogleData's downloadDocument()).
>>
>>
>>
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>> Sent from Pittsburgh, Pennsylvania, United States
>>
>> On Thu, Dec 10, 2009 at 09:32, Adrian Dragulescu > >wrote:
>>
>>
>>> Farrel,
>>>
>>> Please read the manuals.  On the RGoogleData package page you can read:
>>> "The package provides R access to Google services through the Google
>>> supported Java API.
>>>
>>> [...]
>>>
>>> A package with very similar functionality is maintained by Duncan Temple
>>> Lang at \url{http://www.omegahat.org/RGoogleDocs/}.  The approach taken
>>> there is to use \code{RCurl} and \code{XML} to interact with the lower
>>> level Google HTML protocol.  You should check it out too."
>>>
>>> Regarding the questions you have about speed.  Google spreadsheets is
>>> labeled Labs, mabye there are performance issues on Google side.  The
>>> approach for both RGoogleDocs and RGoogleData is to make requests to the
>>> Google servers and parse the XML results.  RGoogleDocs parses using a C
>>> library, RGoogleData uses a Java library.  Going through the Java
>>> interface
>>> is an extra step, so that might explain the speed difference.
>>>
>>> Check ?downloadDocument if you want to download the entire document.  It
>>> should be fast.  You can load it into R after that.
>>>
>>> Best,
>>> Adrian
>>>
>>>
>>>
>>> On Wed, 9 Dec 2009, Farrel Buchinsky wrote:
>>>
>>>  Both of these applications fulfill a great need of mine: to read data
>>>
>>>> directly from google spreadsheets that are private to myself and one or
>>>> two
>>>> collaborators. Thanks to the authors. I had been using RGoogleDocs for
>>>> the
>>>> ab

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-11 Thread Farrel Buchinsky
It Works! Thanks a lot! Its great.

What were your "few minor, but important, changes" - in a nutshell. I will
not understand unless you describe it as high level issues.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Fri, Dec 11, 2009 at 19:07, Duncan Temple Lang
wrote:

>
> Hi Farrel
>
>  I have taken a look at the problems using RGoogleDocs to read
> spreadsheets and was able to reproduce the problem I believe you
> were having. A few minor, but important, changes and I can read
> spreadsheets again and apparently still other types of documents.
>
> I have put an updated version of the source of the package with
> these changes. It is available from
>
>  http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.tar.gz
>
> There is a binary for Windows  in
>  http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.4-1.zip
>
> Hopefully  this will cure the problems you have been experiencing.
> I'd appreciate knowing either way.
>
>  Thanks,
>
>   D.
>
>
> Farrel Buchinsky wrote:
> > Both of these applications fulfill a great need of mine: to read data
> > directly from google spreadsheets that are private to myself and one or
> two
> > collaborators. Thanks to the authors. I had been using RGoogleDocs for
> the
> > about 6 months (maybe more) but have had to stop using it in the past
> month
> > since for some reason that I do not understand it no longer reads google
> > spreadsheets. I loved it. Its loss depresses me. I started using
> RGoogleData
> > which works.
> >
> > I have noticed that both packages read data slowly. RGoogleData is much
> > slower than RGoogleDocs used to be. Both seem a lot slower than if one
> > manually downloaded a google spreadsheet as a csv and then used read.csv
> > function - but then I would not be able to use scripts and execute
> without
> > finding and futzing.
> >
> > Can anyone explain in English why these packages read slower than a csv
> > download?
> > Can anyone explain what the core difference is between the two packages?
> > Can anyone share their experience with reading Google data straight into
> R?
> >
> > Farrel Buchinsky
> > Google Voice Tel: (412) 567-7870
> >
> > Sent from Pittsburgh, Pennsylvania, United States
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-10 Thread Farrel Buchinsky
That would be fantastic. How about an option whereby all the worksheets are
downloaded and read into dataframes and appear as a a list of dataframes?
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Thu, Dec 10, 2009 at 10:38, Adrian Dragulescu wrote:

>
> I will try to have something in place by Monday to allow you to download a
> specific sheet not default to the first.  I will let you know.
>
> Adrian
>
>
> On Thu, 10 Dec 2009, Farrel Buchinsky wrote:
>
>  Thank you Adrian. Your response was very informative.
>>
>> ?downloadDocument filled me with excitement untill I read, "If you try to
>> download a spreadsheet with multiple worksheets into a 'csv' or 'tsv'
>> format, only the first worksheet will be downloaded."
>>
>> So now there is a convenient fast way to read data under two circumstances
>>
>>  1. if the spreadsheet has been
>> published<
>> http://blog.revolution-computing.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html
>> >
>>  2. if one only wants the first sheet (RGoogleData's downloadDocument()).
>>
>>
>>
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>> Sent from Pittsburgh, Pennsylvania, United States
>>
>> On Thu, Dec 10, 2009 at 09:32, Adrian Dragulescu > >wrote:
>>
>>
>>> Farrel,
>>>
>>> Please read the manuals.  On the RGoogleData package page you can read:
>>> "The package provides R access to Google services through the Google
>>> supported Java API.
>>>
>>> [...]
>>>
>>> A package with very similar functionality is maintained by Duncan Temple
>>> Lang at \url{http://www.omegahat.org/RGoogleDocs/}.  The approach taken
>>> there is to use \code{RCurl} and \code{XML} to interact with the lower
>>> level Google HTML protocol.  You should check it out too."
>>>
>>> Regarding the questions you have about speed.  Google spreadsheets is
>>> labeled Labs, mabye there are performance issues on Google side.  The
>>> approach for both RGoogleDocs and RGoogleData is to make requests to the
>>> Google servers and parse the XML results.  RGoogleDocs parses using a C
>>> library, RGoogleData uses a Java library.  Going through the Java
>>> interface
>>> is an extra step, so that might explain the speed difference.
>>>
>>> Check ?downloadDocument if you want to download the entire document.  It
>>> should be fast.  You can load it into R after that.
>>>
>>> Best,
>>> Adrian
>>>
>>>
>>>
>>> On Wed, 9 Dec 2009, Farrel Buchinsky wrote:
>>>
>>>  Both of these applications fulfill a great need of mine: to read data
>>>
>>>> directly from google spreadsheets that are private to myself and one or
>>>> two
>>>> collaborators. Thanks to the authors. I had been using RGoogleDocs for
>>>> the
>>>> about 6 months (maybe more) but have had to stop using it in the past
>>>> month
>>>> since for some reason that I do not understand it no longer reads google
>>>> spreadsheets. I loved it. Its loss depresses me. I started using
>>>> RGoogleData
>>>> which works.
>>>>
>>>> I have noticed that both packages read data slowly. RGoogleData is much
>>>> slower than RGoogleDocs used to be. Both seem a lot slower than if one
>>>> manually downloaded a google spreadsheet as a csv and then used read.csv
>>>> function - but then I would not be able to use scripts and execute
>>>> without
>>>> finding and futzing.
>>>>
>>>> Can anyone explain in English why these packages read slower than a csv
>>>> download?
>>>> Can anyone explain what the core difference is between the two packages?
>>>> Can anyone share their experience with reading Google data straight into
>>>> R?
>>>>
>>>> Farrel Buchinsky
>>>> Google Voice Tel: (412) 567-7870
>>>>
>>>> Sent from Pittsburgh, Pennsylvania, United States
>>>>
>>>>
>>>>
>>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-10 Thread Farrel Buchinsky
Thank you Adrian. Your response was very informative.

?downloadDocument filled me with excitement untill I read, "If you try to
download a spreadsheet with multiple worksheets into a 'csv' or 'tsv'
format, only the first worksheet will be downloaded."

So now there is a convenient fast way to read data under two circumstances

   1. if the spreadsheet has been
published<http://blog.revolution-computing.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html>
   2. if one only wants the first sheet (RGoogleData's downloadDocument()).


Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

On Thu, Dec 10, 2009 at 09:32, Adrian Dragulescu wrote:

>
> Farrel,
>
> Please read the manuals.  On the RGoogleData package page you can read:
> "The package provides R access to Google services through the Google
> supported Java API.
>
> [...]
>
> A package with very similar functionality is maintained by Duncan Temple
> Lang at \url{http://www.omegahat.org/RGoogleDocs/}.  The approach taken
> there is to use \code{RCurl} and \code{XML} to interact with the lower
> level Google HTML protocol.  You should check it out too."
>
> Regarding the questions you have about speed.  Google spreadsheets is
> labeled Labs, mabye there are performance issues on Google side.  The
> approach for both RGoogleDocs and RGoogleData is to make requests to the
> Google servers and parse the XML results.  RGoogleDocs parses using a C
> library, RGoogleData uses a Java library.  Going through the Java interface
> is an extra step, so that might explain the speed difference.
>
> Check ?downloadDocument if you want to download the entire document.  It
> should be fast.  You can load it into R after that.
>
> Best,
> Adrian
>
>
>
> On Wed, 9 Dec 2009, Farrel Buchinsky wrote:
>
>  Both of these applications fulfill a great need of mine: to read data
>> directly from google spreadsheets that are private to myself and one or
>> two
>> collaborators. Thanks to the authors. I had been using RGoogleDocs for the
>> about 6 months (maybe more) but have had to stop using it in the past
>> month
>> since for some reason that I do not understand it no longer reads google
>> spreadsheets. I loved it. Its loss depresses me. I started using
>> RGoogleData
>> which works.
>>
>> I have noticed that both packages read data slowly. RGoogleData is much
>> slower than RGoogleDocs used to be. Both seem a lot slower than if one
>> manually downloaded a google spreadsheet as a csv and then used read.csv
>> function - but then I would not be able to use scripts and execute without
>> finding and futzing.
>>
>> Can anyone explain in English why these packages read slower than a csv
>> download?
>> Can anyone explain what the core difference is between the two packages?
>> Can anyone share their experience with reading Google data straight into
>> R?
>>
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>> Sent from Pittsburgh, Pennsylvania, United States
>>
>>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Have you used RGoogleDocs and RGoogleData?

2009-12-09 Thread Farrel Buchinsky
Both of these applications fulfill a great need of mine: to read data
directly from google spreadsheets that are private to myself and one or two
collaborators. Thanks to the authors. I had been using RGoogleDocs for the
about 6 months (maybe more) but have had to stop using it in the past month
since for some reason that I do not understand it no longer reads google
spreadsheets. I loved it. Its loss depresses me. I started using RGoogleData
which works.

I have noticed that both packages read data slowly. RGoogleData is much
slower than RGoogleDocs used to be. Both seem a lot slower than if one
manually downloaded a google spreadsheet as a csv and then used read.csv
function - but then I would not be able to use scripts and execute without
finding and futzing.

Can anyone explain in English why these packages read slower than a csv
download?
Can anyone explain what the core difference is between the two packages?
Can anyone share their experience with reading Google data straight into R?

Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-12-08 Thread Farrel Buchinsky
Is anyone using RGoogleDocs? If so have you used it in the last few weeks
and is it working as it used to. Look at the problem I have run into.
Farrel Buchinsky




On Sat, Nov 28, 2009 at 14:25, Farrel Buchinsky  wrote:

> Thank you for the interest in my problem.
>
>
> I have been  using the same script (see below) successfully for the past 5
> months and now all of a sudden I have problems. Could R be
> functioning differently under 2.10? Could Google have changed their
> authentication procedures? In other words are you currently able to read
> spreadsheets into R the way you used to?
>
> library(RGoogleDocs)
> ps <-readline(prompt="get the password in ")
> sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps,
> service ="wise"))
> ts2=getWorksheets("OnCall",sheets.con)
> Error in getDocs(con) : problems connecting to get the list of documents
>
> I used options(error = recover) to troubleshoot but alas I am none the
> wiser (no pun intended). I am pasting the output here. Can you see where the
> problem is coming from? [By the way, I changed my script temporarily to
> service="writely" and the getDocs command worked. If I remember correctly
> RGoogleDocs had a problem about 6 months ago whereby one could list the
> documents but not the spreadsheets and then you fixed it. ]
>
> Enter a frame number, or 0 to exit
>
> 1: getWorksheets("OnCall", sheets.con)
> 2: getDocs(con)
>
> Selection: 2
> Called from: eval(expr, envir, enclos)
> Browse[1]> objects()
> [1] "as.data.frame" "auth"  "curl"  "folders"   "h"
> "status""what"  "x"
> Browse[1]> body()
> {
> if (what %in% names(GoogleURLs))
> what = GoogleURLs[what]
> else if (is(curl, "GoogleSpreadsheetsConnection"))
> what = GoogleURLs["spreadsheets"]
> curlSetOpt(customrequest = "GET", curl = curl)
> h = basicTextGatherer()
> if (folders)
> what = paste(what, "showfolders=true", sep = "?")
> x = getURL(what, curl = curl, headerfunction = h$update,
> followlocation = TRUE, ...)
> status = parseHTTPHeader(h$value())
> if (floor(as.numeric(status[["status"]])/100) != 2)
> stop("problems connecting to get the list of documents")
> doc = xmlParse(x, asText = TRUE)
> if (toupper(xmlName(xmlRoot(doc))) == "HTML")
> stop("Can't get document list. Is the connection still valid?
> Perhaps initialize a new connection.")
> convertDocList(doc, curl, as.data.frame)
> }
> Browse[1]> status
>
> WWW-Authenticate
>Content-Type
> "GoogleLogin realm=\"http://www.google.com/accounts/ClientLogin\";,
> service=\"writely\""
>  "text/html; charset=UTF-8"
>
> Date
> Expires
> "Sat, 28 Nov 2009
> 19:04:22 GMT" "Sat,
> 28 Nov 2009 19:04:22 GMT"
>
>  Cache-Control
>X-Content-Type-Options
>
> "private, max-age=0"
>   "nosniff"
>
> X-XSS-Protection
> X-Frame-Options
>
>  "0"
>"SAMEORIGIN"
>
>   Server
>   Transfer-Encoding
>
>"GFE/2.0"
>   "chunked"
>
>   status
>   statusMessage
>
>"401"
> "Token invalid"
>
>
>
> Farrel Buchinsky
> Google Voice Tel: (412) 567-7870
>
>
>
> On Sat, Nov 28, 2009 at 12:45, Duncan Temple Lang  > wrote:
>
>>
>>
>> Farrel Buchinsky wrote:
>> > Please oh please could someone help me or at least confirm that they are
>> > having the same problem.
>> >
>> > Why am I getting the error message from RGoogleDocs
>> >
>> >> getDocs(sheets.con)
>> > Error in getDocs(sheets.con) :
>> >   problems connecting to get the list of documents
>>
>> You are using a connection to the wise service (for worksheets)
>> to get the list of documents from the document service.
>>
>> If you call getDocs() with an connection to writely, I
>> imagine it will succeed.
>>
>> So you have a token, but it is for the wrong thing.
>>
>> >
>> >
>> > How do I troubleshoot?
>>
>> The first thing is to learn abou

Re: [R] Reading from Google Docs

2009-11-28 Thread Farrel Buchinsky
Thank you for the interest in my problem.


I have been  using the same script (see below) successfully for the past 5
months and now all of a sudden I have problems. Could R be
functioning differently under 2.10? Could Google have changed their
authentication procedures? In other words are you currently able to read
spreadsheets into R the way you used to?

library(RGoogleDocs)
ps <-readline(prompt="get the password in ")
sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps,
service ="wise"))
ts2=getWorksheets("OnCall",sheets.con)
Error in getDocs(con) : problems connecting to get the list of documents

I used options(error = recover) to troubleshoot but alas I am none the wiser
(no pun intended). I am pasting the output here. Can you see where the
problem is coming from? [By the way, I changed my script temporarily to
service="writely" and the getDocs command worked. If I remember correctly
RGoogleDocs had a problem about 6 months ago whereby one could list the
documents but not the spreadsheets and then you fixed it. ]

Enter a frame number, or 0 to exit

1: getWorksheets("OnCall", sheets.con)
2: getDocs(con)

Selection: 2
Called from: eval(expr, envir, enclos)
Browse[1]> objects()
[1] "as.data.frame" "auth"  "curl"  "folders"   "h"
"status""what"  "x"
Browse[1]> body()
{
if (what %in% names(GoogleURLs))
what = GoogleURLs[what]
else if (is(curl, "GoogleSpreadsheetsConnection"))
what = GoogleURLs["spreadsheets"]
curlSetOpt(customrequest = "GET", curl = curl)
h = basicTextGatherer()
if (folders)
what = paste(what, "showfolders=true", sep = "?")
x = getURL(what, curl = curl, headerfunction = h$update,
followlocation = TRUE, ...)
status = parseHTTPHeader(h$value())
if (floor(as.numeric(status[["status"]])/100) != 2)
stop("problems connecting to get the list of documents")
doc = xmlParse(x, asText = TRUE)
if (toupper(xmlName(xmlRoot(doc))) == "HTML")
stop("Can't get document list. Is the connection still valid?
Perhaps initialize a new connection.")
convertDocList(doc, curl, as.data.frame)
}
Browse[1]> status

WWW-Authenticate
   Content-Type
"GoogleLogin realm=\"http://www.google.com/accounts/ClientLogin\";,
service=\"writely\""
 "text/html; charset=UTF-8"

  Date
  Expires
"Sat, 28 Nov 2009
19:04:22 GMT" "Sat,
28 Nov 2009 19:04:22 GMT"

 Cache-Control
   X-Content-Type-Options
       "private,
max-age=0"
"nosniff"

X-XSS-Protection
    X-Frame-Options

   "0"
 "SAMEORIGIN"

Server
Transfer-Encoding

 "GFE/2.0"
"chunked"

status
statusMessage

 "401"
  "Token invalid"



Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Sat, Nov 28, 2009 at 12:45, Duncan Temple Lang
wrote:

>
>
> Farrel Buchinsky wrote:
> > Please oh please could someone help me or at least confirm that they are
> > having the same problem.
> >
> > Why am I getting the error message from RGoogleDocs
> >
> >> getDocs(sheets.con)
> > Error in getDocs(sheets.con) :
> >   problems connecting to get the list of documents
>
> You are using a connection to the wise service (for worksheets)
> to get the list of documents from the document service.
>
> If you call getDocs() with an connection to writely, I
> imagine it will succeed.
>
> So you have a token, but it is for the wrong thing.
>
> >
> >
> > How do I troubleshoot?
>
> The first thing is to learn about debugging in R.
> For example,
>
> options(error = recover)
>
> getDocs(sheets.con)
>
> The error occurs and you are presented with a menu prompt that allows you
> to select the call frame of interest. There is only one - getDocs().
> Enter 1 .  Now you have an R prompt  that allows you to explore
> the call frame.
>
>  objects()
>
>  body()
>
>
> Take a look at status
>
>  status
>
>
>WWW-Authenticate
> "GoogleLogin realm=\"http://www.google.com/accounts/ClientLogin\";,
> service=\"writely\""
>
> Content-Type
> "text/html;
> charset=UTF-8"
>
>   Date
>   

Re: [R] Reading from Google Docs

2009-11-28 Thread Farrel Buchinsky
Please oh please could someone help me or at least confirm that they are
having the same problem.

Why am I getting the error message from RGoogleDocs

> getDocs(sheets.con)
Error in getDocs(sheets.con) :
  problems connecting to get the list of documents


How do I troubleshoot?


Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Nov 25, 2009 at 17:08, Farrel Buchinsky  wrote:

> Oh OH! Could you please help with a problem that I never used to get.
>
> library(RGoogleDocs)
> ps <-readline(prompt="get the password in ")
> sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps,
> service ="wise"))
> ts2=getWorksheets("OnCall",sheets.con)
>
> Those opening lines of script used to work flawlesly. Now I get.
> Error in getDocs(con) : problems connecting to get the list of documents
>
> Yet I got it to work earlier while I had been toying with RGoogleData
> package in another session. Could RGoogleData have opened something for
> RGoogleDocs to use?
>
> Farrel Buchinsky
> Google Voice Tel: (412) 567-7870
>
> Sent from Pittsburgh, Pennsylvania, United States
>
> On Wed, Nov 25, 2009 at 16:34, Farrel Buchinsky  wrote:
>
>> That was painless. I had already installed Rtools and had already put it
>> on my path.
>>
>> Your line worked very well. [Thanks for telling me. However I did it last
>> time was worse than sticking daggers in my eyes. ]
>>  install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";, 
>> type="source"
>> )
>>
>> I now have
>> Package: RGoogleDocs
>> Version: 0.4-0
>> Title:
>> 
>> Maintainer: Duncan Temple Lang 
>> Packaged: 2009-10-27 22:10:22 UTC; duncan
>> Built: R 2.10.0; ; 2009-11-25 20:59:03 UTC; windows
>>
>> I am providing the following link to a copy of my RGoogleDocs zipped
>> directory. It is for people who run R in windows and do not want to go
>> through the pain of setting things up so that they can install source.
>> http://dl.dropbox.com/u/23200/RGoogleDocs/RGoogleDocs.zip
>>
>> I BELIEVE that if one downloads the zip and extracts it to an empty
>> directory called RGoogleDocs in one's Library directory then everything will
>> work. Please let me know.
>>
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>>
>>
>>
>>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-11-25 Thread Farrel Buchinsky
Oh OH! Could you please help with a problem that I never used to get.

library(RGoogleDocs)
ps <-readline(prompt="get the password in ")
sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps,
service ="wise"))
ts2=getWorksheets("OnCall",sheets.con)

Those opening lines of script used to work flawlesly. Now I get.
Error in getDocs(con) : problems connecting to get the list of documents

Yet I got it to work earlier while I had been toying with RGoogleData
package in another session. Could RGoogleData have opened something for
RGoogleDocs to use?

Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

On Wed, Nov 25, 2009 at 16:34, Farrel Buchinsky  wrote:

> That was painless. I had already installed Rtools and had already put it on
> my path.
>
> Your line worked very well. [Thanks for telling me. However I did it last
> time was worse than sticking daggers in my eyes. ]
>  install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";, 
> type="source"
> )
>
> I now have
> Package: RGoogleDocs
> Version: 0.4-0
> Title:
> 
> Maintainer: Duncan Temple Lang 
> Packaged: 2009-10-27 22:10:22 UTC; duncan
> Built: R 2.10.0; ; 2009-11-25 20:59:03 UTC; windows
>
> I am providing the following link to a copy of my RGoogleDocs zipped
> directory. It is for people who run R in windows and do not want to go
> through the pain of setting things up so that they can install source.
> http://dl.dropbox.com/u/23200/RGoogleDocs/RGoogleDocs.zip
>
> I BELIEVE that if one downloads the zip and extracts it to an empty
> directory called RGoogleDocs in one's Library directory then everything will
> work. Please let me know.
>
> Farrel Buchinsky
> Google Voice Tel: (412) 567-7870
>
>
>
> On Wed, Nov 25, 2009 at 15:15, Charlie Sharpsteen wrote:
>
>> On Wed, Nov 25, 2009 at 12:02 PM, Farrel Buchinsky 
>> wrote:
>> > I reinstalled from a binary that Duncan Temple Lang placed in omegahat.
>> I
>> > see that omegahat has a subdirectory for each version of R. There is not
>> a
>> > directory for 2.10. I took the liberty of taking it from the 2.9
>> directory.
>>
>> That explains the warning message.
>>
>> > Who knows what crime I committed. Is that first or third degree murder.
>>
>> Well, it's just a warning-- so it shouldn't be a show-stopper.  And
>> from what I see the warning is only referring to the package help
>> pages, which are available online.  It looks like the functionality of
>> the package should still work just fine if you don't want to bother
>> with a reinstall.
>>
>> > I saw however that there is a far more recent version of RGoogleDocs
>> (Last
>> > Release: 0.4-0 (27 Oct 2009)). But it is in tar.gz. I assume that it is
>> in
>> > source. Once before I spent about 27000 hours getting a source to become
>> a
>> > binary. I don't know how I finally got it right and am reluctant to
>> wander
>> > into that swamp again.
>> > Farrel Buchinsky
>>
>> This shouldn't be extraordinarily difficult-- unfortunately Murphy's
>> Law does come into play sometimes.  But it should just be a matter of:
>>
>>  install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";,
>> type="source" )
>>
>> And that's it for Linux, Mac OS or other UNIX-based system.  With
>> Windows you will first have to install the toolset available at:
>>
>>  http://www.murdoch-sutherland.com/Rtools/
>>
>> Grab the "Rtools210" installer as you are using R 2.10.x.  Install
>> using the "Package Authoring" option and make sure you check any
>> options that ask about modifying your PATH.
>>
>> Good luck!
>>
>> -Charlie
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-11-25 Thread Farrel Buchinsky
That was painless. I had already installed Rtools and had already put it on
my path.

Your line worked very well. [Thanks for telling me. However I did it last
time was worse than sticking daggers in my eyes. ]
 install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";,
type="source"
)

I now have
Package: RGoogleDocs
Version: 0.4-0
Title:

Maintainer: Duncan Temple Lang 
Packaged: 2009-10-27 22:10:22 UTC; duncan
Built: R 2.10.0; ; 2009-11-25 20:59:03 UTC; windows

I am providing the following link to a copy of my RGoogleDocs zipped
directory. It is for people who run R in windows and do not want to go
through the pain of setting things up so that they can install source.
http://dl.dropbox.com/u/23200/RGoogleDocs/RGoogleDocs.zip

I BELIEVE that if one downloads the zip and extracts it to an empty
directory called RGoogleDocs in one's Library directory then everything will
work. Please let me know.

Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Nov 25, 2009 at 15:15, Charlie Sharpsteen wrote:

> On Wed, Nov 25, 2009 at 12:02 PM, Farrel Buchinsky 
> wrote:
> > I reinstalled from a binary that Duncan Temple Lang placed in omegahat. I
> > see that omegahat has a subdirectory for each version of R. There is not
> a
> > directory for 2.10. I took the liberty of taking it from the 2.9
> directory.
>
> That explains the warning message.
>
> > Who knows what crime I committed. Is that first or third degree murder.
>
> Well, it's just a warning-- so it shouldn't be a show-stopper.  And
> from what I see the warning is only referring to the package help
> pages, which are available online.  It looks like the functionality of
> the package should still work just fine if you don't want to bother
> with a reinstall.
>
> > I saw however that there is a far more recent version of RGoogleDocs
> (Last
> > Release: 0.4-0 (27 Oct 2009)). But it is in tar.gz. I assume that it is
> in
> > source. Once before I spent about 27000 hours getting a source to become
> a
> > binary. I don't know how I finally got it right and am reluctant to
> wander
> > into that swamp again.
> > Farrel Buchinsky
>
> This shouldn't be extraordinarily difficult-- unfortunately Murphy's
> Law does come into play sometimes.  But it should just be a matter of:
>
>  install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";,
> type="source" )
>
> And that's it for Linux, Mac OS or other UNIX-based system.  With
> Windows you will first have to install the toolset available at:
>
>  http://www.murdoch-sutherland.com/Rtools/
>
> Grab the "Rtools210" installer as you are using R 2.10.x.  Install
> using the "Package Authoring" option and make sure you check any
> options that ask about modifying your PATH.
>
> Good luck!
>
> -Charlie
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-11-25 Thread Farrel Buchinsky
I recently installed R 2.10

Now I get

> library(RGoogleDocs)
Loading required package: RCurl
Loading required package: bitops
Loading required package: XML

Attaching package: 'RGoogleDocs'


The following object(s) are masked from package:methods :

 getAccess

Warning message:
package 'RGoogleDocs' was built under R version 2.9.1 and help will not work
correctly
Please re-install it

But alas reinstalling it does not take away the error message.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

On Thu, Jul 9, 2009 at 08:15, Duncan Temple Lang wrote:

>
> Thanks for pointing that out.
> Yes, the link on the package web site was for 0.2-1 and
> that was the one used to build the binary for Windows.
> Now updated in both places and the binary repository will
> give 0.2-2.
>
> How to find the version of an installed package?
>
>  packageDescription("RGoogleDocs")
>
>  D.
>
> Farrel Buchinsky wrote:
>
>> Dear Duncan
>>
>> On my home computer I was able to use  install.packages("RGoogleDocs",
>> repos = "http://www.omegahat.org/R";)
>>
>> But, alas it would not read the data in the spreadsheet. It went back to
>> its nasty ways
>> Error in !includeEmpty : invalid argument type
>>
>> That is what I was getting with version 0.2-1.You then sent me link to
>> 0.2-2 (in source code) which is what worked.
>>
>> Is it possible that that the windows binary version you put in omegahat
>> was 0.2-1 and not 0.2-2?
>>  I did not know how to tell what version had been installed.
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>>
>>
>> On Wed, Jul 8, 2009 at 22:53, Duncan Temple Lang 
>> > dun...@wald.ucdavis.edu>> wrote:
>>
>>
>>
>>Farrel Buchinsky wrote:
>>
>> > 
>>
>>
>>Boy oh boy that process of getting source to binary was super
>>painful. Now
>>that I have the package as binary I can share the whole folder
>>with my
>>coworker and she is able to use RGoogleDocs. I intend to use the
>>same
>>process for the other two windows machines that I use. I really
>>do not want
>>to go through the same installation and path hassles all over
>> again.
>>
>>Should I post my directory containing the binary files somewhere
>>so that
>>others do not have to experience pain. Does etiquette dictate
>>that I should
>>post the directory to help other or does etiquette dictate that
>>it is Duncan
>>Temple Lang's code and thus it his prerogative to distribute his
>>work as he
>>wishes?
>>
>>
>>Etiquette is one thing and the license another.
>>Both encourage you to help others and make the
>>binary available to others.
>>And indeed,  I hope that Windows users do build binaries
>>for others and remove the additional work from those
>>who provide the software in the first place.
>>
>>Having seen this thread today, I did put a binary
>>version of RGoogleDocs on the Omegahat repository
>>so
>>
>> install.packages("RGoogleDocs", repos = "http://www.omegahat.org/R";)
>>
>>    should install it and, if I had had time earlier, saved you the
>> hardship
>>of building the binary.  Sorry to do it so soon after.
>>
>> D.
>>
>>
>>
>>
>>
>>Farrel Buchinsky
>>Google Voice Tel: (412) 567-7870
>>
>>
>>
>>On Wed, Jul 8, 2009 at 12:59, Farrel Buchinsky ><mailto:fjb...@gmail.com>> wrote:
>>
>>Does changing the path in Windows work in real time or does
>>one need to
>>restart the computer for the changes to take effect.
>>Farrel Buchinsky
>>Google Voice Tel: (412) 567-7870
>>
>>
>>
>>On Wed, Jul 8, 2009 at 12:04, Gabor Grothendieck
>>mailto:ggrothendi...@gmail.com
>> >>wrote:
>>
>>
>>Its safer just to temporarily add it to your path.
>>
>>Unfortunately Rtools has a find command that conflicts with
>>the find command in Windows so if you add the Rtools
>>bin directory to your path permanently then you could
>>find other 

Re: [R] RGoogleDocs: getDocs() - "problems connecting to get the list of documents"

2009-08-14 Thread Farrel Buchinsky

It is working for me. Are you using the latest version as in Version: 0.2-2?

Blackett, Matthew wrote:
> 
> Hi
> 
> I have been using RGoogleDocs successfully for some time now but something
> seems to have happened which is preventing me from accessing my data in
> google spreadsheets.
> 
> I get the message: "problems connecting to get the list of documents" when
> I use getDocs, despite being logged in
> 
> e.g.
> 
> sheets.con = getGoogleDocsConnection(getGoogleAuth("username", "password",
> service = "wise"))
> ts = getWorksheets("formname", sheets.con)
> 
> 
> è Error in getDocs(con) : problems connecting to get the list of documents
> 
> Does anyone know what might be causing this? Is it maybe a problem at the
> google end?
> 
> Matthew Blackett
> Researcher
> King's College London
> 
> http://geography.kcl.ac.uk/micromet/MBlackett/
> 
> 
>   [[alternative HTML version deleted]]
> 
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RGoogleDocs%3A-getDocs%28%29---%22problems-connecting-to-get-the-list-of-documents%22-tp24969136p24970787.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] space in column name

2009-07-19 Thread Farrel Buchinsky
I sifted some more and read about a workaround for the problem. I could
simply rename the columns so that there were no more spaces
names(alltime) <-gsub(" ",".", names(alltime))

> names(alltime)
 [1] "ID""LVL7"  "Ref.Pv.No" "Ref.Pv.Name"   "DOS"
"Pt.Last.Name"  "Pt.First.Name" "MRN"   "CPT"
"CPT.Desc"  "DxCd1" "DxCd2" "DxCd3"     "DxCd4"

[15] "DOE"

Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

On Sun, Jul 19, 2009 at 14:32, Farrel Buchinsky  wrote:

> I read a table from Microsoft Access using RODBC. Some of the variables had
> a name with a space in it.
> R has no problem with it but I do.
> I cannot find out how to specify the space
>
> names(alltime)
>  [1] "ID""LVL7"  "Ref Pv No" "Ref Pv Name"   "DOS"
>   "Pt Last Name"  "Pt First Name" "MRN"   "CPT"
> "CPT Desc"  "DxCd1" "DxCd2" "DxCd3" "DxCd4"
>
> [15] "DOE"
>
> But what do I do if I want to do something such as this
> > alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT Desc,]
> Error: unexpected symbol in "alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT
> Desc"
>
>
> Farrel Buchinsky
>
>
> Sent from Pittsburgh, Pennsylvania, United States
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] space in column name

2009-07-19 Thread Farrel Buchinsky
I read a table from Microsoft Access using RODBC. Some of the variables had
a name with a space in it.
R has no problem with it but I do.
I cannot find out how to specify the space

names(alltime)
 [1] "ID""LVL7"  "Ref Pv No" "Ref Pv Name"   "DOS"
"Pt Last Name"  "Pt First Name" "MRN"   "CPT"   "CPT
Desc"  "DxCd1" "DxCd2" "DxCd3" "DxCd4"
[15] "DOE"

But what do I do if I want to do something such as this
> alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT Desc,]
Error: unexpected symbol in "alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT
Desc"


Farrel Buchinsky


Sent from Pittsburgh, Pennsylvania, United States

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Dear Duncan
On my home computer I was able to use  install.packages("RGoogleDocs", repos
= "http://www.omegahat.org/R";)

But, alas it would not read the data in the spreadsheet. It went back to its
nasty ways
Error in !includeEmpty : invalid argument type

That is what I was getting with version 0.2-1.You then sent me link to 0.2-2
(in source code) which is what worked.

Is it possible that that the windows binary version you put in omegahat was
0.2-1 and not 0.2-2?

I did not know how to tell what version had been installed.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Jul 8, 2009 at 22:53, Duncan Temple Lang wrote:

>
>
> Farrel Buchinsky wrote:
>
> > 
>
>  Boy oh boy that process of getting source to binary was super painful. Now
>> that I have the package as binary I can share the whole folder with my
>> coworker and she is able to use RGoogleDocs. I intend to use the same
>> process for the other two windows machines that I use. I really do not
>> want
>> to go through the same installation and path hassles all over again.
>>
>> Should I post my directory containing the binary files somewhere so that
>> others do not have to experience pain. Does etiquette dictate that I
>> should
>> post the directory to help other or does etiquette dictate that it is
>> Duncan
>> Temple Lang's code and thus it his prerogative to distribute his work as
>> he
>> wishes?
>>
>
> Etiquette is one thing and the license another.
> Both encourage you to help others and make the
> binary available to others.
> And indeed,  I hope that Windows users do build binaries
> for others and remove the additional work from those
> who provide the software in the first place.
>
> Having seen this thread today, I did put a binary
> version of RGoogleDocs on the Omegahat repository
> so
>
>  install.packages("RGoogleDocs", repos = "http://www.omegahat.org/R";)
>
> should install it and, if I had had time earlier, saved you the hardship
> of building the binary.  Sorry to do it so soon after.
>
>  D.
>
>
>
>
>
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>>
>>
>> On Wed, Jul 8, 2009 at 12:59, Farrel Buchinsky  wrote:
>>
>>  Does changing the path in Windows work in real time or does one need to
>>> restart the computer for the changes to take effect.
>>> Farrel Buchinsky
>>> Google Voice Tel: (412) 567-7870
>>>
>>>
>>>
>>> On Wed, Jul 8, 2009 at 12:04, Gabor Grothendieck <
>>> ggrothendi...@gmail.com>wrote:
>>>
>>>  Its safer just to temporarily add it to your path.
>>>>
>>>> Unfortunately Rtools has a find command that conflicts with
>>>> the find command in Windows so if you add the Rtools
>>>> bin directory to your path permanently then you could
>>>> find other programs stop working.  That actually happened
>>>> to me once and it took the longest time until I discovered
>>>> that Rtools was the culprit.
>>>>
>>>> If you follow the advice I gave you normally won't have
>>>> that problem.
>>>>
>>>> On Wed, Jul 8, 2009 at 11:21 AM, Duncan Murdoch
>>>> wrote:
>>>>
>>>>> On 08/07/2009 10:13 AM, Farrel Buchinsky wrote:
>>>>>
>>>>>> Forgive my naivte, but how do I make windows find tar. In other words
>>>>>>
>>>>> from
>>>>
>>>>> where do I issue the command and what is the command.
>>>>>>
>>>>> You need to install the toolset, and let the installer set your path.
>>>>>
>>>>> Duncan Murdoch
>>>>>
>>>>>  Farrel Buchinsky
>>>>>> Google Voice Tel: (412) 567-7870
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Jul 8, 2009 at 10:09, Duncan Murdoch 
>>>>>>
>>>>> wrote:
>>>>
>>>>> On 08/07/2009 10:02 AM, Farrel Buchinsky wrote:
>>>>>>>
>>>>>>>  I  have previously read "R Installation and Administration". I read
>>>>>>>>
>>>>>>> it
>>>>
>>>>> again. It does not help me
>>>>>>>> The relevant paragraph is below. But I need lower level
>>>>>>>> instructions.
>>>>>>>> Where
>>>>>>>> can I find them.
>>>>

[R] Getting value rather than formula in RGoogleDocs

2009-07-08 Thread Farrel Buchinsky
Is there an easy way to read the value of the cells rather than the formula?So
for instance in a cell whose value was created by simply using the value
from the cell immediately to the left in the Google spreadsheet I would
prefer to get the value rather than  =RC[-1]

When one exports with Google Spreadsheets as a csv then that does not
happen.

I am using the following line of code in R
y2009<-sheetAsMatrix(ts2$y2009,header=TRUE, as.data.frame=TRUE, trim=TRUE)


Farrel Buchinsky
Google Voice Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Hooray! I got it to work. Here is what I think happened.My hold up was that
the tar command was not working. If you recall, when I issued the command:
tar xvfz RgoogleDocs_0.2.2-src.tar.gz
cmd.exe told me it could not be found

I reran Rtools29.exe which is the Rtools setup program which offered to
change my path. However it still did not work. I went to lunch and took the
opportunity to reboot my computer.

When I retried after lunch the tar command worked and everything thereafter
worked. I think that the file C:\Program Files\R\Rtools\bin\tar.exe could
not be found earlier. I just looked back at my path and I see
that C:\Program Files\R\Rtools\bin is on the path.

RgoogleDocs 0.2-2 is amazing. I can now read data straight into a dataframe.
The fact that I am always reading from realtime data is astounding.

sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com",
"password here", service = "wise"))
ts2=getWorksheets("Consents Received",sheets.con)# put the name of the
spreadsheet in the inverted commas
names(ts2)
sheetAsMatrix(ts2$Sheet1,header=TRUE, as.data.frame=TRUE, trim=TRUE)

MAGIC

Boy oh boy that process of getting source to binary was super painful. Now
that I have the package as binary I can share the whole folder with my
coworker and she is able to use RGoogleDocs. I intend to use the same
process for the other two windows machines that I use. I really do not want
to go through the same installation and path hassles all over again.

Should I post my directory containing the binary files somewhere so that
others do not have to experience pain. Does etiquette dictate that I should
post the directory to help other or does etiquette dictate that it is Duncan
Temple Lang's code and thus it his prerogative to distribute his work as he
wishes?

Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Jul 8, 2009 at 12:59, Farrel Buchinsky  wrote:

> Does changing the path in Windows work in real time or does one need to
> restart the computer for the changes to take effect.
> Farrel Buchinsky
> Google Voice Tel: (412) 567-7870
>
>
>
> On Wed, Jul 8, 2009 at 12:04, Gabor Grothendieck 
> wrote:
>
>> Its safer just to temporarily add it to your path.
>>
>> Unfortunately Rtools has a find command that conflicts with
>> the find command in Windows so if you add the Rtools
>> bin directory to your path permanently then you could
>> find other programs stop working.  That actually happened
>> to me once and it took the longest time until I discovered
>> that Rtools was the culprit.
>>
>> If you follow the advice I gave you normally won't have
>> that problem.
>>
>> On Wed, Jul 8, 2009 at 11:21 AM, Duncan Murdoch
>> wrote:
>> > On 08/07/2009 10:13 AM, Farrel Buchinsky wrote:
>> >>
>> >> Forgive my naivte, but how do I make windows find tar. In other words
>> from
>> >> where do I issue the command and what is the command.
>> >
>> > You need to install the toolset, and let the installer set your path.
>> >
>> > Duncan Murdoch
>> >
>> >> Farrel Buchinsky
>> >> Google Voice Tel: (412) 567-7870
>> >>
>> >>
>> >>
>> >> On Wed, Jul 8, 2009 at 10:09, Duncan Murdoch 
>> wrote:
>> >>
>> >>> On 08/07/2009 10:02 AM, Farrel Buchinsky wrote:
>> >>>
>> >>>> I  have previously read "R Installation and Administration". I read
>> it
>> >>>> again. It does not help me
>> >>>> The relevant paragraph is below. But I need lower level instructions.
>> >>>> Where
>> >>>> can I find them.
>> >>>>
>> >>> Follow the link.  If Windows can't find tar, your toolset is installed
>> >>> incorrectly.
>> >>>
>> >>> Duncan Murdoch
>> >>>
>> >>>
>> >>>> R CMD INSTALL works in Windows to install source packages if you have
>> >>>> the
>> >>>> source-code package files (option “Source Package Installation Files”
>> in
>> >>>> the
>> >>>> installer) and toolset (see The Windows
>> >>>>
>> >>>>
>> >>>>
>> toolset)
>> >>>>
>> >>>> installed. Installation of binary packages must be done by
>> >>>> install.packages
>> >>>> . R CMD INSTALL --help will tell you the current options under
>> Windows
>> >>>> (which differ from those on a Unix-alike): in particular there is a
>> >&g

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Does changing the path in Windows work in real time or does one need to
restart the computer for the changes to take effect.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Jul 8, 2009 at 12:04, Gabor Grothendieck wrote:

> Its safer just to temporarily add it to your path.
>
> Unfortunately Rtools has a find command that conflicts with
> the find command in Windows so if you add the Rtools
> bin directory to your path permanently then you could
> find other programs stop working.  That actually happened
> to me once and it took the longest time until I discovered
> that Rtools was the culprit.
>
> If you follow the advice I gave you normally won't have
> that problem.
>
> On Wed, Jul 8, 2009 at 11:21 AM, Duncan Murdoch
> wrote:
> > On 08/07/2009 10:13 AM, Farrel Buchinsky wrote:
> >>
> >> Forgive my naivte, but how do I make windows find tar. In other words
> from
> >> where do I issue the command and what is the command.
> >
> > You need to install the toolset, and let the installer set your path.
> >
> > Duncan Murdoch
> >
> >> Farrel Buchinsky
> >> Google Voice Tel: (412) 567-7870
> >>
> >>
> >>
> >> On Wed, Jul 8, 2009 at 10:09, Duncan Murdoch 
> wrote:
> >>
> >>> On 08/07/2009 10:02 AM, Farrel Buchinsky wrote:
> >>>
> >>>> I  have previously read "R Installation and Administration". I read it
> >>>> again. It does not help me
> >>>> The relevant paragraph is below. But I need lower level instructions.
> >>>> Where
> >>>> can I find them.
> >>>>
> >>> Follow the link.  If Windows can't find tar, your toolset is installed
> >>> incorrectly.
> >>>
> >>> Duncan Murdoch
> >>>
> >>>
> >>>> R CMD INSTALL works in Windows to install source packages if you have
> >>>> the
> >>>> source-code package files (option “Source Package Installation Files”
> in
> >>>> the
> >>>> installer) and toolset (see The Windows
> >>>>
> >>>>
> >>>>
> toolset)
> >>>>
> >>>> installed. Installation of binary packages must be done by
> >>>> install.packages
> >>>> . R CMD INSTALL --help will tell you the current options under Windows
> >>>> (which differ from those on a Unix-alike): in particular there is a
> >>>> choice
> >>>> of the types of documentation to be installed.
> >>>> Farrel Buchinsky
> >>>> Google Voice Tel: (412) 567-7870
> >>>>
> >>>>
> >>>>
> >>>> 2009/6/19 Uwe Ligges 
> >>>>
> >>>>  See the manual "R Installation and Administration" for information on
> >>>> how
> >>>>>
> >>>>> to install source packages on Windows.
> >>>>>
> >>>>> Uwe Ligges
> >>>>>
> >>>>> Farrel Buchinsky wrote:
> >>>>>
> >>>>>  After issuing tar xvfz RgoogleDocs_0.2.2-src.tar.gzI am getting an
> >>>>> error
> >>>>>>
> >>>>>> message
> >>>>>> 'tar' is not recongnized as an internal or external command,
> operable
> >>>>>> program or batch file.
> >>>>>>
> >>>>>> Should I use my 7-zip to open up the archive?
> >>>>>> Where should I be doing this? For instance can I do it all in my
> >>>>>> download directory or should I do it in C:\Program
> >>>>>> Files\R\R-2.9.0\library or should I manually create C:\Program
> >>>>>> Files\R\R-2.9.0\library\RGoogleDocs and do it all there or will the
> >>>>>> Rcmd
> >>>>>> INSTALL RGoogleDocs_0.2-2.tar.gz command do that for me.
> >>>>>>
> >>>>>> Yes, you assumed correctly. I am using Windows XP.
> >>>>>> Farrel Buchinsky
> >>>>>> Google Voice Tel: (412) 567-7870
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Thu, Jun 18, 2009 at 20:17, Gabor Grothendieck
> >>>>>> wrote:
> >>>>>>
> >>>>>>  I have haven't neen following this thread but:
> >>>>>>
> >>>>>>&

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Forgive my naivte, but how do I make windows find tar. In other words from
where do I issue the command and what is the command.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, Jul 8, 2009 at 10:09, Duncan Murdoch  wrote:

> On 08/07/2009 10:02 AM, Farrel Buchinsky wrote:
>
>> I  have previously read "R Installation and Administration". I read it
>> again. It does not help me
>> The relevant paragraph is below. But I need lower level instructions.
>> Where
>> can I find them.
>>
>
> Follow the link.  If Windows can't find tar, your toolset is installed
> incorrectly.
>
> Duncan Murdoch
>
>
>> R CMD INSTALL works in Windows to install source packages if you have the
>> source-code package files (option “Source Package Installation Files” in
>> the
>> installer) and toolset (see The Windows
>>
>> toolset)
>>
>> installed. Installation of binary packages must be done by
>> install.packages
>> . R CMD INSTALL --help will tell you the current options under Windows
>> (which differ from those on a Unix-alike): in particular there is a choice
>> of the types of documentation to be installed.
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>>
>>
>> 2009/6/19 Uwe Ligges 
>>
>>  See the manual "R Installation and Administration" for information on how
>>> to install source packages on Windows.
>>>
>>> Uwe Ligges
>>>
>>> Farrel Buchinsky wrote:
>>>
>>>  After issuing tar xvfz RgoogleDocs_0.2.2-src.tar.gzI am getting an error
>>>>
>>>> message
>>>> 'tar' is not recongnized as an internal or external command, operable
>>>> program or batch file.
>>>>
>>>> Should I use my 7-zip to open up the archive?
>>>> Where should I be doing this? For instance can I do it all in my
>>>> download directory or should I do it in C:\Program
>>>> Files\R\R-2.9.0\library or should I manually create C:\Program
>>>> Files\R\R-2.9.0\library\RGoogleDocs and do it all there or will the Rcmd
>>>> INSTALL RGoogleDocs_0.2-2.tar.gz command do that for me.
>>>>
>>>> Yes, you assumed correctly. I am using Windows XP.
>>>> Farrel Buchinsky
>>>> Google Voice Tel: (412) 567-7870
>>>>
>>>>
>>>>
>>>> On Thu, Jun 18, 2009 at 20:17, Gabor Grothendieck
>>>> wrote:
>>>>
>>>>  I have haven't neen following this thread but:
>>>>
>>>>> 1. if RGoogleDocs_0.2-2.tar.gz is a source distribution (as
>>>>> opposed to built source) then the first line renames it so
>>>>> that its not the same name as the built file about to be created.
>>>>> The second line detars it into the RGoogleDocs directory.  The third
>>>>> builds
>>>>> the built source file, RGoogleDocs_0.2-2.tar.gz.  The fourth
>>>>> installs the built source file into R.  I've assumed Windows.
>>>>> If you are on Linux replace rename with mv.
>>>>>
>>>>> rename RGoogleDocs_0.2-2.tar.gz RgoogleDocs_0.2.2-src.tar.gz
>>>>> tar xvfz RgoogleDocs_0.2.2-src.tar.gz
>>>>> Rcmd build RGoogleDocs
>>>>> Rcmd INSTALL RGoogleDocs_0.2-2.tar.gz
>>>>>
>>>>> or
>>>>>
>>>>> 2. if RGoogleDocs_0.2-2.tar.gz is already a built source file then you
>>>>> can just issue the last of the above lines and don't need
>>>>> the others.
>>>>>
>>>>> On Thu, Jun 18, 2009 at 7:52 PM, Farrel Buchinsky
>>>>> wrote:
>>>>>
>>>>>  What do you mean by "cd the.directory.containing.RGoogleDocs"
>>>>>> Do you mean the directory where I downloaded the
>>>>>> RGoogleDocs_0.2-2.tar.gz
>>>>>> to? Or do you mean that I must create a directory called RGoogleDocs
>>>>>>
>>>>>>  under
>>>>>
>>>>>  Library and then change to that directory?
>>>>>> Farrel Buchinsky
>>>>>> Google Voice Tel: (412) 567-7870
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck <
>>>>>>
>>>>>>  ggrothendi...@gmail.com>
>>>>>
>>>>>  wrote:
>>>>>>
>>>>>>  Finally enter into the

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
I  have previously read "R Installation and Administration". I read it
again. It does not help me
The relevant paragraph is below. But I need lower level instructions. Where
can I find them.

R CMD INSTALL works in Windows to install source packages if you have the
source-code package files (option “Source Package Installation Files” in the
installer) and toolset (see The Windows
toolset)
installed. Installation of binary packages must be done by install.packages
. R CMD INSTALL --help will tell you the current options under Windows
(which differ from those on a Unix-alike): in particular there is a choice
of the types of documentation to be installed.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



2009/6/19 Uwe Ligges 

> See the manual "R Installation and Administration" for information on how
> to install source packages on Windows.
>
> Uwe Ligges
>
> Farrel Buchinsky wrote:
>
>> After issuing tar xvfz RgoogleDocs_0.2.2-src.tar.gzI am getting an error
>>
>> message
>> 'tar' is not recongnized as an internal or external command, operable
>> program or batch file.
>>
>> Should I use my 7-zip to open up the archive?
>> Where should I be doing this? For instance can I do it all in my
>> download directory or should I do it in C:\Program
>> Files\R\R-2.9.0\library or should I manually create C:\Program
>> Files\R\R-2.9.0\library\RGoogleDocs and do it all there or will the Rcmd
>> INSTALL RGoogleDocs_0.2-2.tar.gz command do that for me.
>>
>> Yes, you assumed correctly. I am using Windows XP.
>> Farrel Buchinsky
>> Google Voice Tel: (412) 567-7870
>>
>>
>>
>> On Thu, Jun 18, 2009 at 20:17, Gabor Grothendieck
>> wrote:
>>
>>  I have haven't neen following this thread but:
>>>
>>> 1. if RGoogleDocs_0.2-2.tar.gz is a source distribution (as
>>> opposed to built source) then the first line renames it so
>>> that its not the same name as the built file about to be created.
>>> The second line detars it into the RGoogleDocs directory.  The third
>>> builds
>>> the built source file, RGoogleDocs_0.2-2.tar.gz.  The fourth
>>> installs the built source file into R.  I've assumed Windows.
>>> If you are on Linux replace rename with mv.
>>>
>>> rename RGoogleDocs_0.2-2.tar.gz RgoogleDocs_0.2.2-src.tar.gz
>>> tar xvfz RgoogleDocs_0.2.2-src.tar.gz
>>> Rcmd build RGoogleDocs
>>> Rcmd INSTALL RGoogleDocs_0.2-2.tar.gz
>>>
>>> or
>>>
>>> 2. if RGoogleDocs_0.2-2.tar.gz is already a built source file then you
>>> can just issue the last of the above lines and don't need
>>> the others.
>>>
>>> On Thu, Jun 18, 2009 at 7:52 PM, Farrel Buchinsky
>>> wrote:
>>>
>>>> What do you mean by "cd the.directory.containing.RGoogleDocs"
>>>> Do you mean the directory where I downloaded the
>>>> RGoogleDocs_0.2-2.tar.gz
>>>> to? Or do you mean that I must create a directory called RGoogleDocs
>>>>
>>> under
>>>
>>>> Library and then change to that directory?
>>>> Farrel Buchinsky
>>>> Google Voice Tel: (412) 567-7870
>>>>
>>>>
>>>>
>>>> On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck <
>>>>
>>> ggrothendi...@gmail.com>
>>>
>>>> wrote:
>>>>
>>>>> Finally enter into the Windows console:
>>>>>
>>>>> cd the.directory.containing.RGoogleDocs
>>>>> Rcmd build RGoogleDocs
>>>>> Rcmd INSTALL RGoogleDocs_1.0.0.tar.gz
>>>>>
>>>>> except replace RGoogleDocs_1.0.0.tar.gz with the filename
>>>>> created by the build.
>>>>>
>>>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-06-19 Thread Farrel Buchinsky
After issuing tar xvfz RgoogleDocs_0.2.2-src.tar.gzI am getting an error
message
'tar' is not recongnized as an internal or external command, operable
program or batch file.

Should I use my 7-zip to open up the archive?
Where should I be doing this? For instance can I do it all in my
download directory or should I do it in C:\Program
Files\R\R-2.9.0\library or should I manually create C:\Program
Files\R\R-2.9.0\library\RGoogleDocs and do it all there or will the Rcmd
INSTALL RGoogleDocs_0.2-2.tar.gz command do that for me.

Yes, you assumed correctly. I am using Windows XP.
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Thu, Jun 18, 2009 at 20:17, Gabor Grothendieck
wrote:

> I have haven't neen following this thread but:
>
> 1. if RGoogleDocs_0.2-2.tar.gz is a source distribution (as
> opposed to built source) then the first line renames it so
> that its not the same name as the built file about to be created.
> The second line detars it into the RGoogleDocs directory.  The third builds
> the built source file, RGoogleDocs_0.2-2.tar.gz.  The fourth
> installs the built source file into R.  I've assumed Windows.
> If you are on Linux replace rename with mv.
>
> rename RGoogleDocs_0.2-2.tar.gz RgoogleDocs_0.2.2-src.tar.gz
> tar xvfz RgoogleDocs_0.2.2-src.tar.gz
> Rcmd build RGoogleDocs
> Rcmd INSTALL RGoogleDocs_0.2-2.tar.gz
>
> or
>
> 2. if RGoogleDocs_0.2-2.tar.gz is already a built source file then you
> can just issue the last of the above lines and don't need
> the others.
>
> On Thu, Jun 18, 2009 at 7:52 PM, Farrel Buchinsky wrote:
> > What do you mean by "cd the.directory.containing.RGoogleDocs"
> > Do you mean the directory where I downloaded the RGoogleDocs_0.2-2.tar.gz
> > to? Or do you mean that I must create a directory called RGoogleDocs
> under
> > Library and then change to that directory?
> > Farrel Buchinsky
> > Google Voice Tel: (412) 567-7870
> >
> >
> >
> > On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck <
> ggrothendi...@gmail.com>
> > wrote:
> >>
> >> Finally enter into the Windows console:
> >>
> >> cd the.directory.containing.RGoogleDocs
> >> Rcmd build RGoogleDocs
> >> Rcmd INSTALL RGoogleDocs_1.0.0.tar.gz
> >>
> >> except replace RGoogleDocs_1.0.0.tar.gz with the filename
> >> created by the build.
> >
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-06-18 Thread Farrel Buchinsky
What do you mean by "cd the.directory.containing.RGoogleDocs"
Do you mean the directory where I downloaded the RGoogleDocs_0.2-2.tar.gz
to? Or do you mean that I must create a directory called RGoogleDocs under
Library and then change to that directory?
Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck wrote:

> Finally enter into the Windows console:
>
> cd the.directory.containing.RGoogleDocs
> Rcmd build RGoogleDocs
> Rcmd INSTALL RGoogleDocs_1.0.0.tar.gz
>
> except replace RGoogleDocs_1.0.0.tar.gz with the filename
> created by the build.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-06-18 Thread Farrel Buchinsky
The first time I did it I had no idea how I did it. Yesterday I struggled
and tried every combination to get it to work and eventually it worked. Once
again I do not know what I did to get it to work. Now today I am trying to
install a version that I downloaded today. And once again I am banging my
head against the wall
When I run Rcmd build RGoogleDocs from the cmd prompt I get
Error: cannot change to directory 'RGoogleDocs'

What error have I perpetrated?

I have changed my starting directory to almost every imaginable directory
and I have put a copy of RGoogleDocs_0.2-2.tar.gz almost everywhere.

I also once got * checking for file 'RGoogleDocs/DESCRIPTION' ... No
and there it stopped



Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck wrote:

> Download and install each of R, Rtools and MiKTeX.
> Each of these have automated installers so its just a matter of
> pressing Enter repeatedly.
>
> You don't have to change your path if you place Rcmd.bat from
> http://batchfiles.googlecode.com
> anywhere on your path (so it can be found).  To see your path try
> this from the Windows console:
>
> path
>
> Finally enter into the Windows console:
>
> cd the.directory.containing.RGoogleDocs
> Rcmd build RGoogleDocs
> Rcmd INSTALL RGoogleDocs_1.0.0.tar.gz
>
> except replace RGoogleDocs_1.0.0.tar.gz with the filename
> created by the build.
>
> It should now be installed.
>
> On Mon, Mar 2, 2009 at 8:59 PM, Farrel Buchinsky  wrote:
> > I was able to extract RGoogleDocs with 7-zip. That was when I began to
> > appreciate the gravity of what Prof Ripley was saying. I am on a windows
> xp
> > machine and the RGoogleDocs download does not have a windows binary
> version.
> > Instead it has only a source package. I started using the R-admin manual
> to
> > step through the process and got nowhere in about 45 minutes. Then I
> tried
> > using the "automated package building
> > service<http://win-builder.r-project.org/>you could try." and got
> > nowhere because I did not know what "R CMD build" is.
> > Can I find someone to do it for me or can I find someone who will give me
> a
> > couple of basic steps at a time?
> >
> > I am desperate to say goodbye to individual static Microsoft Access or
> > Microsoft Excel spreadsheets being the repository for my data.
> >
> > Farrel Buchinsky
> > Sent from: Pittsburgh Pennsylvania United States.
> >
> >
> >>>
> >> Yes, you can install source packages on Windows: the R-admin manual
> gives
> >> you a detailed guide to the tools that you will need to do so.  It even
> >> tells you about an automated package building service you could try.
> >> RGoogleDocs depends on RCurl and XML, both of which I provide Windows
> >> binaries for (and are much trickier to install because of their external
> >> software requirements).
> >>
> >>
> >>  Farrel Buchinsky
> >>> GrandCentral Tel: (412) 567-7870
> >>>
> >>
> >> --
> >> Brian D. Ripley,  rip...@stats.ox.ac.uk
> >> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> >> University of Oxford, Tel:  +44 1865 272861 (self)
> >> 1 South Parks Road, +44 1865 272866 (PA)
> >> Oxford OX1 3TG, UKFax:  +44 1865 272595
> >>
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RGoogleDocs: can now see documents but cannot get content.

2009-06-17 Thread Farrel Buchinsky
Where do I get 0.2-2 from?If I go to http://www.omegahat.org/RGoogleDocs/ I
can only find Last Release:
0.2-1<http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.2-1.tar.gz>
 (08 May 2009)


Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Wed, May 20, 2009 at 12:28, Duncan Temple Lang
wrote:

>
> Hi Farrel
>
>  This particular problem is a trivial issue of an argument out
> of place due to a change in the function definition during the
> development.  There is a new version of the package (0.2-2)
> and it also uses a slightly different approach (and function)
> to pull the values into the form of an R data frame.
>
> Please try that and hopefully it will work.
>
> The code in the run.pdf (or run.html) file on the Web page
> and in the package works and is the best and shortest
> example of sheetAsMatrix().
>
> Let me know if there are still problems.
>
>
>  D.
>
> Farrel Buchinsky wrote:
>
>> The author of the package, Duncan Temple Lang posted an update. I have
>> installed it and now can list my spreadsheets but alas I cannot read the
>> data within any of them.
>> Has anybody been able to get it to work.
>> I would love to see a real live example of sheetAsMatrix
>> I am not sure how to specify sheet and  con = sh...@connection. I have
>> tried
>> many ways but just get:
>> Error in !includeEmpty : invalid argument type
>>
>> Windows Vista (with UAC disabled)
>> R 2.9.0
>>
>> Farrel Buchinsky
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RGoogleDocs: can now see documents but cannot get content.

2009-05-27 Thread Farrel Buchinsky
I already downloaded 0.2-2 -If my memory serves me correctly. If we just go
by date, have you updated the files on the server since May 18?

Farrel Buchinsky
Google Voice Tel: (412) 567-7870

Sent from Pittsburgh, Pennsylvania, United States

On Wed, May 20, 2009 at 12:28, Duncan Temple Lang
wrote:

>
> Hi Farrel
>
>  This particular problem is a trivial issue of an argument out
> of place due to a change in the function definition during the
> development.  There is a new version of the package (0.2-2)
> and it also uses a slightly different approach (and function)
> to pull the values into the form of an R data frame.
>
> Please try that and hopefully it will work.
>
> The code in the run.pdf (or run.html) file on the Web page
> and in the package works and is the best and shortest
> example of sheetAsMatrix().
>
> Let me know if there are still problems.
>
>
>  D.
>
> Farrel Buchinsky wrote:
>
>> The author of the package, Duncan Temple Lang posted an update. I have
>> installed it and now can list my spreadsheets but alas I cannot read the
>> data within any of them.
>> Has anybody been able to get it to work.
>> I would love to see a real live example of sheetAsMatrix
>> I am not sure how to specify sheet and  con = sh...@connection. I have
>> tried
>> many ways but just get:
>> Error in !includeEmpty : invalid argument type
>>
>> Windows Vista (with UAC disabled)
>> R 2.9.0
>>
>> Farrel Buchinsky
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Converting a list to a data frame or columns at the least

2009-05-26 Thread Farrel Buchinsky
I have a column in which dates and times are specified thus
m/d/ HH:MM:SS
Alas, some entries do not include the time and therefore are only
m/d/
so I used read.csv and specified that the relevant column should be read as
is and it remained as a character variable.
I then split the value on the space
split.dt.time <-strsplit(teacher$Date.and.Time.of.Lesson," ")
that gives me a list where each item on the list has two elements if the
time was specified and only 1 element if the time was not specified.
How do I take that list and make all the 1st elements go into one column and
all the second elements go into a second column; where there is no time I
would like the value to be missing (NA)
I tried playing around with do.call(rbind...

so I tried the following unsuccessfully
do.call(rbind,lapply(teacher$Date.and.Time.of.Lesson, function(i)
strsplit(i," ")) )
rbind(strsplit (teacher$Date.and.Time.of.Lesson," "))
do.call(rbind(data.frame(strsplit (teacher$Date.and.Time.of.Lesson," "


Farrel Buchinsky

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RGoogleDocs: can now see documents but cannot get content.

2009-05-18 Thread Farrel Buchinsky
The author of the package, Duncan Temple Lang posted an update. I have
installed it and now can list my spreadsheets but alas I cannot read the
data within any of them.
Has anybody been able to get it to work.
I would love to see a real live example of sheetAsMatrix
I am not sure how to specify sheet and  con = sh...@connection. I have tried
many ways but just get:
Error in !includeEmpty : invalid argument type

Windows Vista (with UAC disabled)
R 2.9.0

Farrel Buchinsky

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Do you use R for data manipulation?

2009-05-05 Thread Farrel Buchinsky
Is R an appropriate tool for data manipulation and data reshaping and data
organizing? I think so but someone who recently joined our group thinks not.
The new recruit believes that python or another language is a far better
tool for developing data manipulation scripts that can be then used by
several members of our research group. Her assessment is that R is useful
only when it comes to data analysis and working with statistical models.
So what do you think:
1)R is a phenomenally powerful and flexible tool and since you are going to
do analyses in R you might as well use it to read data in and merge it and
reshape it to whatever you need.
OR
2) Are you crazy? Nobody in their right mind uses R to pipe the data around
their lab and assemble it for analysis.

Your insights would be appreciated.

Details if you are interested:

Our setup: Hundreds of patients recorded as cases with about 60 variables.
Inputted and stored in a Sybase relational database. High throughput SNP
genotyping platforms saved data output to csv or excel tables. Previously,
not knowing any SQL I had used Microsoft Access to write queries to get the
data that I needed and to merge the genotyping with the clinical database.
It was horrible. I could not even use it on anything other than my desktop
machine at work. When I realized that I was going to need to learn R to
handle the genetic analyses I decided to keep Sybase as the data repository
for the clinical information and the do all the data manipulation, merging
and piping with R using RODBC. I was and am a very amateur coder.
Nevertheless, many many hours later I have scripts that did what I needed
them to do and I understand R code and can tinker with it as needed. My
scripts work for me but they are not exactly user-friendly for others in the
laboratory to just run. For instance, depending on what machine the script
is being run from, one may need to change the file name or file path and
tinker under the hood to accomplish that. My bias is to fulfill all our data
manipulation and reshaping with R. Since I am the principal investigator it
is me who stays constant and coders or analysts who may come and go.

I am even more enamored with R for data manipulation since reading a book
about it.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Printing data as a narrative or form letter rather than as a table

2009-04-16 Thread Farrel Buchinsky
How would one print the information in a table without having to view it as
a table? I have a dataframe with about 30 columns and 50 rows. About 7 rows
contain human subjects where something is just not right and I need to
manually work out what is going on with them and maybe even call them to
ensure we have the data correct. It is really inconvenient to view the 7
patients in a table. Instead, I would want to print the information so that
it looks like this. I guess what I am asking is how does one use print() or
cat() to create a form letter.
data frame column names are dob, date.of.dx, registration.nr, first.name,
last.name, human.contact, comment...

Human subject 1
dob=5/5/2003, date.of.dx=5/8/2003, registration.nr=568956TJGH,
first.name=Farrel,
last.name=Buchinsky, human.contact=yes, comment=Spoke with human subject on
Tuesday December 27, 2008. They asked questions about the study and wanted
to enroll. I told them I would get back to them within a week,
date.enrolled=01/05/2009, wt=20 ...

Human Subject 2
dob=5/8/2006, date.of.dx=7/72007, registration.nr=579293TGGG,
first.name=Marmeduk,
last.name=Marmite, human.contact=yes, comment=parent bumped into me at
meeting and had lots of questions, we spoke for 2 hours, they lived in
Norway until 2  years ago, date.enrolled=01/23/2009, wt=10 ...

(by the way...all fictitious)


Farrel Buchinsky

Sent from Pittsburgh, Pennsylvania, United States

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reading from Google Spreadsheets with RGoogleDocs

2009-04-01 Thread Farrel Buchinsky
I cannot read google spreadsheets. I get the following error:

assignment of an object of class "NULL" is not valid for slot "access"
in an object of class "GoogleSpreadsheet"; is(value, "character") is
not TRUE

RGoogleDocs is on the cusp of brilliance. How can I troubleshoot this
apparently last remaining problem?

Farrel J. Buchinsky, MD
Director, Respiratory Papillomatosis Program
Allegheny-Singer Research Institute
320 E. North Avenue
Pittsburgh, PA 15212-4772

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-03-31 Thread Farrel Buchinsky
It worked. Thank you Gabor Grothendieck. I have very little idea of
what I did but I did it and it works. It is working well  when I limit
getDocs to documents only. However if I include everything in my
request or just limit it to spreadsheets  I get the following error.

getDocs(con, what =
"http://docs.google.com/feeds/documents/private/full/-/spreadsheet";)
assignment of an object of class "NULL" is not valid for slot "access"
in an object of class "GoogleSpreadsheet"; is(value, "character") is
not TRUE

Tried google searching and got nowhere.

Farrel Buchinsky
Google Voice Tel: (412) 567-7870



On Mon, Mar 2, 2009 at 22:16, Gabor Grothendieck
 wrote:
>
> Download and install each of R, Rtools and MiKTeX.
> Each of these have automated installers so its just a matter of
> pressing Enter repeatedly.
>
> You don't have to change your path if you place Rcmd.bat from
> http://batchfiles.googlecode.com
> anywhere on your path (so it can be found).  To see your path try
> this from the Windows console:
>
> path
>
> Finally enter into the Windows console:
>
> cd the.directory.containing.RGoogleDocs
> Rcmd build RGoogleDocs
> Rcmd INSTALL RGoogleDocs_1.0.0.tar.gz
>
> except replace RGoogleDocs_1.0.0.tar.gz with the filename
> created by the build.
>
> It should now be installed.
>
> On Mon, Mar 2, 2009 at 8:59 PM, Farrel Buchinsky  wrote:
> > I was able to extract RGoogleDocs with 7-zip. That was when I began to
> > appreciate the gravity of what Prof Ripley was saying. I am on a windows xp
> > machine and the RGoogleDocs download does not have a windows binary version.
> > Instead it has only a source package. I started using the R-admin manual to
> > step through the process and got nowhere in about 45 minutes. Then I tried
> > using the "automated package building
> > service<http://win-builder.r-project.org/>you could try." and got
> > nowhere because I did not know what "R CMD build" is.
> > Can I find someone to do it for me or can I find someone who will give me a
> > couple of basic steps at a time?
> >
> > I am desperate to say goodbye to individual static Microsoft Access or
> > Microsoft Excel spreadsheets being the repository for my data.
> >
> > Farrel Buchinsky
> > Sent from: Pittsburgh Pennsylvania United States.
> >
> >
> >>>
> >> Yes, you can install source packages on Windows: the R-admin manual gives
> >> you a detailed guide to the tools that you will need to do so.  It even
> >> tells you about an automated package building service you could try.
> >> RGoogleDocs depends on RCurl and XML, both of which I provide Windows
> >> binaries for (and are much trickier to install because of their external
> >> software requirements).
> >>
> >>
> >>  Farrel Buchinsky
> >>> GrandCentral Tel: (412) 567-7870
> >>>
> >>
> >> --
> >> Brian D. Ripley,                  rip...@stats.ox.ac.uk
> >> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> >> University of Oxford,             Tel:  +44 1865 272861 (self)
> >> 1 South Parks Road,                     +44 1865 272866 (PA)
> >> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> >>
> >
> >        [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] two different date formats in the same variable

2009-03-23 Thread Farrel Buchinsky
How does one convert to a date format when survey respondents have
used two different date formats whilst entering their data. There were
clearly told to use mm/dd/ but humans being humans some entered
mm/dd/yy. There was even validity checks on the forms but I allowed
them to be overridden since the data is more holy than the format.

The data was downloaded as a csv and read.csv was used to read in.
There are several date variables (for example date of birth, date of
diagnosis). Some became character vectors and others become factor
vectors. Nevertheless I have accomplished most of what I want using
lines such as

strptime(init.consent$consent.rec,"%m/%d/%Y")
strptime(x,"%m/%d/%Y")
 as.Date(x, "%m/%d/%Y")

But what happens when a few of the entries get messed up because they
are actually formatted %m/%d/%y.

Is there a robust date formatter? Alternatively how would one code
(presumably using regular expressions) a transforamtion or
substitution only on the errant entries and thereby turn 06/25/04 into
06/25/2004 and 03/03/59 into 03/03/1959?

sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32


Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] readline() is reading the entire line and not just the user input

2009-03-18 Thread Farrel Buchinsky
Indeed. I can also get it to work if I type directly in Rterm. But not when
running from Tinn-R. If this is a Tinn-R problem (relating to however
command lines get from Tinn-R to the Rterm) then perhaps I should post it in
the Tinn-R problem.
Farrel Buchinsky


Sent from: Pittsburgh Pennsylvania United States.

On Mon, Mar 16, 2009 at 13:08, jim holtman  wrote:

> Seems to work fine with RTERM under my Windows:
>
> > ANSWER <- readline(prompt="Are you a satisfied R user? ")
> Are you a satisfied R user? yes
> > ANSWER
> [1] "yes"
> >
>
> > sessionInfo()
> R version 2.8.1 (2008-12-22)
> i386-pc-mingw32
>
> On Mon, Mar 16, 2009 at 12:44 PM, Farrel Buchinsky 
> wrote:
> > I just discovered readline to provide user input. It is working as one
> > would expect in Rgui but not in Rterm. In Rterm it reads the entire
> > line of code not just the user input. How do I fix and what is the
> > issue that I should read about?
> >
> >
> > Here is my two line script:
> > ANSWER <- readline(prompt="Are you a satisfied R user? ")
> > ANSWER
> > So under RGUI one gets the following
> >> ANSWER <- readline(prompt="Are you a satisfied R user? ")
> > Are you a satisfied R user? yes
> >> ANSWER
> > [1] "yes"
> >
> > Under RTERM one gets
> >> ANSWER <- readline(prompt="Are you a satisfied R user? ")yes
> > Are you a satisfied R user?
> >> ANSWER
> > [1] "ANSWER <- readline(prompt=\"Are you a satisfied R user? \")yes"
> >
> > So I tried to hit enter after I saw the line in the terminal and this
> > is what I got:
> >
> >> ANSWER <- readline(prompt="Are you a satisfied R user? ")
> > Are you a satisfied R user?
> >> ANSWER
> > [1] "ANSWER <- readline(prompt=\"Are you a satisfied R user? \")"
> >
> > My R environment: Windows XP with service pack 3; R 2.8.1, tinn-R 2.2.0.2
> >
> >
> > Farrel Buchinsky
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem that you are trying to solve?
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] readline() is reading the entire line and not just the user input

2009-03-16 Thread Farrel Buchinsky
I just discovered readline to provide user input. It is working as one
would expect in Rgui but not in Rterm. In Rterm it reads the entire
line of code not just the user input. How do I fix and what is the
issue that I should read about?


Here is my two line script:
ANSWER <- readline(prompt="Are you a satisfied R user? ")
ANSWER
So under RGUI one gets the following
> ANSWER <- readline(prompt="Are you a satisfied R user? ")
Are you a satisfied R user? yes
> ANSWER
[1] "yes"

Under RTERM one gets
> ANSWER <- readline(prompt="Are you a satisfied R user? ")yes
Are you a satisfied R user?
> ANSWER
[1] "ANSWER <- readline(prompt=\"Are you a satisfied R user? \")yes"

So I tried to hit enter after I saw the line in the terminal and this
is what I got:

> ANSWER <- readline(prompt="Are you a satisfied R user? ")
Are you a satisfied R user?
> ANSWER
[1] "ANSWER <- readline(prompt=\"Are you a satisfied R user? \")"

My R environment: Windows XP with service pack 3; R 2.8.1, tinn-R 2.2.0.2


Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2009-03-02 Thread Farrel Buchinsky
I was able to extract RGoogleDocs with 7-zip. That was when I began to
appreciate the gravity of what Prof Ripley was saying. I am on a windows xp
machine and the RGoogleDocs download does not have a windows binary version.
Instead it has only a source package. I started using the R-admin manual to
step through the process and got nowhere in about 45 minutes. Then I tried
using the "automated package building
service<http://win-builder.r-project.org/>you could try." and got
nowhere because I did not know what "R CMD build" is.
Can I find someone to do it for me or can I find someone who will give me a
couple of basic steps at a time?

I am desperate to say goodbye to individual static Microsoft Access or
Microsoft Excel spreadsheets being the repository for my data.

Farrel Buchinsky
Sent from: Pittsburgh Pennsylvania United States.


>>
> Yes, you can install source packages on Windows: the R-admin manual gives
> you a detailed guide to the tools that you will need to do so.  It even
> tells you about an automated package building service you could try.
> RGoogleDocs depends on RCurl and XML, both of which I provide Windows
> binaries for (and are much trickier to install because of their external
> software requirements).
>
>
>  Farrel Buchinsky
>> GrandCentral Tel: (412) 567-7870
>>
>
> --
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] forward slash vs double backslash R and Tinn-R

2009-01-23 Thread Farrel Buchinsky
The only apparent reason for the failure is that the elegant line
using Sys.getenv denerates filenames with double backslashes instead
of forward slashes. I am working in Windows XP and I thought that R
could use double backslashes or a single forward slash.

So what am I not understanding about the whole slash thing?


Farrel Buchinsky




On Fri, Jan 23, 2009 at 11:10, Farrel Buchinsky  wrote:
> I installed the newest version of R and once again ran into problem
> with Tinn-R failing when trying to use the R explorer. I had this
> problem once before and solved it when I added the following
>
> .trPaths = c(
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/search.txt',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/objects.txt',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/file.r',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/selection.r',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/block.r',
> 'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/lines.r')
>
> The posted configuration file tries to accomplish this situation with
> .trPaths <- paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\',
> sep=''), c('', 'search.txt', 'objects.txt', 'file.r', 'selection.r',
> 'block.r', 'lines.r'), sep='')
>
> BUT IT FAILS.
>
>
> Farrel Buchinsky
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] forward slash vs double backslash R and Tinn-R

2009-01-23 Thread Farrel Buchinsky
I installed the newest version of R and once again ran into problem
with Tinn-R failing when trying to use the R explorer. I had this
problem once before and solved it when I added the following

.trPaths = c(
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/search.txt',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/objects.txt',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/file.r',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/selection.r',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/block.r',
'C:/Documents and Settings/fbuchins/Application Data/Tinn-R/tmp/lines.r')

The posted configuration file tries to accomplish this situation with
.trPaths <- paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\',
sep=''), c('', 'search.txt', 'objects.txt', 'file.r', 'selection.r',
'block.r', 'lines.r'), sep='')

BUT IT FAILS.


Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R "Threatens" SAS According to The NYT

2009-01-11 Thread Farrel Buchinsky
The article was dugg on Digg.
http://digg.com/software/Data_Analysts_Captivated_by_R_s_Power_3

If you Digg, why not digg this.

Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading from Google Docs

2008-12-15 Thread Farrel Buchinsky
I took the liberty of replacing all the xmlParse in auth.R with
xmlTreeParse. Alas still no joy.
getDocs(con)
Error in UseMethod("xpathApply") : no applicable method for "xpathApply"
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870




On Mon, Dec 15, 2008 at 20:00, Farrel Buchinsky  wrote:
> I have loaded the XML package. Should the function not be xmlTreeParse?
>
> Look at this
>> library(XML)
>
>> help(xmlParse)
> No documentation for 'xmlParse' in specified packages and libraries:
> you could try 'help.search("xmlParse")'
>
>> help.search("xmlParse")
> Help files with alias or concept or title matching 'xmlParse' using
> fuzzy matching:
>
>
>
> supportsExpat(XML)  Determines which native XML parsers are being
>used.
> xmlEventHandler(XML)Default handlers for the SAX-style event XML
>parser
> xmlParent(XML)  Get parent node of XMLInternalNode or ancestor
>nodes
> xmlStopParser(XML)  Terminate an XML parser
> xmlTreeParse(XML)   XML Parser
>
>
>
> Farrel Buchinsky
> GrandCentral Tel: (412) 567-7870
>
>
>
>
> On Mon, Dec 15, 2008 at 19:56, Duncan Temple Lang
>  wrote:
>>
>>
>> Farrel Buchinsky wrote:
>>>
>>> When I run>getDocs(con)
>>>
>>> I get this error:
>>> Error in getDocs(con) : could not find function "xmlParse"
>>>
>>> Where should xmlParse be coming from?
>>
>> From the XML package.
>>
>>
>>>
>>> You had asked where I got the idea to enter "con$getDocs()". I got it
>>> from run.html. But now that you bring the words "In the future, we
>>> might" to my attention I can see that I should not have tried it.
>>>
>>>
>>>
>>> Farrel Buchinsky
>>> GrandCentral Tel: (412) 567-7870
>>>
>>>
>>>
>>>
>>> On Mon, Dec 15, 2008 at 19:28, Duncan Temple Lang
>>>  wrote:
>>>>
>>>> Farrel Buchinsky wrote:
>>>>>
>>>>> Great. I have previously installed 7zip.
>>>>> It worked well. I installed the files. See below (way below).
>>>>>
>>>>> When I  entered >library(RGoogleDocs)
>>>>> it did not run.
>>>>> So I just ran auth.R
>>>>> Then I was able to run
>>>>> auth <-getGoogleAuth("fjb...@gmail.com","mypassword")
>>>>> con = getConnection(auth)
>>>>> con$getDocs()
>>>>> all worked until this point when I got
>>>>> Error in con$getDocs : $ operator not defined for this S4 class
>>>>>>
>>>>>> str(con)
>>>>>
>>>>> Formal class 'GoogleDocsConnection' [package ""] with 0 slots
>>>>>  list()
>>>>
>>>> If you use
>>>>
>>>>  getDocs(con)
>>>>
>>>> it should work, assuming auth and con are appropriate.
>>>>
>>>> Where did you see that
>>>>
>>>>
>>>>  con$getDocs()
>>>>
>>>> should work?
>>>> In the documentation file run.xml, there is the line
>>>>
>>>> "
>>>> In the future, we might provide an interface that avoids this such
>>>>
>>>> as
>>>>
>>>>  con$getDocs()
>>>> ...
>>>> "
>>>>
>>>> So, as it says, it is in the future.
>>>>
>>>>  D.
>>>>
>>>>
>>>>> I have just seen Prof Brian Ripley's correspondence. I had installed
>>>>> RCurl and XML from the Tinn-R "R controlling:packages" button. It
>>>>> appears to me that I need to check out R-admin manual.
>>>>> Is there a simple generic r script that I could run to determine if my
>>>>> RCurl and XML are running properly?
>>>>>
>>>>>
>>>>> 
>>>>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\
>>>>>
>>>>>
>>>>> 
>>>>> inst  
>>>>> 12/15/2008 17:27:57
>>>>> R 
>>>

Re: [R] Reading from Google Docs

2008-12-15 Thread Farrel Buchinsky
I have loaded the XML package. Should the function not be xmlTreeParse?

Look at this
> library(XML)

> help(xmlParse)
No documentation for 'xmlParse' in specified packages and libraries:
you could try 'help.search("xmlParse")'

> help.search("xmlParse")
Help files with alias or concept or title matching 'xmlParse' using
fuzzy matching:



supportsExpat(XML)  Determines which native XML parsers are being
used.
xmlEventHandler(XML)Default handlers for the SAX-style event XML
parser
xmlParent(XML)  Get parent node of XMLInternalNode or ancestor
nodes
xmlStopParser(XML)  Terminate an XML parser
xmlTreeParse(XML)   XML Parser



Farrel Buchinsky
GrandCentral Tel: (412) 567-7870




On Mon, Dec 15, 2008 at 19:56, Duncan Temple Lang
 wrote:
>
>
> Farrel Buchinsky wrote:
>>
>> When I run>getDocs(con)
>>
>> I get this error:
>> Error in getDocs(con) : could not find function "xmlParse"
>>
>> Where should xmlParse be coming from?
>
> From the XML package.
>
>
>>
>> You had asked where I got the idea to enter "con$getDocs()". I got it
>> from run.html. But now that you bring the words "In the future, we
>> might" to my attention I can see that I should not have tried it.
>>
>>
>>
>> Farrel Buchinsky
>> GrandCentral Tel: (412) 567-7870
>>
>>
>>
>>
>> On Mon, Dec 15, 2008 at 19:28, Duncan Temple Lang
>>  wrote:
>>>
>>> Farrel Buchinsky wrote:
>>>>
>>>> Great. I have previously installed 7zip.
>>>> It worked well. I installed the files. See below (way below).
>>>>
>>>> When I  entered >library(RGoogleDocs)
>>>> it did not run.
>>>> So I just ran auth.R
>>>> Then I was able to run
>>>> auth <-getGoogleAuth("fjb...@gmail.com","mypassword")
>>>> con = getConnection(auth)
>>>> con$getDocs()
>>>> all worked until this point when I got
>>>> Error in con$getDocs : $ operator not defined for this S4 class
>>>>>
>>>>> str(con)
>>>>
>>>> Formal class 'GoogleDocsConnection' [package ""] with 0 slots
>>>>  list()
>>>
>>> If you use
>>>
>>>  getDocs(con)
>>>
>>> it should work, assuming auth and con are appropriate.
>>>
>>> Where did you see that
>>>
>>>
>>>  con$getDocs()
>>>
>>> should work?
>>> In the documentation file run.xml, there is the line
>>>
>>> "
>>> In the future, we might provide an interface that avoids this such
>>>
>>> as
>>>
>>>  con$getDocs()
>>> ...
>>> "
>>>
>>> So, as it says, it is in the future.
>>>
>>>  D.
>>>
>>>
>>>> I have just seen Prof Brian Ripley's correspondence. I had installed
>>>> RCurl and XML from the Tinn-R "R controlling:packages" button. It
>>>> appears to me that I need to check out R-admin manual.
>>>> Is there a simple generic r script that I could run to determine if my
>>>> RCurl and XML are running properly?
>>>>
>>>>
>>>> 
>>>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\
>>>>
>>>>
>>>> 
>>>> inst  
>>>> 12/15/2008 17:27:57
>>>> R 
>>>> 12/15/2008 17:27:57
>>>> DESCRIPTION 777  9/24/2008
>>>> 12:47:59
>>>>
>>>>
>>>> 
>>>> 1 file(s), 2 folder(s)  777 bytes
>>>>
>>>>
>>>> 
>>>>
>>>>
>>>> 
>>>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\
>>>>
>>>>
>>>> 
>>&

Re: [R] Reading from Google Docs

2008-12-15 Thread Farrel Buchinsky
When I run>getDocs(con)

I get this error:
Error in getDocs(con) : could not find function "xmlParse"

Where should xmlParse be coming from?

You had asked where I got the idea to enter "con$getDocs()". I got it
from run.html. But now that you bring the words "In the future, we
might" to my attention I can see that I should not have tried it.



Farrel Buchinsky
GrandCentral Tel: (412) 567-7870




On Mon, Dec 15, 2008 at 19:28, Duncan Temple Lang
 wrote:
>
>
> Farrel Buchinsky wrote:
>>
>> Great. I have previously installed 7zip.
>> It worked well. I installed the files. See below (way below).
>>
>> When I  entered >library(RGoogleDocs)
>> it did not run.
>> So I just ran auth.R
>> Then I was able to run
>> auth <-getGoogleAuth("fjb...@gmail.com","mypassword")
>> con = getConnection(auth)
>> con$getDocs()
>> all worked until this point when I got
>> Error in con$getDocs : $ operator not defined for this S4 class
>>>
>>> str(con)
>>
>> Formal class 'GoogleDocsConnection' [package ""] with 0 slots
>>  list()
>
>
> If you use
>
>  getDocs(con)
>
> it should work, assuming auth and con are appropriate.
>
> Where did you see that
>
>
>   con$getDocs()
>
> should work?
> In the documentation file run.xml, there is the line
>
> "
> In the future, we might provide an interface that avoids this such
>
> as
>
>  con$getDocs()
> ...
> "
>
> So, as it says, it is in the future.
>
>  D.
>
>
>>
>> I have just seen Prof Brian Ripley's correspondence. I had installed
>> RCurl and XML from the Tinn-R "R controlling:packages" button. It
>> appears to me that I need to check out R-admin manual.
>> Is there a simple generic r script that I could run to determine if my
>> RCurl and XML are running properly?
>>
>> 
>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\
>>
>> 
>> inst  
>> 12/15/2008 17:27:57
>> R 
>> 12/15/2008 17:27:57
>> DESCRIPTION 777  9/24/2008
>> 12:47:59
>>
>> 
>> 1 file(s), 2 folder(s)  777 bytes
>>
>> 
>>
>> 
>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\
>>
>> 
>> doc   
>> 12/15/2008 17:27:57
>> sampleDocs
>> 12/15/2008 17:44:07
>>
>> 
>> 0 file(s), 2 folder(s)0 bytes
>>
>> 
>>
>> 
>> C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\doc\
>>
>> 
>> basics.html   5,867  9/24/2008
>> 11:27:38
>> basics.pdf8,873  9/24/2008
>> 11:30:51
>> basics.xml3,504  9/24/2008
>> 11:27:34
>> GNUmakefile  39  9/24/2008
>> 11:24:44
>> run.html 14,150  9/24/2008
>> 12:46:41
>> run.pdf  13,643  9/24/2008
>> 12:44:39
>> run.xml   9,257  9/24/2008
>> 12:44:23
>>
>> 
>> 7 file(s), 0 folder(s)   55,333 bytes
>>
>> 
>>
>> 
>> C:\Progra

Re: [R] Reading from Google Docs

2008-12-15 Thread Farrel Buchinsky
Great. I have previously installed 7zip.
It worked well. I installed the files. See below (way below).

When I  entered >library(RGoogleDocs)
it did not run.
So I just ran auth.R
Then I was able to run
auth <-getGoogleAuth("fjb...@gmail.com","mypassword")
con = getConnection(auth)
con$getDocs()
all worked until this point when I got
Error in con$getDocs : $ operator not defined for this S4 class
> str(con)
Formal class 'GoogleDocsConnection' [package ""] with 0 slots
 list()

I have just seen Prof Brian Ripley's correspondence. I had installed
RCurl and XML from the Tinn-R "R controlling:packages" button. It
appears to me that I need to check out R-admin manual.
Is there a simple generic r script that I could run to determine if my
RCurl and XML are running properly?

C:\Program Files\R\R-2.7.2\library\RGoogleDocs\

inst  
12/15/2008 17:27:57
R 
12/15/2008 17:27:57
DESCRIPTION 777  9/24/2008
12:47:59

1 file(s), 2 folder(s)  777 bytes


C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\

doc   
12/15/2008 17:27:57
sampleDocs
12/15/2008 17:44:07

0 file(s), 2 folder(s)0 bytes


C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\doc\

basics.html   5,867  9/24/2008
11:27:38
basics.pdf8,873  9/24/2008
11:30:51
basics.xml3,504  9/24/2008
11:27:34
GNUmakefile  39  9/24/2008
11:24:44
run.html 14,150  9/24/2008
12:46:41
run.pdf  13,643  9/24/2008
12:44:39
run.xml   9,257  9/24/2008
12:44:23

7 file(s), 0 folder(s)   55,333 bytes


C:\Program Files\R\R-2.7.2\library\RGoogleDocs\inst\sampleDocs\

SampleDoc.doc22,016  9/24/2008
12:44:23
SampleSpreadsheet.xls17,408  9/24/2008
12:44:23

2 file(s), 0 folder(s)   39,424 bytes


C:\Program Files\R\R-2.7.2\library\RGoogleDocs\R\

auth.R8,183  9/24/2008
12:44:23

1 file(s), 0 folder(s)8,183 bytes
========

Farrel Buchinsky
GrandCentral Tel: (412) 567-7870



On Mon, Dec 15, 2008 at 17:12, Gustavo Carvalho  wrote:
>
> Hello,
>
> You can probably extract a .tar.gz using 7zip on Windows.
>
> Regards,
>
> Gustavo.
>
> On Mon, Dec 15, 2008 at 8:07 PM, Farrel Buchinsky  wrote:
> > I saw a thread from September 24 in which Duncan Temple Lang told us:
> > - The package currently has no Rd files, but there is a brief "user's
> > guide". The package is available from
> > http://www.omegahat.org/RGoogleDocs
> >
> > I could not find it by using Tinn-R or RGui's package install tool.
> > Then when I went to the website I saw that package is only available
> > as
> > http://www.

[R] Reading from Google Docs

2008-12-15 Thread Farrel Buchinsky
I saw a thread from September 24 in which Duncan Temple Lang told us:
- The package currently has no Rd files, but there is a brief "user's
guide". The package is available from
 http://www.omegahat.org/RGoogleDocs

I could not find it by using Tinn-R or RGui's package install tool.
Then when I went to the website I saw that package is only available
as
http://www.omegahat.org/RGoogleDocs/RGoogleDocs_0.1-0.tar.gz

To my knowledge tar.gz is only for Linux. Does this mean that I cannot
run it on a windows machine. Please tell me that there is a way to run
it on a Windows machine.

Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] converting multiple columns from POSIX* to Date

2008-12-12 Thread Farrel Buchinsky
I got the whole thing to work, with Hadley Wickham's help.
is.POSIXt <- function(x) inherits(x, "POSIXt")
dates <- sapply(df, is.POSIXt)
df[dates] <-lapply(df[dates], as.Date)


Farrel Buchinsky




On Fri, Dec 12, 2008 at 11:26, Farrel Buchinsky  wrote:
>
> Something strange. The lapply only processed the first row and then wrote 
> that value to every row of the original dataframe. It is as if the lapply is 
> indeed processing every item on the list, namely each column, but the ifelse 
> or the as.Date is getting messed up. Not only is it only processing the first 
> row but it is also returning the value as numbers rather than dates. I am now 
> playing around with Hadley Wickham's plyr package. So far looking good but 
> still need to work out a few things.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] converting multiple columns from POSIX* to Date

2008-12-12 Thread Farrel Buchinsky
Something strange. The lapply only processed the first row and then wrote
that value to every row of the original dataframe. It is as if the lapply is
indeed processing every item on the list, namely each column, but the ifelse
or the as.Date is getting messed up. Not only is it only processing the
first row but it is also returning the value as numbers rather than dates. I
am now playing around with Hadley Wickham's plyr package. So far looking
good but still need to work out a few things.
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870



On Wed, Dec 10, 2008 at 19:08, Marc Schwartz wrote:

> Use inherits() then rather than class():
>
>  DF[] <- lapply(DF, function(x) ifelse(inherits(x, "POSIXt"),
>as.Date(x), x))
>
> That should hopefully work better than my first attempt.
>
> HTH,
>
> Marc Schwartz
>
> on 12/10/2008 05:47 PM Farrel Buchinsky wrote:
> > I will try that but I am somewhat skeptical since when I go
> > class(date.of.birth) I get not just one word but two:  "POSIXt"
> > "POSIXct". Will that not mess up the logical test
> >
> > When I tried the following:
> > lapply(as.list(dataframename),class)=="POSIXt"
> > every item was false
> >
> > Farrel Buchinsky
> > GrandCentral Tel: (412) 567-7870
> >
> >
> >
> >
> >
> >> Dear Farrel,
> >> Determine the class of each column and apply as.Date() just to those
> which
> >> class is POSIX. For more details see ?class. Here is an example assuming
> >> that you're data is named "mydata":
> >> apply(mydata, 2, function(x) ifelse( class(x)=="POSIXt" |
> >>  class(x)=="POSIXlt" , as.Date(x) , x ) )
> >>
> >> HTH,
> >>
> >> Jorge
> >>
> >>
> >>
> >> On Wed, Dec 10, 2008 at 6:26 PM, Farrel Buchinsky 
> wrote:
> >>> converting a POSIX class variable to a date class is easy.
> >>> dates<-as.Date(x) #where X is of class POSIX
> >>> How does one do that to all columns in a data frame that are of POSIX
> >>> class and leave all the other columns (integers, factors) as is.
> >>>
> >>> Feel free to reply with just one or two buzzwords that I could then
> >>> search for to find how to do it.
> >>>
> >>> Farrel Buchinsky
> >>>
> >>> __
> >>> R-help@r-project.org mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide
> >>> http://www.R-project.org/posting-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] converting multiple columns from POSIX* to Date

2008-12-10 Thread Farrel Buchinsky
I will try that but I am somewhat skeptical since when I go
class(date.of.birth) I get not just one word but two:  "POSIXt"
"POSIXct". Will that not mess up the logical test

When I tried the following:
lapply(as.list(dataframename),class)=="POSIXt"
every item was false

Farrel Buchinsky
GrandCentral Tel: (412) 567-7870





>
> Dear Farrel,
> Determine the class of each column and apply as.Date() just to those which
> class is POSIX. For more details see ?class. Here is an example assuming
> that you're data is named "mydata":
> apply(mydata, 2, function(x) ifelse( class(x)=="POSIXt" |
>  class(x)=="POSIXlt" , as.Date(x) , x ) )
>
> HTH,
>
> Jorge
>
>
>
> On Wed, Dec 10, 2008 at 6:26 PM, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
>>
>> converting a POSIX class variable to a date class is easy.
>> dates<-as.Date(x) #where X is of class POSIX
>> How does one do that to all columns in a data frame that are of POSIX
>> class and leave all the other columns (integers, factors) as is.
>>
>> Feel free to reply with just one or two buzzwords that I could then
>> search for to find how to do it.
>>
>> Farrel Buchinsky
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] converting multiple columns from POSIX* to Date

2008-12-10 Thread Farrel Buchinsky
converting a POSIX class variable to a date class is easy.
dates<-as.Date(x) #where X is of class POSIX
How does one do that to all columns in a data frame that are of POSIX
class and leave all the other columns (integers, factors) as is.

Feel free to reply with just one or two buzzwords that I could then
search for to find how to do it.

Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Power calculations where two samples are of unequal size

2008-12-09 Thread Farrel Buchinsky
I have used the function power.t.test() (power calculations for one
and two sample t tests) but have noted that it handles the samples as
being the same size. How does one handle sample sizes that are
different. In other words how does one handle unbalanced designs.

Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] outputting (writing) output into a dataframe

2008-10-28 Thread Farrel Buchinsky
I have solved this problem once before but don't recall exactly how.
Is there a url that shows how?

What I want to do now is quite specific but my query is actually very general

There are many functions in which one specifies several parameters and
an output is generated. Well what happens if one wants to specify a
range of parameters and have the output written to a data frame.

To demonstrate:

p1 <-15:25/100# so that I can vary the p1 from 0.15 to 0.25

for (i in p1)  print(power.prop.test(p1=i,p2=0.5*i,power=0.8, sig.level=0.05))

That prints a whole flurry of pretty outputs but I actually want it to
output into a data frame so that I can plot it?

Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Tinn-R explorer used to be my friend

2008-10-03 Thread Farrel Buchinsky
I got it to work. After many hours of agonizing. The answer was right
under my nose but there were a few complications.

https://sourceforge.net/forum/forum.php?forum_id=864071
How to install and configure Tinn-R 2.0.0.7 (XP and Vista)

If one just tries R>Configure>Permanent(Rprofile.site) then I do not
think one gets the right stuff. The right stuff is posted on the
forum.

One complication that I had at home is that my computer runs Vista and
it is a pain in the rear because of "user access control" which would
not let me save Rprofile.site. I got around that by opening Tinn-R as
"Run as administrator". I do not quite understand that because I am an
administrator on my machine. But who am I to ask questions --- it
works.

If you cannot do it I am quite prepared to show you using crossloop.
Farrel Buchinsky




On Fri, Oct 3, 2008 at 18:04, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
>
> I have upgraded everything lately and can no longer get the Tinn-R explorer 
> to work. I think I have had this problem before but cannot recall how I 
> solved it.
> I run Tinn-R 2.0.0.7 and Rgui version 2.7.2
> When I click on the explorer button I get
> > trObjList(envir='.GlobalEnv', pattern='', group='', path=.trPaths[3])
> Error in trObjList(envir = ".GlobalEnv", pattern = "", group = "", path = 
> .trPaths[3]) :
>   unused argument(s) (envir = ".GlobalEnv")
> I have ensured that the correct profile loads by using (from within Tinn-R) 
> R>Configure>Permanent(Rprofile.site).
> Is this a known bug or am I just getting tripped up.
> Farrel Buchinsky
> GrandCentral Tel: (412) 567-7870
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Tinn-R explorer used to be my friend

2008-10-03 Thread Farrel Buchinsky
I have upgraded everything lately and can no longer get the Tinn-R explorer
to work. I think I have had this problem before but cannot recall how I
solved it.I run Tinn-R 2.0.0.7 and Rgui version 2.7.2

When I click on the explorer button I get
> trObjList(envir='.GlobalEnv', pattern='', group='', path=.trPaths[3])
Error in trObjList(envir = ".GlobalEnv", pattern = "", group = "", path =
.trPaths[3]) :
  unused argument(s) (envir = ".GlobalEnv")

I have ensured that the correct profile loads by using (from within Tinn-R)
R>Configure>Permanent(Rprofile.site).

Is this a known bug or am I just getting tripped up.

Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reading OpenOffice Calc spreadsheet into R

2008-06-16 Thread Farrel Buchinsky
I am in awe of the project you developed but wish to do something simpler.
I have recently decided to give up on Microsoft Office and wish to use
OpenOffice exclusively. In the past I have used the RODBC package to
read data from excel files. Do you know how to read data directly from
OpenOffice calc files into R?

Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] using as.POSIXlt on multiple columns or multiple objects

2008-06-04 Thread Farrel Buchinsky
If I want to convert one column to date and time format that R can
understand and manipulate then I would do this

initial$Started<-as.POSIXlt(initial$Started)

But what happens if I have many such columns and I do not want to have
my code be stuffed with 10 similar lines (one for each variable aka
column aka vector aka object)

I thought I could be clear and use the list function and do this.
list(initial$Started ,initial$Finished,full.ques$started.ful
,full.ques$finished.ful) <- lapply(list(initial$Started
,initial$Finished,full.ques$started.ful
,full.ques$finished.ful),as.POSIXlt)

But I got:
Error in list(initial$Started, initial$Finished, full.ques$started.ful,  :
  could not find function "list<-"

I am clearly missing some basic R issue here. What am I missing?


--
Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Differentiate alphanumeric vs numeric strings

2008-04-25 Thread Farrel Buchinsky
This is fantastic.
As a future note to myself and to others who may stumble upon this:
further documentation for all one's heart could desire is in the base
help system at.

Regular Expressions as used in R - regexp

Pattern Matching and Replacement - grep

Split the Elements of a Character Vector  - strsplit

The following worked in my situation:
channel2007<-odbcConnectAccess("filename for 2007 data")
tables <-sqlTables(channel2007)[,3]
tables <-grep("[[:digit:]]",tables,value=TRUE)
all2007 <-sqlFetch(channel2007, tables[1])
for (f in tables[-1]) all2007<-rbind(all2007, sqlFetch(channel2007, f))

Thanks for your help



On Thu, Apr 24, 2008 at 11:34 PM, jim holtman <[EMAIL PROTECTED]> wrote:
> The following will return the indices or the values of character
> strings that are all numeric:
>
> > x <- c("12345", "123AS23", "A123", "398457")
> > grep("^[[:digit:]]*$", x)   # index
> [1] 1 4
> > grep("^[[:digit:]]*$", x, value=TRUE)   # values
> [1] "12345"  "398457"
>
>
>
> >
>
>
>
> On Thu, Apr 24, 2008 at 10:39 PM, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
> > I have a bunch of tables in a Microsoft Access database. An updated database
> > is sent to me every week containing a new table. I know that is inefficient
> > and weird but welcome to my life. I want to read the tables whose names are
> > something such as "040207" but not the ones that have alphanumeric names
> > such as "everyone". Using RODBC I am easily able to create a character
> > vector of the names of the tables. Is there a function that can
> > differentiate values consisting only of digits (numerics) as opposed to ones
> > that contain letters (and perhaps digts as well)? I am sure there is. What
> > is it and where should I have found it?
> >
> > --
> > Farrel Buchinsky
> > GrandCentral Tel: (412) 567-7870
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem you are trying to solve?
>



-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Differentiate alphanumeric vs numeric strings

2008-04-24 Thread Farrel Buchinsky
I have a bunch of tables in a Microsoft Access database. An updated database
is sent to me every week containing a new table. I know that is inefficient
and weird but welcome to my life. I want to read the tables whose names are
something such as "040207" but not the ones that have alphanumeric names
such as "everyone". Using RODBC I am easily able to create a character
vector of the names of the tables. Is there a function that can
differentiate values consisting only of digits (numerics) as opposed to ones
that contain letters (and perhaps digts as well)? I am sure there is. What
is it and where should I have found it?

-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] merging more than 2 data frames

2008-02-13 Thread Farrel Buchinsky
I have created a merged data frame and in turn merged that with another 
dataframe. I could see how it could become a pain if you had lots of 
dataframes. I would try running a for loop...but have never done it.

"joseph" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi
> merge() takes only 2 data frames. What can you do to it to make take more 
> than two data frames? or is there another function that does that?
> Thanks
> joseph
>
>
>
>
> 
> 
> Looking for last minute shopping deals?
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] genetics package not working

2008-02-11 Thread Farrel Buchinsky
Finally I found something that provides lower level examples.
I was looking around the genetics package. I came across 
write.pop.file(genetics) and there I found the format of 'pedigree' files is 
documented at http://www.sph.umich.edu/csg/abecasis/GOLD/docs/pedigree.html

That reference lays out exactly the format that is being used.


"Farrel Buchinsky" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> >From crawling around the internet it appears to me as if genetics has 
> >given
> way to GeneticsBase and is part of bioconductor. The basic data structure 
> has changed to something called geneSet class. There is a pdf document 
> that promises to help me. 
> http://www.bioconductor.org/packages/2.1/bioc/vignettes/GeneticsBase/inst/doc/SummaryTables.pdf.
>  
> Unfortunately it does not. My dataset which was created using genetics 
> package does not seem to fit (or should I say "does not seem to easily 
> fit") the read in formats demonstrated in the document: standard pedigree 
> format, hapmap format, Pfizer format, Perlegen format.
>
> Can anyone point me to a resource with lower level instructions and 
> examples?
>
> My format is as follows (rs numbers are not correct but do not worry about 
> that detail)
>> str(ped.seq[,2:15])
> 'data.frame':   608 obs. of  14 variables:
> $ pedigree  : int  1 1 2 3 3 4 4 5 6 6 ...
> $ id: Factor w/ 30 levels "1","2","3","4",..: 3 2 3 3 2 3 2 3 3 2 
> ...
> $ id.father : int  1 0 1 1 0 1 0 1 1 0 ...
> $ id.mother : int  2 0 2 2 0 2 0 2 2 0 ...
> $ PtCode: Factor w/ 608 levels "AJM16001FA","AJM16001MO",..: 74 73 77 
> 117 116 80 79 83 86 85 ...
> $ HS.nr : int  32940 32941 32960 32963 32964 32967 32968 32970 32972 
> 32973 ...
> $ affected  : int  2 1 2 2 1 2 1 2 2 1 ...
> $ sex   : int  2 2 1 1 2 1 2 2 2 2 ...
> $ rs11684: Factor w/ 1 level "C/C": 1 1 1 1 1 1 1 1 1 1 ...
>  ..- attr(*, "allele.names")= chr "C"
>  ..- attr(*, "allele.map")= chr [1, 1:2] "C" "C"
> $ rs1144: Factor w/ 3 levels "A/A","G/A","G/G": 3 3 3 3 3 2 3 3 3 3 ...
>  ..- attr(*, "allele.names")= chr  "G" "A"
>  ..- attr(*, "allele.map")= chr [1:3, 1:2] "A" "G" "G" "A" ...
> $ rs120: Factor w/ 2 levels "A/A","A/G": 1 1 1 1 1 1 1 1 1 1 ...
>  ..- attr(*, "allele.names")= chr  "A" "G"
>  ..- attr(*, "allele.map")= chr [1:2, 1:2] "A" "A" "A" "G"
>
>
>
> "Farrel Buchinsky" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Has something changed in R that requires an update in the genetics 
>> package
>> by Gregory Warnes? I am using R version 2.5.0
>> This used to work
>>> summary(founders[,59])
>>
>> to prove that it is  a genotype class
>>> class(founders[,59])
>> [1] "genotype" "factor"
>>
>> Now when I issue the command:
>>> summary(founders[,59])
>>
>> I get:
>>
>> Error in attr(retval, "which") <- which : attempt to set an attribute on
>> NULL
>> In addition: Warning message:
>> $ operator is deprecated for atomic vectors, returning NULL in:
>> x$allele.names
>>
>> Clearly, I am missing something. What am I missing?
>>
>> -- 
>> Farrel Buchinsky
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> [EMAIL PROTECTED] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide 
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> __
> [EMAIL PROTECTED] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Tinn-R not working well with latest R

2008-02-11 Thread Farrel Buchinsky
I can easily get R to open without an error. I simply removed the Tinn-R 
related lines from the Rprofile.site file
C:\Program Files\R-2.6.2\etc\Rprofile.site

but then when I try to manually load the svIDE library by entering 
library(svIDE) from the command line, I get a similar error.

So when you say "Than paste in the command", what command are you referring 
to?
What do you change it to?


"Schmitt, Corinna" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
>
> Hallo,
>
> I had the same problems before. I think the best solution is that you just 
> copy the needed codepart out of Tinn-R with Ctr+C. Then open R directly 
> from your desktop NOT from Tinn-R. Than paste in the command. you can 
> still make changes in the command when you have not pressed enter by using 
> the arrow buttons of the keyboard. put the curse where you want in the 
> command line and change it.
>
> Hope that is what you want. I cannot imitate your example.
>
> Corinna
>
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Tinn-R not working well with latest R

2008-02-11 Thread Farrel Buchinsky
I recently installed R 2.6.2 and am getting errors on startup that relate to
svIDE being loaded by Tinn-R.


Loading required package: tcltk
Loading Tcl/Tk interface ... done
Warning messages:
1: '\A' is an unrecognized escape in a character string
2: unrecognized escape removed from ";for Options\AutoIndent: 0=Off,
1=follow language scoping and 2=copy from previous line\n"
3: In grep(paste("[{]TclEval ", topic, "[}]", sep = ""), tclvalue(.Tcl("dde
services TclEval {}")), :
argument 'useBytes = TRUE' will be ignored
Loading required package: svMisc
Loading required package: R2HTML


Any idea what is going on.
I use R 2.6.2 on windows xp

I also started R without the profile that Tinn-R made.
If I manualy enter library(svIDE) then I get.
> library(svIDE)
Warning messages:
1: '\A' is an unrecognized escape in a character string
2: unrecognized escape removed from ";for Options\AutoIndent: 0=Off,
1=follow language scoping and 2=copy from previous line\n"

So the underlying problem may be svIDE
see: http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15738.html

Apparently, because of this error, several great features in Tinn-R are not
working properly.
Any solutions or workarounds?


-- 
Farrel

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Analyzing Publications from Pubmed via XML

2007-12-14 Thread Farrel Buchinsky
On Dec 13, 2007 11:35 PM, Robert Gentleman <[EMAIL PROTECTED]> wrote:
> or just try looking in the annotate package from Bioconductor
>

Yip. annotate seems to be the most streamlined way to do this.
1) How does one turn the list that is created into a dataframe whose
column names are along the lines of date, title, journal, authors etc
2) I have already created a standing search in pubmed using MyNCBI.
There are many ways I can feed those results to the pubmed() function.
The most brute force way of doing it is by running the search and
outputing the data as a UI List and getting that into the pubmed
brackets. A way that involved more finesse would allow me to create a
rss feed based on my search and then give the rss feed url to the
pubmed function. Or perhaps once could just plop the query inside the
pubmed functions
pubmed(somefunction("Laryngeal Neoplasms"[MeSH] AND "Papilloma"[MeSH])
OR ((("recurrence"[TIAB] NOT Medline[SB]) OR "recurrence"[MeSH Terms]
OR recurrent[Text Word]) AND respiratory[All Fields] AND
(("papilloma"[TIAB] NOT Medline[SB]) OR "papilloma"[MeSH Terms] OR
papillomatosis[Text Word])))

Does "somefunction" exist?

If there are any further questions do you think I should migrate this
conversation to the bioconductor mailing list?



Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Analyzing Publications from Pubmed via XML

2007-12-14 Thread Farrel Buchinsky
> The problem is that the RSS feed you linked to, does not contain the
> year of the article in an easily accessible XML element. Rather you
> have to process the HTML content of the description element - which,
> is something R could do, but you'd be using the wrong tool for the job.
>

Yes. I have noticed that there two sorts of xml that pubmed will
provide. The kind I had hooked into was an rss feed which provides a
lot of the information simply as a formatted table for viewing in a
rss reader. There is another way to get the xml to come out with more
tags. However, I found the best way to do this is probably through the
bioconductor annotate package

x <- pubmed("18046565", "17978930", "17975511")
a <- xmlRoot(x)
numAbst <- length(xmlChildren(a))
absts <- list()
for (i in 1:numAbst) {
absts[[i]] <- buildPubMedAbst(a[[i]])
   }

I am now trying to work through that approach to see what I can come up with.
-- 
Farrel Buchinsky

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Analyzing Publications from Pubmed via XML

2007-12-13 Thread Farrel Buchinsky
I am afraid not! The only thing I know about Python (or Perl, Ruby etc) is
that they exist and that I have been able to download some amazing freeware
or open source software thanks to their existence.
The XML package and specifically the xmlTreeParse function looks as if it is
begging to do the task for me. Is that not true?

On Dec 13, 2007 9:12 PM, Rajarshi Guha <[EMAIL PROTECTED]> wrote:

>
> On Dec 13, 2007, at 9:03 PM, Farrel Buchinsky wrote:
>
> > I would like to track in which journals articles about a particular
> > disease
> > are being published. Creating a pubmed search is trivial. The search
> > provides data but obviously not as an R dataframe. I can get the
> > search to
> > export the data as an xml feed and the xml package seems to be able
> > to read
> > it.
> >
> > xmlTreeParse("
> > http://eutils.ncbi.nlm.nih.gov/entrez/eutils/erss.cgi?
> > rss_guid=0_JYbpsax0ZAAPnOd7nFAX-29fXDpTk5t8M4hx9ytT-
> > ",isURL=TRUE)
> >
> > But getting from there to a dataframe in which one column would be
> > the name
> > of the journal and another column would be the year (to keep things
> > simple)
> > seems to be beyond my capabilities.
>
> If you're comfortable with Python (or Perl, Ruby etc), it'd be easier
> to just extract the required stuff from the raw feed - using
> ElementTree in Python makes this a trivial task
>
> Once you have the raw data you can read it into R
>
> ---
> Rajarshi Guha  <[EMAIL PROTECTED]>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
> ---
> A committee is a group that keeps the minutes and loses hours.
>-- Milton Berle
>
>
>


-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Analyzing Publications from Pubmed via XML

2007-12-13 Thread Farrel Buchinsky
I would like to track in which journals articles about a particular disease
are being published. Creating a pubmed search is trivial. The search
provides data but obviously not as an R dataframe. I can get the search to
export the data as an xml feed and the xml package seems to be able to read
it.

xmlTreeParse("
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/erss.cgi?rss_guid=0_JYbpsax0ZAAPnOd7nFAX-29fXDpTk5t8M4hx9ytT-
",isURL=TRUE)

But getting from there to a dataframe in which one column would be the name
of the journal and another column would be the year (to keep things simple)
seems to be beyond my capabilities.

Has anyone ever done this and could you share your script? Are there any
published examples where the end result is a dataframe.

I guess what I am looking for is an easy and simple way to parse the feed
and extract the data. Alternatively how does one turn an RSS feed into a CSV
file?

-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Incidentally, the feature becomes really powerful when one uses
functions such as addmargins together with prop.table as in

coinf.table <-as.matrix(coinfection)
prop.table(coinf.table,1) # to see proportions from each HPV type per study
addmargins(coinf.table)# to  see totals within study and accross all studies
prop.table(addmargins(coinf.table,1),1)# to see proportions for all
studies added together


On 10/3/07, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
> Genius! Thank you very much.
> Yes indeed I should have thought of that. For some reason I have a
> mental blank about the use of row.names and instead I repeatedly put
> that kind of data as a column in the data frame. Thank you for the
> rescue.
>


-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Genius! Thank you very much.
Yes indeed I should have thought of that. For some reason I have a
mental blank about the use of row.names and instead I repeatedly put
that kind of data as a column in the data frame. Thank you for the
rescue.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
No. Not really.What you have done seems to be similar to what I could do
with the reshape library.
rawer<-melt(coinfection,id.var="study") # please refer to my post
immediately before this.
I am still unable to make use of prop.table and margin.table functions.


On 10/3/07, Deepayan Sarkar <[EMAIL PROTECTED]> wrote:
>
> On 10/3/07, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
> > Your solution would work if the data frame contained the raw data. In
> that
> > case the table function as you outlined would be a table crossing all
> the
> > levels of column 1 with all the levels of column 2.
> > Instead my data frame is the table. It is an aggregate table (I may be
> using
> > the wrong buzzwords here).
>
> Does this help:
>
> > foo <- Titanic[,2,2,]
> > foo
>   Survived
> Class  No Yes
>   1st   4 140
>   2nd  13  80
>   3rd  89  76
>   Crew  3  20
> > bar <- as.data.frame.table(foo)
> > bar
>   Class Survived Freq
> 1   1st   No4
> 2   2nd   No   13
> 3   3rd   No   89
> 4  Crew   No3
> 5   1st  Yes  140
> 6   2nd  Yes   80
> 7   3rd  Yes   76
> 8  Crew  Yes   20
> > xtabs(Freq ~ Class + Survived, data = bar) # compare with foo
>   Survived
> Class   No Yes
>   1st4 140
>   2nd   13  80
>   3rd   89  76
>   Crew   3  20
>
> -Deepayan
>



-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Thank you. It comes close but not exactly what I wanted. I had to
scrap my column that contained character values. That column noted the
name of the study. Let me try show you here

Best if viewed in courier font

> coinfection
  study HPV6 HPV11 CoInfect other
1  Wiatrak 2004   31234 0
2 Draganov 20066143 0
3  Gabbott 1997   19241 0
4   Gerein 2005   17140 7
5  Michael 20058 50 1
6Rabah 2001   29320 0
7  Maloney 20064 47 0

> str(coinfection)
'data.frame':   7 obs. of  5 variables:
  $ study   : chr  "Wiatrak 2004" "Draganov 2006" "Gabbott 1997"
"Gerein 2005" ...
  $ HPV6: num  31 6 19 17 8 29 4
  $ HPV11   : num  23 14 24 14 5 32 4
  $ CoInfect: num  4 3 1 0 0 0 7
  $ other   : num  0 0 0 7 1 0 0

I had tried the following and was getting nowhere
> as.table(coinfection)
Error in as.table.default(coinfection) : cannot coerce into a table
> as.table(coinfection[,-1])
Error in as.table.default(coinfection[, -1]) :
cannot coerce into a table

Thanks to you was able to make some progress.

> as.table(as.matrix(coinfection))
  study HPV6 HPV11 CoInfect other
1 Wiatrak 2004  31   2340
2 Draganov 2006  6   1430
3 Gabbott 1997  19   2410
4 Gerein 2005   17   1407
5 Michael 2005   8501
6 Rabah 200129   3200
7 Maloney 2006   4470
SO FAR THIS LOOKS GOOD BUT THEN LOOK


> prop.table(as.table(as.matrix(coinfection)),1)#the main reason for doing this
Error in sum(..., na.rm = na.rm) : invalid 'type' (character) of argument

> prop.table(as.table(as.matrix(coinfection[,-1])),1)#this is to get rid of the 
> variable called "study"
HPV6  HPV11   CoInfect  other
1 0.53448276 0.39655172 0.06896552 0.
2 0.26086957 0.60869565 0.13043478 0.
3 0.43181818 0.54545455 0.02272727 0.
4 0.44736842 0.36842105 0. 0.18421053
5 0.57142857 0.35714286 0. 0.07142857
6 0.47540984 0.52459016 0. 0.
7 0.2667 0.2667 0.4667 0.

WORKS PERFECTLY, EXACTLY WHAT I WANTED EXCEPT I HAVE LOST THE NAME OF
THE STUDY AND HAVE TO GO BACK TO LOOK AT WHICH DATA BELONGS TO WHICH
STUDY. THIS WOULD NOT HAVE HAPPENED IF I HAD THE DATA IN ITS RAWEST
FORM: A TWO COLUMN DATA FRAME WHERE COLUMN ONE WAS THE STUDY AND
COLUMN 2 WAS A FACTOR (LEVELS BEING hpv 6, hpv 11, coinfection,
other). SUCH A DATA FRAME WOULD HAVE HAD 253 rows. Then I could have
used table(column1,column2) and I could have got all this data as a
table and the study name would be preserved. It is not that big a deal
that I have to look elsewhere to find the study name but it seems
silly that I cannot analyze data that is not in the raw state. I am
sure there is a way. I just do not know it.




On 10/3/07, Rolf Turner <[EMAIL PROTECTED]> wrote:
>
> I think that what you need to do is
>
> as.table(as.matrix(dff))
>
> E.g.
>
> melvin <- data.frame(x=c(3,1,3,2),y=c(3,3,4,5))
> clyde   <- as.table(as.matrix(melvin))
> prop.table(clyde,1)
>
>x y
> A 0.500 0.500
> B 0.250 0.750
> C 0.4285714 0.5714286
> D 0.2857143 0.7142857
>
> HTH.
>
> cheers,
>
> Rolf Turner
>
> ##
> Attention:
> This e-mail message is privileged and confidential. If you are not the
> intended recipient please delete the message and notify the sender.
> Any views or opinions presented are solely those of the author.
>
> This e-mail has been scanned and cleared by MailMarshal
> www.marshalsoftware.com
> ##
>



-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Your solution would work if the data frame contained the raw data. In that
case the table function as you outlined would be a table crossing all the
levels of column 1 with all the levels of column 2.
Instead my data frame is the table. It is an aggregate table (I may be using
the wrong buzzwords here).

Can I post an .Rdata file here? If so I would be able to show you what I
mean.

On 10/3/07, John Kane <[EMAIL PROTECTED]> wrote:
>
>
> --- Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
>
> > How do you create a table from a data frame? I tried
> > as.table(
> > name.of.data.frame) but it bombed out.
> > I will include the exact error message in my next
> > posting. If I recall
> > correctly, it said that the data.frame could not be
> > coerced to a table.
>
> I may have misunderstood you. I was just thinking that
> you could get individual tables of interest from
> data.frame dff by
> table(dff[,1],dff[,2]) and so on.
>
>
> >
> >
> > On 10/2/07, John Kane < [EMAIL PROTECTED]> wrote:
> > >
> > > What am I missing here?
> > >
> > > Cannot you just create the table from the
> > data.frame
> > > and apply prop.table()to it?
> > >
> > > --- Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
> > >
> > > > When one has raw data it is easy to create a
> > table
> > > > of one variable against
> > > > another and then calculate proportions
> > > > For example
> > > > a.nice.table<-table(a,b)
> > > > prop.table(a.nice.table,1)
> > > >
> > > > However, I looked at several papers and created
> > a
> > > > data frame of the
> > > > aggregate data. That means I acually created a
> > table
> > > > except it is a data
> > > > frame. The first column lists the name of the
> > first
> > > > author and the year.
> > > > I cannot find how to convert the data frame to a
> > > > table so I can use great
> > > > functions such as prop.table and margin.table.
> > > >
> > > > Alas I tried, rowSums but it provides lousy
> > output
> > > > without listing the names
> > > > of th papers.
> > > > I have thought of going through the reshape
> > package
> > > > but I suspect that there
> > > > is an easier way to convert a data frame to a
> > table.
> > > > Is there?
> > > >
> > > > --
> > > > Farrel Buchinsky
> > >
> > >
> > >
> > >  Be smarter than spam. See how smart SpamGuard
> > is at giving junk email
> > > the boot with the All-new Yahoo! Mail at
> > > http://mrd.mail.yahoo.com/try_beta?.intl=ca
> > >
> > >
> >
> >
> > --
> > Farrel Buchinsky
> > GrandCentral Tel: (412) 567-7870
> >
>
>
>
>  
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
> favourite sites. Download it now at
> http://ca.toolbar.yahoo.com.
>



-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Calculating proportions from a data frame rather than a table

2007-10-02 Thread Farrel Buchinsky
How do you create a table from a data frame? I tried as.table(
name.of.data.frame) but it bombed out.
I will include the exact error message in my next posting. If I recall
correctly, it said that the data.frame could not be coerced to a table.


On 10/2/07, John Kane <[EMAIL PROTECTED]> wrote:
>
> What am I missing here?
>
> Cannot you just create the table from the data.frame
> and apply prop.table()to it?
>
> --- Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
>
> > When one has raw data it is easy to create a table
> > of one variable against
> > another and then calculate proportions
> > For example
> > a.nice.table<-table(a,b)
> > prop.table(a.nice.table,1)
> >
> > However, I looked at several papers and created a
> > data frame of the
> > aggregate data. That means I acually created a table
> > except it is a data
> > frame. The first column lists the name of the first
> > author and the year.
> > I cannot find how to convert the data frame to a
> > table so I can use great
> > functions such as prop.table and margin.table.
> >
> > Alas I tried, rowSums but it provides lousy output
> > without listing the names
> > of th papers.
> > I have thought of going through the reshape package
> > but I suspect that there
> > is an easier way to convert a data frame to a table.
> > Is there?
> >
> > --
> > Farrel Buchinsky
>
>
>
>  Be smarter than spam. See how smart SpamGuard is at giving junk email
> the boot with the All-new Yahoo! Mail at
> http://mrd.mail.yahoo.com/try_beta?.intl=ca
>
>


-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Calculating proportions from a data frame rather than a table

2007-10-02 Thread Farrel Buchinsky
When one has raw data it is easy to create a table of one variable against
another and then calculate proportions
For example
a.nice.table<-table(a,b)
prop.table(a.nice.table,1)

However, I looked at several papers and created a data frame of the
aggregate data. That means I acually created a table except it is a data
frame. The first column lists the name of the first author and the year.
I cannot find how to convert the data frame to a table so I can use great
functions such as prop.table and margin.table.

Alas I tried, rowSums but it provides lousy output without listing the names
of th papers.
I have thought of going through the reshape package but I suspect that there
is an easier way to convert a data frame to a table. Is there?

-- 
Farrel Buchinsky

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] ifelse and dates do not work together: What workaround?

2007-09-27 Thread Farrel Buchinsky
I encountered the above problem. I went to the help files and
discovered the reason why. My insight as to why it was happening did
not immediately provide me with a solution by which I could accomplish
what I needed to do. I turned to the help archive. I encountered a
thread on which somebody pointed this problem out and was mildly
castigated for not having looked at the help file. Alas no workaround
was provided.

ifelse(test, yes, no) is wonderful since it works well in a dataframe
but only if yes and no are something simple, such as a numeric vector.
But if yes and no are dates then it does not work.

My workaround was quite inelegant.
Instead of the elegance of
official.date<-ifelse(is.na(x),dateyes,dateno)

I resorted to conditional indexing.
official.date<-dateno #only apporopriate when x is not missing
official.date[is.na(x)]<-dateyes[is.na(x)]


Original thread:
On Sat, 3 Jun 2006, ivo welch wrote:

> I wonder if this is an intentional feature or an oversight.

These are documented properties of the functions you are using.

> in some column summaries or in ifelse operations, apparently I am losing
> the date property of my vector.
>
...
>> ifelse( is.na(c), e, c )
> [1] 4017 4048 4076   # date property is lost

As documented. From ?ifelse:

Value:

  A vector of the same length and attributes (including class) as
  'test' and data values from the values of 'yes' or 'no'.  The mode
  of the answer will be coerced from logical to accommodate first
  any values taken from 'yes' and then any values taken from 'no'.

Note that the class is taken from 'test'.

> PS: this time I do not need help.  I can write my code around this.

Help in pointing you to the posting guide and its recommended reading of
the help page might still be helpful.





-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.