April 2018
Intermediate to advanced
332 pages
8h 5m
English
In this step, we are going to do data munging. We are going to rewrite the values of the isRain column in such a way that we get a Yes or NO answer instead of the WeatherType:
# Map 1-based optional input ports to variables data <- maml.mapInputPort(1) # class: data.frame data$isRain[grepl(""RA"", data$isRain)] <- ""Yes"" data$isRain[grepl(""SN"", data$isRain)] <- ""Yes"" data$isRain[grepl(""DZ"", data$isRain)] <- ""Yes"" data$isRain[grepl(""PL"", data$isRain)] <- ""Yes"" data$isRain[data$isRain != ""Yes""] <- ""NO"" # Select data.frame to be sent to the output Dataset port maml.mapOutputPort(''data''); ...