Some basic functionalities; strength of R is in its packages
Do all "coding" in RStudio; RStudio is not R, but it facilitates the use of R
Engel, C. A. (2019, February 4). R and Rstudio. GitHub. https://cengel.github.io/R-intro/backgroud.html.
Your working directory should now look like in the following Figure:
install.packages("readr")
install.packages("readxl")
library(readr)
library(readxl)
File/Environment -> Import Dataset -> From text, Excel……-> Enter a URL/file path
#Import a.csv data file
hrs = read.csv(“C:/HRS.csv”, header=T, sep=“,”)
# Look at the first 6 cases to check the data
head(hrs)
# Look at the last 6 cases to check the data
tail(hrs)
hrs.new = data.frame(hrs$DV, hrs$IV)
attach(hrs.new) # Attach the data to R’s memory for data exploration
plot(density(DV), main=“Density Plot: DV”, xlab=“DV”)
qqnorm(DV, main=“Population Dist. of DV”)
boxplot(DV, ylab=“DV”)
plot(edyrs,bmi,xlab=“IV”,ylab=“DV”)
