Lets play a bit with the evl temp data using R and R studio download a copy of the evlWeatherForR.zip file and unzip it. set the working directory to the evlWeatherForR directory setwd(dir) test if thats correct with getwd() to get a listing of the directory use dir() read in one file evl2006 <- read.table(file = "history_2006.tsv", sep = "\t", header = TRUE) ... be careful to avoid smart quotes. You should now see evl2006 in the Global Environment at the upper right take a look at it evl2006 and then some commands to get an overal picture of the data: str(evl2006) summary(evl2006) head(evl2006) tail(evl2006) dim(evl2006) hmmm almost all the fields are integers including the hour and the temperature for the 7 different rooms, but Date is a factor - what is a factor? use the Help viewer in R-Studio. R assumes that this is categorical data and assigns an integer value to each unique string. convert the dates to internal format and remove the original dates newDates <- as.Date(evl2006$Date, "%m/%d/%Y") evl2006$newDate<-newDates evl2006$Date <- NULL if we use str(evl2006) again, now we have newDate in date format try doing some simple graphs and stats plot all temps in room 4 from 2006 using the built in plotting plot(evl2006$newDate, evl2006$S4, xlab = "Month", ylab = "Temperature") we can set the y axis to a fixed range for all temps in a given room plot(evl2006$newDate, evl2006$S4, xlab = "Month", ylab = "Temperature", ylim=c(65, 90)) the built in plotting it nice to get quick views but it isnt very powerful or very nice looking so now lets get the noon temp and plot it for one / all the rooms using ggplot if ggplot2 is not already installed then lets install it install.packages("ggplot2") and then lets load it in library(ggplot2) we want values from evl2006 where $hour is 12 noons <- subset(evl2006, Hour == 12) we can list all the noons for a particulate room noons$S2 note that you can see similar information in the environment panel at the upper right or plot them ggplot(noons, aes(x=newDate, y=S2)) + geom_point(color="blue") + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + geom_line() we can set the min and max and add some aesthetics ggplot(noons, aes(x=newDate, y=S2)) + geom_point(color="blue") + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + geom_line() + coord_cartesian(ylim = c(65,90)) add a smooth line through the data ggplot(noons, aes(x=newDate, y=S2)) + geom_point(color="blue") + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + geom_line() + coord_cartesian(ylim = c(65,90)) + geom_smooth() no points just lines and the smooth curve ggplot(noons, aes(x=newDate, y=S2)) + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + geom_line() + coord_cartesian(ylim = c(65,90)) + geom_smooth() just the smooth curve ggplot(noons, aes(x=newDate, y=S2)) + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + coord_cartesian(ylim = c(65,90)) + geom_smooth() we can show smooth curves for all of the rooms at noon at the same time ggplot(noons, aes(x=newDate)) + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + coord_cartesian(ylim = c(65,90)) + geom_smooth(aes(y=S2)) + geom_smooth(aes(y=S1)) + geom_smooth(aes(y=S3)) + geom_smooth(aes(y=S4)) + geom_smooth(aes(y=S5)) + geom_smooth(aes(y=S6))+ geom_smooth(aes(y=S7)) show smooth curves for all of the rooms at all hours at the same time ggplot(evl2006, aes(x=newDate)) + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") + coord_cartesian(ylim = c(65,85)) + geom_smooth(aes(y=S2)) + geom_smooth(aes(y=S1)) + geom_smooth(aes(y=S3)) + geom_smooth(aes(y=S4)) + geom_smooth(aes(y=S5)) + geom_smooth(aes(y=S6))+ geom_smooth(aes(y=S7)) we can play with the style of the points and make them blue ggplot(evl2006, aes(x=newDate, y=S4)) + geom_point(color="blue") + labs(title="Room Temperature in room ???", x="Day", y = "Degrees F") we can create a bar chart for all the temps for given room ggplot(evl2006, aes(x=factor(S4))) + geom_bar(stat="count", width=0.7, fill="steelblue") or just the noon temps (note that we only see temps that existed in the data so some temps may be 'missing' on the x axis (e.g. 79) ggplot(noons, aes(x=factor(S5))) + geom_bar(stat="count", fill="steelblue") we can do a better bar chart that treats the temperatures as numbers so there wont be any missing, and we can get control over the range of the x axis. temperatures <- as.data.frame(table(noons[,5])) temperatures$Var1 <- as.numeric(as.character(temperatures$Var1)) ggplot(temperatures, aes(x=Var1, y=Freq)) + geom_bar(stat="identity", fill="steelblue") + labs(x="Temperature (F)", y = "Count") + xlim(60,90) we can get a summary of the temperature data summary(temperatures) and then could create a box and whisker plot of those values to see their distribution ggplot(temperatures, aes(x = "", y = temperatures[,1])) + geom_boxplot() + labs(y="Temperature (F)", x="") + ylim(55,90) so we have a lot of options here. Shiny allows us to give a user access to do these things interactively on the web. Some things to be careful of: - be careful of smart quotes - be careful of commas, especially in the shiny code - remember to set your working directory in R Studio - try clearing out your R studio session regularly and running your code to make sure your code is self-contained using rm(list=ls()) - be careful of groupings to get your lines to connect the right way in charts - be careful what format your data is in - certain operations can only be performed on certain data types