## example: Name
name <- "Ben"
name
## [1] "Ben"
## example: Place
## What is your favorite place? 
dreamPlace <- "A cool and sunny place"
dreamPlace 
## [1] "A cool and sunny place"
## 1. Convert degrees F to degrees C 
farenheit <- 70
centigrade <- (farenheit -32)/1.8
centigrade 
## [1] 21.11111
## Puppies
puppies <- 3
price <- 150
total <- puppies * price
max_puppies <- 1000 %/% price
max_puppies 
## [1] 6
## 2. Hometown 
hometown <- "New Taipei City"
library(stringr)
str_c(" My name is ", name, " and I am from ", hometown)
## [1] " My name is Ben and I am from New Taipei City"
## Logical variables 
too.expensive <- total > 1000
too.expensive 
## [1] FALSE
## Weather Forecast 
I_saw_raindrops <- FALSE
my_shoes_are_wet <- FALSE 
my_professor_is_soaked <- FALSE 
prRain <- (I_saw_raindrops + my_shoes_are_wet + my_professor_is_soaked)/3 
prRain 
## [1] 0
## More complex logical expression 
sad <- price > 100 & prRain > 0.5 
sad 
## [1] FALSE
## Extra task 
ft2cm <- 30.48
in2cm <- 2.54
height <- 177
ft <- height %/% ft2cm 
inch <- (height %% ft2cm)/2.54
cat(" My height is ", ft, "'", round(inch, 0), '"\n', sep="")
##  My height is 5'10"