Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## -----------------------------------------------------------------------------
library(rio)
library(haven)
## -----------------------------------------------------------------------------
gender <- haven::labelled(
c("M", "F", "F", "F", "M"),
c(Male = "M", Female = "F"))
## -----------------------------------------------------------------------------
rating <- sample(1:5)
attr(rating, "labels") <- c(c(Good = 1, Bad = 5))
## -----------------------------------------------------------------------------
mydata <- data.frame(gender, rating)
## -----------------------------------------------------------------------------
export(mydata, "mydata.sav")
restored_data <- rio::import("mydata.sav")
str(restored_data)
## -----------------------------------------------------------------------------
g <- rio::gather_attrs(restored_data)
str(g)
attr(g, "labels")
## ----include = FALSE----------------------------------------------------------
unlink("mydata.sav")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.