Tidyverse Question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tidyverse Question

Phillip Heinrich
Can someone out there run the following code from the book Analyzing Baseball Data with R – Chapter 7 page 164?

    library(tidyverse)
    db <- src_sqlite(“data/pitchrx.sqlite”,create=TRUE)

Over the past two weeks this code has run correctly twice but I have gotten the following error dozens of times:

    Error: Could not connect to database:
    unable to open database file

I’m trying to figure out if the problem is with my computer or if the tidyverse package has been revised since this book was written.  I got the same error when I loaded R onto my wife’s Mac.

The file pitchrx.sqlite loaded into my directory C:/Users/Owner/Documents.  The data file db contains four xml files used later in the analysis.

Thanks.
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Tidyverse Question

Ista Zahn
Hi Phillip,

On Mon, Mar 23, 2020 at 6:33 PM Phillip Heinrich <[hidden email]> wrote:

>
> Can someone out there run the following code from the book Analyzing Baseball Data with R – Chapter 7 page 164?
>
>     library(tidyverse)
>     db <- src_sqlite(“data/pitchrx.sqlite”,create=TRUE)
>
> Over the past two weeks this code has run correctly twice but I have gotten the following error dozens of times:
>
>     Error: Could not connect to database:
>     unable to open database file

Probably you working directory has no sub-directory named 'data'.

Best,
Ista

>
> I’m trying to figure out if the problem is with my computer or if the tidyverse package has been revised since this book was written.  I got the same error when I loaded R onto my wife’s Mac.
>
> The file pitchrx.sqlite loaded into my directory C:/Users/Owner/Documents.  The data file db contains four xml files used later in the analysis.
>
> Thanks.
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Tidyverse Question

Jeff Newmiller
In reply to this post by Phillip Heinrich
This is not a reproducible recipe. I am positive this is an operator error... not keeping current working directory in the same place, or failing to close the file when done.

On March 23, 2020 3:33:00 PM PDT, Phillip Heinrich <[hidden email]> wrote:

>Can someone out there run the following code from the book Analyzing
>Baseball Data with R – Chapter 7 page 164?
>
>    library(tidyverse)
>    db <- src_sqlite(“data/pitchrx.sqlite”,create=TRUE)
>
>Over the past two weeks this code has run correctly twice but I have
>gotten the following error dozens of times:
>
>    Error: Could not connect to database:
>    unable to open database file
>
>I’m trying to figure out if the problem is with my computer or if the
>tidyverse package has been revised since this book was written.  I got
>the same error when I loaded R onto my wife’s Mac.
>
>The file pitchrx.sqlite loaded into my directory
>C:/Users/Owner/Documents.  The data file db contains four xml files
>used later in the analysis.
>
>Thanks.
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>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.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Tidyverse Question

R help mailing list-2
In reply to this post by Ista Zahn
Dear Ista (and Phillip),

Ista, that's the exact same advice I gave Phillip over a week ago:

https://stat.ethz.ch/pipermail/r-help/2020-March/465994.html

Phillip, it doesn't make sense to post the same question under
different subject headings. While I'm convinced you're making a
sincere effort to learn R on your own--i.e. this isn't
homework--anyone trying to help you (Ista, Jeff, Bert, John, Stefan,
Duncan, etc.) will need feedback on what advice you've taken from
people on this list, and what the outcome was. So please provide it.

I do have one last suggestion, that you contact the author of the book
you're using to see if there has been an error in his/her coding
instructions. You can file an "Issue" on Github, and/or find the
author's email there and email him/her directly:

https://github.com/maxtoki/baseball_R
https://github.com/maxtoki

HTH, Bill.

W. Michels, Ph.D.





On Mon, Mar 23, 2020 at 3:37 PM Ista Zahn <[hidden email]> wrote:

>
> Hi Phillip,
>
> On Mon, Mar 23, 2020 at 6:33 PM Phillip Heinrich <[hidden email]> wrote:
> >
> > Can someone out there run the following code from the book Analyzing Baseball Data with R – Chapter 7 page 164?
> >
> >     library(tidyverse)
> >     db <- src_sqlite(“data/pitchrx.sqlite”,create=TRUE)
> >
> > Over the past two weeks this code has run correctly twice but I have gotten the following error dozens of times:
> >
> >     Error: Could not connect to database:
> >     unable to open database file
>
> Probably you working directory has no sub-directory named 'data'.
>
> Best,
> Ista
> >
> > I’m trying to figure out if the problem is with my computer or if the tidyverse package has been revised since this book was written.  I got the same error when I loaded R onto my wife’s Mac.
> >
> > The file pitchrx.sqlite loaded into my directory C:/Users/Owner/Documents.  The data file db contains four xml files used later in the analysis.
> >
> > Thanks.
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.