Problem 1

Create a data frame “by hand” with the names, ages, and heights of your own family.

family <-data.frame(
  Names=c('Miko','Peach','Dodger','Gus'),
  Age=c(11,11,12,2),
  Height.in=c(13,12,14,16)
)
family
##    Names Age Height.in
## 1   Miko  11        13
## 2  Peach  11        12
## 3 Dodger  12        14
## 4    Gus   2        16

Problem 2

Calculate the mean age among your family.

mean(family$Age)
## [1] 9

Problem 3

I have a spreadsheet file hosted on GitHub at https://raw.githubusercontent.com/dereksonderegger/570L/master/data-raw/Example_1.csv. Because the readr package doesn’t care whether a file is on your local computer or on the Internet, we’ll use this file.

Start the import wizard using: “File -> Import Dataset -> From Text (readr) …” and input the above web URL. Click the update button near the top to cause the wizard to preview the result.

Save the generated code to your Rmarkdown file and show the first few rows using the head() command.

library(readr)
Example_1 <- read_csv("https://raw.githubusercontent.com/dereksonderegger/570L/master/data-raw/Example_1.csv")
## 
## ── Column specification ────────────────────────────────────────────────────────
## cols(
##   Girth = col_double(),
##   Height = col_double(),
##   Volume = col_double()
## )
head(Example_1)
## # A tibble: 6 x 3
##   Girth Height Volume
##   <dbl>  <dbl>  <dbl>
## 1   8.3     70   10.3
## 2   8.6     65   10.3
## 3   8.8     63   10.2
## 4  10.5     72   16.4
## 5  10.7     81   18.8
## 6  10.8     83   19.7

Published @ https://rpubs.com/chard/716338