StatsWithR / statsr

Companion package for the Coursera Statistics with R specialization
Other
69 stars 83 forks source link

bayes_inference() function throws error, claiming unused arguments. #14

Closed signorec closed 3 years ago

signorec commented 3 years ago

Dear statsr package administrator,

I am stuck with this statsr package when trying to run the bayes_inference() function for the Statistics in R specialisation. I have: o installed the package using the instructions on GitHub.

o reinstalled RStudio and the relevant packages as per the following (several times):

.... but to no avail.

Attached is a screenshot of my error. Screenshot RStudio Desktop - error and code chunk causing it

Also, and slightly removed, but very relevant to the current problem is that the lab link to the RStudio Cloud project for Bayesian Statistics module, Week 3 points to the Linear Regression lab. I tried to use this option after having no success with the above mentioned problem in RStudio Desktop but can't access the correct lab. Attached is a screenshot of that problem. Screenshot RStudio Cloud Environment with Wrong Course Project Screenshot RStudio Cloud - Coursera Link Page

Ideally, I would prefer to resolve the RStudio Desktop issue, since that is where I do all of my work. However I would also welcome the RStudio Cloud option if the appropriate person could fix that too.

I now have 18 back and forth emails with Coursera Help on this who have washed their hands of the problem and simply asked me to post to the Coursera course forum. However the forum is very inactive and in the meantime, I am wasting €44 per month on lost time, so I need to have this resolved quickly. Based on the inactivity of the forum it could be several months before a successful solution emerges. Note that the above installation steps came from another post on that forum but it is still not working.

Regards, Chris

merliseclyde commented 3 years ago

Chris,

Thanks for the feedback. As noted in the Introduction of the Chapter in the StatWithR book, the options in the code are in the development version of the package, which resides in the "BayesFactor" branch, so when installing from GitHub, you will need to specify this branch:

library(devtools) devtools::install_github("statswithr/statsr", ref="BayesFactor")

or with the gh_install_packages() function.

I believe what is leading to the error is that you are re-installing the version on CRAN, using the

install.packages("statsr")

If you drop that and load the BayesFactor branch of the package do you still have the errors?

signorec commented 3 years ago

Hi Dr. Clyde,

I've just tried reinstalling RStudio and running the following steps but am getting errors with the installation. Here's what happens:

library(devtools) Loading required package: usethis Warning messages: 1: package ‘devtools’ was built under R version 3.6.3 2: package ‘usethis’ was built under R version 3.6.3 install.packages("githubinstall") Installing package into ‘C:/Users/8570W/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/githubinstall_0.2.2.zip' Content type 'application/zip' length 68892 bytes (67 KB) downloaded 67 KB

package ‘githubinstall’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\8570W\AppData\Local\Temp\RtmpGcSWCI\downloaded_packages

library(githubinstall) Warning message: package ‘githubinstall’ was built under R version 3.6.3 gh_install_packages("statswithr/statsr", ref = "BayesFactor") Suggestion:

  • StatsWithR/statsr Companion package for the Coursera Statistics with R specialization Do you want to install the package (Y/n)? y Installing "StatsWithR/statsr", but already installed "statswithr/statsr". This package is already installed. Are you sure you want to overwrite it (Y/n)? y Downloading GitHub repo StatsWithR/statsr@BayesFactor √ checking for file 'C:\Users\8570W\AppData\Local\Temp\RtmpGcSWCI\remotes400c226ed55\StatsWithR-statsr-b1cfd3b/DESCRIPTION' (538ms)
  • preparing 'statsr': (1.5s) √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts (505ms)
  • checking for empty or unneeded directories
  • looking to see if a 'data/datalist' file should be added
  • building 'statsr_0.1-0.tar.gz'

Installing package into ‘C:/Users/8570W/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)

Installing package into ‘C:/Users/8570W/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)

I'm starting to wonder if the problem is different versions of R and / or RStudio? Do you know the known versions of these when the markdown file worked?

Also with the StatsWithR book, the link in the 2nd paragraph of the Preface in Bayesian Statistics book returns page not found: https://statswithr.github.io/book/index.html

I did manage to get to the book on GitHub, but I'm fairly new to GitHub so I'm not really sure how to convert all of the files listed into something that's easily readable.

Separately, to all of this, have you noticed the RStudio Cloud link in the lab doesn't direct us to the correct lab project. I was hoping that might provide a suitable workaround but unfortunately not.

So... still stuck. An Introduction to Bayesian Thinkinghttps://statswithr.github.io/book/index.html Preface. This book was written as a companion for the Course Bayesian Statistics from the Statistics with R specialization available on Coursera. Our goal in developing the course was to provide an introduction to Bayesian inference in decision making without requiring calculus, with the book providing more details and background on Bayesian Inference. statswithr.github.io


From: Merlise Clyde notifications@github.com Sent: 16 October 2020 15:27 To: StatsWithR/statsr statsr@noreply.github.com Cc: Christopher Signorelli x19181027@student.ncirl.ie; Author author@noreply.github.com Subject: Re: [StatsWithR/statsr] bayes_inference() function throws error, claiming unused arguments. (#14)

Chris,

Thanks for the feedback. As noted in the Introduction of the Chapter in the StatWithR book, the options in the code are in the development version of the package, which resides in the "BayesFactor" branch, so when installing from GitHub, you will need to specify this branch:

library(devtools) devtools::install_github("statswithr/statsr", ref="BayesFactor)

or with the gh_install_packages() function.

I believe what is leading to the error is that you are re-installing the version on CRAN, using the

install.packages("statsr")

If you drop that and load the BayesFactor branch of the package do you still have the errors?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/StatsWithR/statsr/issues/14#issuecomment-710080904, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARGSPC3DWOPU64H27AWE3E3SLBJ5TANCNFSM4STF6QCA.

signorec commented 3 years ago

Ok. So I've fixed the problem on my machine by first completely uninstalling R and RStudio, reinstalling the most recent versions and then executing the following lines in the console.

install.packages("tidyverse")

install.packages("statsr")

install.packages("PairedData")

install.packages("dplyr")

install.packages("ggplot2")

library(devtools)

devtools::install_github("statswithr/statsr", ref="BayesFactor")

remove.packages("statsr")

install.packages("githubinstall")

library(githubinstall)

gh_install_packages("statswithr/statsr", ref = "BayesFactor")