Archivo de etiquetas| R

Swirl part three: Course Structure

After starting swirl, a table of contents is displayed:

swirl_content

Swirl: First Steps

Learning R with Swirl.

Swirl is an R package which allow us to learn by practicing. The first step is installing Swirl:

install.packages(“swirl”)

We should make sure we have the correct version of Swirl:

packageVersion(“swirl”)

Load the package

library(“swirl”)

load_swirl

Start the Programming Course:

install_from_swirl(“R Programming”)

installed

Start Swirl:

swirl()

R Cheatsheet: Importing and Subsetting Data

Creating a data set from a file

z<-read.csv(“file.csv”)

Counting number of rows in a data set:

nrow(z)

Obtaining first n rows of a data set

head(z,2)

Obtaining last n rows of a data set

tail(z,2)

Excluding NA values from a data set and then calculating its mean

max_value_ozone_may<-max(na.exclude(ozone_values_may$Ozone))

Obtaining a subset with a condition

solar_mean_month_6<-z[(z$Month==6),]