pkremp/polls

Error: unused arguments

Closed this issue · 2 comments

Initial error, Error: could not find function "recode":

(snip)
Downloaded http://elections.huffingtonpost.com/pollster/2016-west-virginia-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-wyoming-president-trump-vs-clinton.csv
Error: could not find function "recode"
Execution halted

Added "library(car)" to runmodel.R which provides the recode function.

Now fails with "unused arguments" error:

$ Rscript runmodel.R
Loading required package: ggplot2
Loading required package: StanHeaders
rstan (Version 2.12.1, packaged: 2016-09-11 13:07:50 UTC, GitRev: 85f7a56811da)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag

The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union

Attaching package: ‘tidyr’

The following object is masked from ‘package:rstan’:

extract

Attaching package: ‘purrr’

The following object is masked from ‘package:dplyr’:

order_by

Attaching package: ‘lubridate’

The following object is masked from ‘package:base’:

date

Loading required package: shiny

This is shinystan version 2.2.1

Attaching package: ‘car’

The following object is masked from ‘package:purrr’:

some

Downloaded http://elections.huffingtonpost.com/pollster/2016-general-election-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-alaska-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-alabama-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-arkansas-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-arizona-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-california-presidential-general-election-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-colorado-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-connecticut-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-delaware-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-florida-presidential-general-election-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-georgia-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-hawaii-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-iowa-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-idaho-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-illinois-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-indiana-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-kansas-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-kentucky-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-louisiana-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-massachusetts-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-maryland-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-maine-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-michigan-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-minnesota-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-missouri-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-mississippi-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-montana-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-north-carolina-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-north-dakota-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-nebraska-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-new-hampshire-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-new-jersey-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-new-mexico-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-nevada-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-new-york-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-ohio-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-oklahoma-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-oregon-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-pennsylvania-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-rhode-island-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-south-carolina-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-south-dakota-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-tennessee-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-texas-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-utah-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-virginia-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-vermont-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-washington-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-wisconsin-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-west-virginia-president-trump-vs-clinton.csv
Downloaded http://elections.huffingtonpost.com/pollster/2016-wyoming-president-trump-vs-clinton.csv
Error: unused arguments (Likely Voters = "0", Registered Voters = "1", Adults = "2")
Execution halted

WDee commented

Hey - recode is part of the dplyr package, but you want to make sure that you have the latest version (think it is 0.5.0 or something like that) - which is not installed if you use Rstudio install packages functionality, you have to download manually (the zip) (and then select the zip file with R studio) or use github to get the latest one).

Bingo! Thanks for the assist. Searching for "recode" brought up many references to the "car" R package, so I assumed that was the one. Removing "car" and installing "dplyr" corrected the issue.