if (!require(haven)){
install.packages("haven", dependencies = TRUE)
require(haven)
}Loading required package: haven
Haven enables R to read and write various data formats used by other statistical packages by wrapping the fantastic ReadStat C library written by Evan Miller. Haven is part of the tidyverse. Currently it supports:
SAS: read_sas() reads .sas7bdat + .sas7bcat files and read_xpt() reads SAS transport files (version 5 and version 8).
SPSS: read_sav() reads .sav files and read_por() reads the older .por files. write_sav() writes .sav files.
Stata: read_dta() reads .dta files (up to version 15). write_dta() writes .dta files (versions 8-15).
https://rdocumentation.org/packages/haven/versions/2.5.1
if (!require(haven)){
install.packages("haven", dependencies = TRUE)
require(haven)
}Loading required package: haven
The tidyverse is a set of packages that work in harmony because they share common data representations and API design. The tidyverse package is designed to make it easy to install and load core packages from the tidyverse in a single command. If you’d like to learn how to use the tidyverse effectively, the best place to start is R for data science.
https://rdocumentation.org/packages/tidyverse/versions/1.3.2
if (!require(tidyverse)){
install.packages("tidyverse", dependencies = TRUE)
require(tidyverse)
}Loading required package: tidyverse
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0 ✔ purrr 1.0.1
✔ tibble 3.1.8 ✔ dplyr 1.0.10
✔ tidyr 1.2.1 ✔ stringr 1.5.0
✔ readr 2.1.3 ✔ forcats 0.5.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
This R package simplifies the creation of .xlsx files by providing a high level interface to writing, styling and editing worksheets. Through the use of Rcpp, read/write times are comparable to the xlsx and XLConnect packages with the added benefit of removing the dependency on Java.
https://rdocumentation.org/packages/openxlsx/versions/4.2.5.1
if (!require(openxlsx)){
install.packages("openxlsx", dependencies = TRUE)
require(openxlsx)
}Loading required package: openxlsx
dataset.csv <- read_csv ("Harry Potter Data (1).csv")Rows: 124 Columns: 90
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (90): StartDate, EndDate, Status, IPAddress, Progress, Duration (in seco...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
dataset.xlsx <- read.xlsx ("Harry Potter Data.xlsx") dataset.spss <- read_sav("https://osf.io/download/kd4ej/")dataset.csv <- read_csv("https://osf.io/download/wtghz/")Rows: 124 Columns: 90
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (90): StartDate, EndDate, Status, IPAddress, Progress, Duration (in seco...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
dataset.xlsx <- read.xlsx("https://osf.io/download/7fz89/")Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
1 + 1[1] 2
You can add options to executable code like this
[1] 4
The echo: false option disables the printing of code (only output is displayed).