tell us
write a little paragraph about the package that the function is from, what it does, and how it might be useful to other psychology students
read_sav is from the haven package. It lets users read SPSS data files (in the .sav data format) into RStudio.
show us
write a little demo to show how to install/load the package and use the function on some real data
install and load packages
To install packages, we use install.packages(). To load the package, we use library() function.
#install.packages("haven")
library(haven)get some data
I used my OSF data from the reproducibility project, but you can download any .sav file and save it in your working directory.
use the function
I've loaded the .sav file into RStudio under the dataframe name "data_example". The .sav file name needs to be contained within quotations marks when typing it in the read_sav() function.
data_example <- read_sav("Humiston & Wamsley 2019 data.sav")more resources
write a little paragraph about how you learned about the function- what did you google? Include a list of the documentation that you found useful andresources that someone learning about the function might need. If you can find pictures or memes to include, great!!
Using the help function in RStudio is a good starting place to learn the basics of any function and/or package. Simply type ?read_sav into the console and it will generate a brief explanation and some examples of how to use the function.
- This is a useful link to learn more about the
havenpackage from a tidyverse perspective. It gives instructions on how to install the package into RStudio and how to use the different functions that the package offers.