FAQ

This FAQ was compiled by Emily Huerta as a part of her UWEC Service Learning in Spring 2023.

Introduction to R and RStudio

  • Question: What are the keybindings to switch between the editor and console?

    • Answer: Ctrl + 1 and Ctrl 2. The first is the editor and the second is the console.
  • Question: Why won’t Canvas accept an R script file upload? (i.e., saved script saved in R Workspace).

    • Answer: The workspace is something different from an R Studio project file or an R script. In the editor, go to File -> Save As, and save it as an R file. This can then be uploaded to Canvas.
  • Question: R is not able to find or install haffutils, is there a link to download it?

    • Answer: Run this line in the R console: devtools::install_gitlab("mhaffner/haffutils").
  • Question: What do you do if your script won’t write to the Q-drive because it isn’t able to guess the driver? Is there a way to specifically define it?

    • Answer: Include the extension in the file name (e.g., “Q:/……../wi_data.geojson”). It will guess the driver if you have the extension, but you can specify the driver explicity if desired. However, there really isn’t a need for that. Keep in mind to look at the extension to be sure you have the right one.

Scales of measurement and Classification methods for mapping

  • Question: How do you change the background color of a plot with pretty_dens?

    • Answer: Use the fill argument passed to geom_density.

Central tendency over space, mapping and interpreting data

  • Question: How does MAUP relate to my results?

    • Answer: Larger spatial units of analysis cause correlation coeffecitients to increase. Any data aggregation aggects your results. Think of the example using Pearson’s r to compare results at the county vs. state level. How would correlation results compare to data collected at the individual level?

Hypothesis Testing (z-and-t-tests)

  • Question: How do you know whether to use lower.tail = TRUE or FALSE?

    • Answer: If you want everything to the left, use lower.tail = TRUE'. If you wnat everything to the right, uselower.tail = FALSE`, which gives you the upper tail.

Think about the area under a standard normal distribution (i.e., the percentage of data or probability) that lies to the left of a z-score that equals -1.3. Remember, be methodical and follow the four steps demonstrated in class (i.e., draw a picture, take a guess, compute, and compare).

  • Question: What are the uses of pnorm and qnorm?

    • Answer: pnorm is used for returning a percentage or the probability, whereas qnorm is used to find a z-score or a raw value. If you are trying to find a raw value (i.e., x), you also need to supply the mean and standard deviation.
  • Question: What function is used for two-tailed tests?

    -Answer: cor.test, where the default is a two-tailed test. If the confidence level is 95%, alpha is 0.05, meaning 0.05 is equally split between the two tails. Hint: Look at the p-value–if it is less than that, reject the null hypothesis.