Problem set #19 -- due Wednesday 5/10
1. Write a function called c_to_f in R that converts from
Celsius to Farenheit
2. Rewrite the following function in R so that it runs
faster (and is written more compactly):
length_normalize <- function(v) {
# normalize all the values in v by the sum of the
# values in the vector
sum <- 0
for(i in v){
sum <- sum + i
}
for(i in 1:length(v)){
v[i] <- v[i] / sum
}
return(v)
}