Asking questions is an important part of this class. Remember the 15 minute rule:

Once you’ve spent 15 minutes attempting to troubleshoot a problem, you must ask for help.

Questions should be posted to the class discussion repo on GitHub. However, there are good and bad ways to ask questions. Here are some tips you should always follow when posting questions.

Introduce the problem with an informative title

  • Bad title: “I need help!”
  • Good title: “Getting a ‘file not found error’ when importing scotus.csv”

Be specific with your title. It should be brief, but also informative so that when others are looking at the Issues page (and they have a similar error and/or solution), they can easily find it.

Summarize the problem

Introduce the problem you are having. Include what task you are trying to perform, pertinent error messages, and any solutions you’ve already attempted. This helps us narrow down and troubleshoot your problem.

Include a reproducible example

Including a minimal, complete, and verifiable example of the code you are using greatly helps us resolve your problem. You don’t need to copy all the code from your program into the comment, but include enough code that we can run it successfully until the point at which the error occurs.

Along with this, make sure you have pushed your recent commits to the GitHub repo. If it is up-to-date, we can quickly look in or clone your repo to our machines to replicate the problem.

Format your code snippets

GitHub can easily format and highlight your code. This will make code blocks visually distinct from your written summary. For instance, this block of code is hard to see on this page:

library(twitteR)

source(“keys.R”)

setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)

data <- userTimeline(“realdonaldtrump”, n = 1000)

data2 <- twListToDF(data)

write.csv(data2, “data2.csv”)

Instead, format your code block by placing triple backticks ``` before and after the code block, like this:

```
library(twitteR)
source("keys.R")
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
data <- userTimeline("realdonaldtrump", n = 1000)
data2 <- twListToDF(data)
write.csv(data2, "data2.csv")
```

Which produces this:

library(twitteR)
source("keys.R")
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
data <- userTimeline("realdonaldtrump", n = 1000)
data2 <- twListToDF(data)
write.csv(data2, "data2.csv")

To get R-specific syntax highlighting, add the language identifier after the first set of backticks:

```r
library(twitteR)
source("keys.R")
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
data <- userTimeline("realdonaldtrump", n = 1000)
data2 <- twListToDF(data)
write.csv(data2, "data2.csv")
```

And get a prettier version:

library(twitteR)
source("keys.R")
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
data <- userTimeline("realdonaldtrump", n = 1000)
data2 <- twListToDF(data)
write.csv(data2, "data2.csv")

Include your session_info()

Sometimes problems are caused by using older or incompatible versions of packages. The session_info() function in the devtools library will print a list of all active packages and their respective versions. Include this in your post so we know which versions of packages you are using, like this:

devtools::session_info()
## Session info -------------------------------------------------------------
##  setting  value                       
##  version  R version 3.3.3 (2017-03-06)
##  system   x86_64, darwin13.4.0        
##  ui       RStudio (1.0.136)           
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  tz       America/Chicago             
##  date     2017-05-30
## Packages -----------------------------------------------------------------
##  package        * version    date       source                            
##  animation        2.5        2017-03-30 CRAN (R 3.3.2)                    
##  assertthat       0.2.0      2017-04-11 cran (@0.2.0)                     
##  backports        1.1.0      2017-05-22 CRAN (R 3.3.2)                    
##  base           * 3.3.3      2017-03-07 local                             
##  base64enc        0.1-3      2015-07-28 CRAN (R 3.3.0)                    
##  bigrquery      * 0.3.0      2016-06-28 CRAN (R 3.3.0)                    
##  bitops           1.0-6      2013-08-17 CRAN (R 3.3.0)                    
##  boot           * 1.3-19     2017-04-21 CRAN (R 3.3.2)                    
##  broom          * 0.4.2      2017-02-13 CRAN (R 3.3.2)                    
##  car              2.1-4      2016-12-02 CRAN (R 3.3.2)                    
##  caret          * 6.0-76     2017-04-18 CRAN (R 3.3.2)                    
##  cellranger       1.1.0      2016-07-27 CRAN (R 3.3.0)                    
##  class            7.3-14     2015-08-30 CRAN (R 3.3.3)                    
##  codetools        0.2-15     2016-10-05 CRAN (R 3.3.3)                    
##  colorspace       1.3-2      2016-12-14 CRAN (R 3.3.2)                    
##  config           0.2        2016-08-02 CRAN (R 3.3.0)                    
##  curl           * 2.6        2017-04-27 CRAN (R 3.3.2)                    
##  datasets       * 3.3.3      2017-03-07 local                             
##  DBI              0.6-1      2017-04-01 CRAN (R 3.3.2)                    
##  devtools         1.13.1     2017-05-13 CRAN (R 3.3.2)                    
##  digest           0.6.12     2017-01-27 CRAN (R 3.3.2)                    
##  dplyr          * 0.5.0      2016-06-24 CRAN (R 3.3.0)                    
##  e1071          * 1.6-8      2017-02-02 CRAN (R 3.3.2)                    
##  evaluate         0.10       2016-10-11 CRAN (R 3.3.0)                    
##  FNN            * 1.1        2013-07-31 CRAN (R 3.3.0)                    
##  forcats        * 0.2.0      2017-01-23 CRAN (R 3.3.2)                    
##  foreach        * 1.4.3      2015-10-13 CRAN (R 3.3.0)                    
##  foreign          0.8-68     2017-04-24 CRAN (R 3.3.2)                    
##  gam            * 1.14-4     2017-04-25 CRAN (R 3.3.2)                    
##  gapminder      * 0.2.0      2015-12-31 CRAN (R 3.3.0)                    
##  gbm            * 2.1.3      2017-03-21 CRAN (R 3.3.2)                    
##  geosphere        1.5-5      2016-06-15 CRAN (R 3.3.0)                    
##  gganimate      * 0.1.0.9000 2017-05-26 Github (dgrtwo/gganimate@bf82002) 
##  ggmap          * 2.7        2016-12-07 Github (dkahle/ggmap@c6b7579)     
##  ggplot2        * 2.2.1.9000 2017-05-12 Github (tidyverse/ggplot2@f4398b6)
##  ggrepel        * 0.6.5      2016-11-24 CRAN (R 3.3.2)                    
##  ggstance       * 0.3        2016-11-16 CRAN (R 3.3.2)                    
##  graphics       * 3.3.3      2017-03-07 local                             
##  grDevices      * 3.3.3      2017-03-07 local                             
##  grid             3.3.3      2017-03-07 local                             
##  gridExtra      * 2.2.1      2016-02-29 cran (@2.2.1)                     
##  gtable           0.2.0      2016-02-26 CRAN (R 3.3.0)                    
##  haven          * 1.0.0      2016-09-23 cran (@1.0.0)                     
##  here           * 0.0-6      2017-02-04 Github (krlmlr/here@007bfd9)      
##  hexbin         * 1.27.1     2015-08-19 CRAN (R 3.3.0)                    
##  highr            0.6        2016-05-09 CRAN (R 3.3.0)                    
##  hms              0.3        2016-11-22 CRAN (R 3.3.2)                    
##  htmltools        0.3.6      2017-04-28 cran (@0.3.6)                     
##  htmlwidgets      0.8        2016-11-09 CRAN (R 3.3.1)                    
##  httpuv           1.3.3      2015-08-04 CRAN (R 3.3.0)                    
##  httr           * 1.2.1      2016-07-03 CRAN (R 3.3.0)                    
##  igraph           1.0.1      2015-06-26 CRAN (R 3.3.0)                    
##  ISLR           * 1.0        2013-06-11 CRAN (R 3.3.0)                    
##  iterators        1.0.8      2015-10-13 CRAN (R 3.3.0)                    
##  janeaustenr      0.1.4      2016-10-26 CRAN (R 3.3.0)                    
##  jpeg             0.1-8      2014-01-23 cran (@0.1-8)                     
##  jsonlite       * 1.4        2017-04-08 cran (@1.4)                       
##  kknn           * 1.3.1      2016-03-26 CRAN (R 3.3.0)                    
##  knitr          * 1.16       2017-05-18 CRAN (R 3.3.2)                    
##  labeling         0.3        2014-08-23 CRAN (R 3.3.0)                    
##  lattice        * 0.20-35    2017-03-25 CRAN (R 3.3.2)                    
##  lazyeval         0.2.0      2016-06-12 CRAN (R 3.3.0)                    
##  lme4             1.1-13     2017-04-19 cran (@1.1-13)                    
##  lubridate      * 1.6.0      2016-09-13 CRAN (R 3.3.0)                    
##  lvplot         * 0.2.0.9000 2017-01-06 Github (hadley/lvplot@8ce61c7)    
##  magrittr         1.5        2014-11-22 CRAN (R 3.3.0)                    
##  mapproj          1.2-4      2015-08-03 CRAN (R 3.3.0)                    
##  maps           * 3.1.1      2016-07-27 CRAN (R 3.3.0)                    
##  MASS             7.3-47     2017-04-21 CRAN (R 3.3.2)                    
##  Matrix           1.2-10     2017-04-28 CRAN (R 3.3.2)                    
##  MatrixModels   * 0.4-1      2015-08-22 CRAN (R 3.3.0)                    
##  memoise          1.1.0      2017-04-21 CRAN (R 3.3.2)                    
##  methods        * 3.3.3      2017-03-07 local                             
##  mgcv             1.8-17     2017-02-08 CRAN (R 3.3.3)                    
##  microbenchmark * 1.4-2.1    2015-11-25 CRAN (R 3.3.0)                    
##  mime             0.5        2016-07-07 CRAN (R 3.3.0)                    
##  minqa            1.2.4      2014-10-09 cran (@1.2.4)                     
##  mnormt           1.5-5      2016-10-15 CRAN (R 3.3.0)                    
##  ModelMetrics     1.1.0      2016-08-26 CRAN (R 3.3.0)                    
##  modelr         * 0.1.0      2016-08-31 CRAN (R 3.3.0)                    
##  modeltools       0.2-21     2013-09-02 CRAN (R 3.3.0)                    
##  munsell          0.4.3      2016-02-13 CRAN (R 3.3.0)                    
##  nlme             3.1-131    2017-02-06 CRAN (R 3.3.3)                    
##  nloptr           1.0.4      2014-08-04 cran (@1.0.4)                     
##  NLP              0.1-10     2017-02-21 CRAN (R 3.3.2)                    
##  nnet           * 7.3-12     2016-02-02 CRAN (R 3.3.3)                    
##  nycflights13   * 0.2.2      2017-01-27 CRAN (R 3.3.2)                    
##  parallel       * 3.3.3      2017-03-07 local                             
##  pbkrtest         0.4-7      2017-03-15 CRAN (R 3.3.2)                    
##  plyr             1.8.4      2016-06-08 CRAN (R 3.3.0)                    
##  png              0.1-7      2013-12-03 cran (@0.1-7)                     
##  pROC           * 1.9.1      2017-02-05 CRAN (R 3.3.2)                    
##  profvis        * 0.3.3      2017-01-14 CRAN (R 3.3.2)                    
##  proto            1.0.0      2016-10-29 CRAN (R 3.3.0)                    
##  psych            1.7.5      2017-05-03 CRAN (R 3.3.3)                    
##  purrr          * 0.2.2.2    2017-05-11 CRAN (R 3.3.3)                    
##  quantreg       * 5.33       2017-04-18 CRAN (R 3.3.2)                    
##  R6               2.2.1      2017-05-10 CRAN (R 3.3.2)                    
##  randomForest   * 4.6-12     2015-10-07 CRAN (R 3.3.0)                    
##  rappdirs         0.3.1      2016-03-28 CRAN (R 3.3.0)                    
##  rcfss          * 0.1.4      2017-02-28 local                             
##  Rcpp             0.12.11    2017-05-22 CRAN (R 3.3.2)                    
##  readr          * 1.1.1      2017-05-16 CRAN (R 3.3.2)                    
##  readxl         * 1.0.0      2017-04-18 CRAN (R 3.3.2)                    
##  rebird         * 0.4.0      2017-04-26 CRAN (R 3.3.2)                    
##  reshape2         1.4.2      2016-10-22 CRAN (R 3.3.0)                    
##  RgoogleMaps      1.4.1      2016-09-18 cran (@1.4.1)                     
##  rjson            0.2.15     2014-11-03 cran (@0.2.15)                    
##  rlang            0.1.9000   2017-05-12 Github (hadley/rlang@c17568e)     
##  rmarkdown        1.5        2017-04-26 CRAN (R 3.3.2)                    
##  rprojroot        1.2        2017-01-16 CRAN (R 3.3.2)                    
##  rsconnect        0.8        2017-05-08 CRAN (R 3.3.2)                    
##  RSQLite        * 1.1-2      2017-01-08 CRAN (R 3.3.2)                    
##  rstudioapi       0.6        2016-06-27 CRAN (R 3.3.0)                    
##  rvest          * 0.3.2      2016-06-17 CRAN (R 3.3.0)                    
##  scales         * 0.4.1      2016-11-09 CRAN (R 3.3.1)                    
##  shiny          * 1.0.3      2017-04-26 CRAN (R 3.3.2)                    
##  slam             0.1-40     2016-12-01 CRAN (R 3.3.2)                    
##  SnowballC        0.5.1      2014-08-09 cran (@0.5.1)                     
##  sp               1.2-4      2016-12-22 CRAN (R 3.3.2)                    
##  sparklyr       * 0.5.5      2017-05-26 CRAN (R 3.3.3)                    
##  SparseM        * 1.77       2017-04-23 CRAN (R 3.3.2)                    
##  splines        * 3.3.3      2017-03-07 local                             
##  stats          * 3.3.3      2017-03-07 local                             
##  stats4           3.3.3      2017-03-07 local                             
##  stringi          1.1.5      2017-04-07 CRAN (R 3.3.2)                    
##  stringr        * 1.2.0      2017-02-18 CRAN (R 3.3.2)                    
##  survival       * 2.41-3     2017-04-04 CRAN (R 3.3.2)                    
##  tibble         * 1.3.1      2017-05-17 CRAN (R 3.3.2)                    
##  tidyr          * 0.6.3      2017-05-15 CRAN (R 3.3.2)                    
##  tidytext       * 0.1.2      2016-10-28 CRAN (R 3.3.0)                    
##  tidyverse      * 1.1.1      2017-01-27 CRAN (R 3.3.2)                    
##  titanic        * 0.1.0      2015-08-31 CRAN (R 3.3.0)                    
##  tm               0.7-1      2017-03-02 CRAN (R 3.3.2)                    
##  tokenizers       0.1.4      2016-08-29 CRAN (R 3.3.0)                    
##  tools            3.3.3      2017-03-07 local                             
##  topicmodels    * 0.2-6      2017-04-18 CRAN (R 3.3.2)                    
##  tree           * 1.0-37     2016-01-21 CRAN (R 3.3.0)                    
##  tweenr         * 0.1.5      2016-10-10 CRAN (R 3.3.0)                    
##  utils          * 3.3.3      2017-03-07 local                             
##  withr            1.0.2      2016-06-20 CRAN (R 3.3.0)                    
##  XML            * 3.98-1.7   2017-05-03 CRAN (R 3.3.2)                    
##  xml2           * 1.1.1      2017-01-24 CRAN (R 3.3.2)                    
##  xtable           1.8-2      2016-02-05 CRAN (R 3.3.0)                    
##  yaml             2.1.14     2016-11-12 cran (@2.1.14)

Post your solution

Once you have solved the problem (either by yourself or with the help of an instructor/classmate), post the solution. This let’s us know that you have fixed the issue AND if anyone else encounters a similar error, they can refer to your solution to fix their problem.

This work is licensed under the CC BY-NC 4.0 Creative Commons License.