Name:
Andrew ID:
Collaborated with:

This lab is to be completed in class. You can collaborate with your classmates, but you must identify their names above, and you must submit your own lab as an Rmd file on Blackboard, by 11:59pm on the day of the lab.

Creating strings, counting characters

Vectors, matrices, conversions

nchar(1:5) 
## [1] 1 1 1 1 1
nchar(1e5)
## [1] 5
my.str = "My string goes here"
nchar(my.str)
## [1] 19
my.list = strsplit(my.str, split="")
my.chars = my.list[[1]]
head(my.chars, 20)
##  [1] "M" "y" " " "s" "t" "r" "i" "n" "g" " " "g" "o" "e" "s" " " "h" "e"
## [18] "r" "e"
length(my.chars)
## [1] 19
my.chartab = table(my.chars)
my.chartab
## my.chars
##   e g h i M n o r s t y 
## 3 3 2 1 1 1 1 1 2 2 1 1
plot(my.chartab, xlab="Characters", ylab="Counts")