From 985d23a52b76593a120adff5381c2df3a80fe298 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Wed, 23 Aug 2017 10:14:39 +0200 Subject: Fix a bunch of typos --- r.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'r.html.markdown') diff --git a/r.html.markdown b/r.html.markdown index 8539b10e..7a94ba05 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -192,7 +192,7 @@ class(-Inf) # "numeric" 2.0 * 2L # 4 # numeric times integer gives numeric 3L / 4 # 0.75 # integer over numeric gives numeric 3 %% 2 # 1 # the remainder of two numerics is another numeric -# Illegal arithmetic yeilds you a "not-a-number": +# Illegal arithmetic yields you a "not-a-number": 0 / 0 # NaN class(NaN) # "numeric" # You can do arithmetic on two vectors with length greater than 1, @@ -662,7 +662,7 @@ require(plyr) ######################### # "pets.csv" is a file on the internet -# (but it could just as easily be be a file on your own computer) +# (but it could just as easily be a file on your own computer) pets <- read.csv("http://learnxinyminutes.com/docs/pets.csv") pets head(pets, 2) # first two rows -- cgit v1.2.3 From b3cb49f69f0b4949c53339e0141011ff46612bbb Mon Sep 17 00:00:00 2001 From: Keith Miyake Date: Thu, 19 Oct 2017 23:14:24 -0700 Subject: [r/en] Fix read.csv per #2236 --- r.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'r.html.markdown') diff --git a/r.html.markdown b/r.html.markdown index 7a94ba05..e7486e60 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -663,7 +663,8 @@ require(plyr) # "pets.csv" is a file on the internet # (but it could just as easily be a file on your own computer) -pets <- read.csv("http://learnxinyminutes.com/docs/pets.csv") +require(RCurl) +pets <- read.csv(textConnection(getURL("http://learnxinyminutes.com/docs/pets.csv"))) pets head(pets, 2) # first two rows tail(pets, 1) # last row -- cgit v1.2.3 From 3dcb56bc220ce48e07f74ef2a912794480f884ea Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Fri, 2 Nov 2018 14:47:22 +0530 Subject: Fix R ggplot error, closes #2237 --- r.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'r.html.markdown') diff --git a/r.html.markdown b/r.html.markdown index e7486e60..a8b04be2 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -789,7 +789,7 @@ install.packages("ggplot2") require(ggplot2) ?ggplot2 pp <- ggplot(students, aes(x=house)) -pp + geom_histogram() +pp + geom_bar() ll <- as.data.table(list1) pp <- ggplot(ll, aes(x=time,price)) pp + geom_point() -- cgit v1.2.3 From de134e941b73f1f079aaa17dbe50605e6466d97d Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Thu, 28 Feb 2019 18:40:00 +0530 Subject: Fix #3479 Change `http` to `https`. --- r.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'r.html.markdown') diff --git a/r.html.markdown b/r.html.markdown index a8b04be2..3e855602 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -664,7 +664,7 @@ require(plyr) # "pets.csv" is a file on the internet # (but it could just as easily be a file on your own computer) require(RCurl) -pets <- read.csv(textConnection(getURL("http://learnxinyminutes.com/docs/pets.csv"))) +pets <- read.csv(textConnection(getURL("https://learnxinyminutes.com/docs/pets.csv"))) pets head(pets, 2) # first two rows tail(pets, 1) # last row -- cgit v1.2.3 From c351cab657897229e1d6b826a53399bca129b489 Mon Sep 17 00:00:00 2001 From: Hank Hester Date: Fri, 15 Jan 2021 02:30:42 -0800 Subject: Remove binary gender example from R (#4082) --- r.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'r.html.markdown') diff --git a/r.html.markdown b/r.html.markdown index 3e855602..79af40ce 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -255,16 +255,16 @@ c('Z', 'o', 'r', 'r', 'o') == "Z" # TRUE FALSE FALSE FALSE FALSE # FACTORS # The factor class is for categorical data -# Factors can be ordered (like childrens' grade levels) or unordered (like gender) -factor(c("female", "female", "male", NA, "female")) -# female female male female -# Levels: female male +# Factors can be ordered (like childrens' grade levels) or unordered (like colors) +factor(c("blue", "blue", "green", NA, "blue")) +# blue blue green blue +# Levels: blue green # The "levels" are the values the categorical data can take # Note that missing data does not enter the levels -levels(factor(c("male", "male", "female", NA, "female"))) # "female" "male" +levels(factor(c("green", "green", "blue", NA, "blue"))) # "blue" "green" # If a factor vector has length 1, its levels will have length 1, too -length(factor("male")) # 1 -length(levels(factor("male"))) # 1 +length(factor("green")) # 1 +length(levels(factor("green"))) # 1 # Factors are commonly seen in data frames, a data structure we will cover later data(infert) # "Infertility after Spontaneous and Induced Abortion" levels(infert$education) # "0-5yrs" "6-11yrs" "12+ yrs" -- cgit v1.2.3