#survey_Q11-23_sensors_platforms.R source('~/Documents/Projects/sensor_survey/scripts/survey_data_prep.R') #### Information about sensors, platforms, and costs #### #### Q11. Does your lab use sensors #### summary_sensor_use <- summary(data_clean[,38]) summary_sensor_use #### Q12. Kinds of sensors #### havesensors <- data_clean[,39:46] #Remove rows where the answer to all eight questions is NA havesensors <- havesensors[-which(is.na(havesensors[,1]) & is.na(havesensors[,2]) & is.na(havesensors[,3]) & is.na(havesensors[,4]) & is.na(havesensors[,5]) & is.na(havesensors[,6]) & is.na(havesensors[,7]) & is.na(havesensors[,8])),] names(havesensors) <- c("Weather","Soil","Water","Spectral","GasAnalyzers","Cameras", "Sound","Animals") havesensors2 <- melt(havesensors) havesensors2[is.na(havesensors2)] <- 0 havesens_sum <- tapply(havesensors2$value, havesensors2$variable, sum) havesens_count <- tapply(havesensors2$value, havesensors2$variable, count) colSums(havesens_count$Weather) havesens_summary <- summary(havesensors2) havesens_summary #### Q19. Want to add kinds of sensors ##### newsensors <- data_clean[,60:67] newsensors <- newsensors[-which(is.na(newsensors[,1]) & is.na(newsensors[,2]) & is.na(newsensors[,3]) & is.na(newsensors[,4]) & is.na(newsensors[,5]) & is.na(newsensors[,6]) & is.na(newsensors[,7]) & is.na(newsensors[,8])),] names(newsensors) <- c("Weather","Soil","Water","Spectral","GasAnalyzers","Cameras", "Sound","Animals") newsensors2 <- melt(newsensors) newsensors2[is.na(newsensors2)] <- 0 plot_newsensors <- ggplot(newsensors2, aes(x = reorder(variable, -value), y= value)) + geom_bar(stat = "identity", width = 0.7, fill = "gray") + geom_point(color = "red") + xlab("") + ylab("Total # Sensors") + coord_cartesian(ylim = c(0, 3000)) + theme_bw() + theme(axis.text.x = element_text(angle = 45, hjust = 1, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_newsensors.jpg", plot = plot_newsensors, width = 6.5, height = 4, units = "in", dpi = 300) plot_newsensors newsens_summary <- tapply(newsensors2$value, newsensors2$variable, sum) newsens_summary #### Q18. Do you want to add sensors? ##### wantsensors <- data.frame(answer = mapvalues(data_clean[,59], from = c("I don't want to add any sensors to my research", "I would like to add sensors to my current study area", "I would like to both add sensors to my current study area and expand the spatial range of my studies with sensors.", "I would like to expand the spatial range of my studies with sensors"), to = c("No additional", "Add to study area", "Add and expand", "Expand"))) wantsensors <- unique(ddply(wantsensors, "answer", function(x) data.frame(x, count=nrow(x)))) wantsensors$percent <- wantsensors$count/sum(wantsensors$count) * 100 wantsensors <- wantsensors[which(wantsensors$answer != ""),] plot_wantsensors <- ggplot(wantsensors, aes(x = answer, y = percent)) + geom_bar(stat = "identity",colour = "black", fill = "gray") + geom_text(aes(label = paste(count, "\n (", round(percent, 1), "%)", sep = ""), y = percent), size = 5, vjust = 1.2) + xlab("") + theme_bw() + coord_cartesian(ylim = c(0,35)) + theme(axis.text.x = element_text(angle = 0, hjust = 0.5, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_wantsensors.jpg", plot = plot_wantsensors, width = 6.5, height = 4, units = "in", dpi = 300) plot_wantsensors #### Compare what sensors labs have and what they want #### sensor_diff <- as.data.frame(cbind(t(t(havesens_sum)), t(t(newsens_summary)))) sensor_diff$sums <- rowSums(sensor_diff[,1:2]) sensor_diff$percent_diff <- sensor_diff$sums/sensor_diff[,1] * 100 ggplot(sensor_diff, aes(x = reorder(row.names(sensor_diff), -percent_diff), y = percent_diff)) + geom_bar(stat = "identity") + xlab("") + ylab("percent") #### Compare have vs want sensors #### sens <- data_clean[ ,c(3, 39:46, 60:67)] names(sens) <- c("RespondentID", "Weather","Soil","Water","Spectral","GasAnalysis", "DigitalImages","Sound","AnimalTracking","Weather","Soil","Water", "Spectral","GasAnalysis","DigitalImages","Sound","AnimalTracking") senshave <- melt(sens[,1:9], id.vars = "RespondentID", measure.vars = names(sens)[2:9], variable.name = "sensor_type", value.name = "have") senswant <- melt(sens[, c(1, 10:17)], id.vars = "RespondentID", measure.vars = names(sens)[10:17], variable.name = "sensor_type", value.name = "want") sensboth <- merge(senshave, senswant, by = c("RespondentID", "sensor_type")) #Remove rows where the answer to all questions is NA sensboth <- sensboth[-which(is.na(sensboth[,3]) & is.na(sensboth[,4])), ] #Assumptions: 1) if there was a value for "have" and NA for "want", then they don't want to #expand - they want what they already have. 2) if there was a value for "want" and an #NA for "have" then they currently have 0. sensboth$want[which(is.na(sensboth$want))] <- sensboth$have[which(is.na(sensboth$want))] sensboth$have[which(is.na(sensboth$have))] <- 0 sens_summ <- ddply(sensboth[,2:4], .(sensor_type), summarize, have = sum(have), want = sum(want), diff_percent = round(want/have * 100, 1)) sens_summ <- sens_summ[order(sens_summ$diff_percent, decreasing = TRUE), ] sens_summ_melt <- melt(sens_summ[,1:3], id.vars = "sensor_type", variable.name = "have_or_want", value.name = "number") plot_sensors <- ggplot(sens_summ_melt, aes(x = sensor_type, y = number, fill = have_or_want, label = number)) + geom_bar(stat = "identity", width = 0.7) + geom_bar(stat = "identity", width = 0.7, color = "black", show_guide=TRUE) + coord_flip(ylim = c(0,8000)) + xlab("") + ylab("Number of sensors") + theme_bw() + scale_fill_manual(values = c("#0DA6F0", "#F0D20D")) + scale_x_discrete(limits=c("Sound","DigitalImages","GasAnalysis", "Spectral","Water","AnimalTracking","Weather","Soil"), labels = c("Record sound","Take digital images", "Record gas fluxes", "Record radiance & irradiance", "Monitor water","Monitor animals","Monitor weather", "Monitor soil")) + theme(axis.text.x = element_text(family = "Helvetica", size = 11, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 11, color = "black"), legend.title = element_blank(), legend.text = element_text(family = "Helvetica", size = 11, color = "black"), legend.justification=c(0,0), legend.position=c(.75,0), legend.background = element_rect(fill="gray95", size=.5, linetype="solid", colour = "black"), plot.margin=unit(c(.1,.5,0,0),units="cm")) ggsave(filename = "plots/sensors_have_want.eps", plot = plot_sensors, width = 6.5, height = 2, units = "in", bg = "white", colormodel = "cymk") plot_sensors #### Q14. Kinds of platforms #### haveplatforms <- data_clean[,48:55] for (i in ncol(haveplatforms)){ haveplatforms[,i] <- as.numeric(as.character(haveplatforms[,i])) } haveplatforms <- haveplatforms[-which(is.na(haveplatforms[,1]) & is.na(haveplatforms[,2]) & is.na(haveplatforms[,3]) & is.na(haveplatforms[,4]) & is.na(haveplatforms[,5]) & is.na(haveplatforms[,6]) & is.na(haveplatforms[,7]) & is.na(haveplatforms[,8])),] names(haveplatforms) <- c("UAV","ULV","EddyTower","ShortTower","Tram","Buoy", "Surface","Animals") haveplatforms2 <- melt(haveplatforms) haveplatforms2[is.na(haveplatforms2)] <- 0 haveplat_sum <- tapply(haveplatforms2$value, haveplatforms2$variable, sum) haveplat_count <- tapply(haveplatforms2$value, haveplatforms2$variable, count) haveplat_summary <- tapply(haveplatforms2$value, haveplatforms2$variable, sum) haveplat_summary plot_havePlatforms_bar <- ggplot(haveplatforms2, aes(x = reorder(variable, -value), y= value)) + geom_bar(stat = "identity", width = 0.7, fill = "gray") + geom_point(color = "red") + xlab("") + ylab("Total # Platforms") + coord_cartesian(ylim = c(0,1200)) + theme_bw() + theme(axis.text.x = element_text(angle = 0, hjust = 0.5, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_havePlatforms_bar.jpg", plot = plot_havePlatforms_bar, width = 6.5, height = 4, units = "in", dpi = 300) plot_havePlatforms_bar #### Q21. Want platforms #### wantplatforms <- data_clean[,69:76] wantplatforms <- wantplatforms[-which(is.na(wantplatforms[,1]) & is.na(wantplatforms[,2]) & is.na(wantplatforms[,3]) & is.na(wantplatforms[,4]) & is.na(wantplatforms[,5]) & is.na(wantplatforms[,6]) & is.na(wantplatforms[,7]) & is.na(wantplatforms[,8])),] names(wantplatforms) <- c("UAV","ULV","EddyTower","ShortTower","Tram","Buoy", "Surface","Animals") wantplatforms2 <- melt(wantplatforms) wantplatforms2[is.na(wantplatforms2)] <- 0 ggplot(wantplatforms2, aes(x = reorder(variable, -value), y= value)) + geom_bar(stat = "identity") + geom_point(color = "red") + xlab("") + ylab("Total # Platforms") + theme(axis.text.x = element_text(angle = 45, hjust = 1)) wantplat_summary <- tapply(wantplatforms2$value, wantplatforms2$variable, sum) wantplat_summary #### Compare what platforms labs have and what they want. #### platform_diff <- as.data.frame(cbind(t(t(haveplat_summary)), t(t(wantplat_summary)))) platform_diff$sums <- rowSums(platform_diff[,1:2]) platform_diff$percent_diff <- platform_diff$sums/platform_diff[,1] * 100 ggplot(platform_diff, aes(x = reorder(row.names(platform_diff), -percent_diff), y = percent_diff)) + geom_bar(stat = "identity") + xlab("") + ylab("percent") #### Compare have vs want platforms #### plats <- data_clean[ ,c(3, 48:55, 69:76)] names(plats) <- c("RespondentID", "UAVs","ULVs","EddyTowers","ShortTowersTripods", "Trams","Buoys","Surface","Animals", "UAVs","ULVs","EddyTowers", "ShortTowersTripods","Trams","Buoys","Surface","Animals") platshave <- melt(plats[,1:9], id.vars = "RespondentID", measure.vars = names(plats)[2:9], variable.name = "platform_type", value.name = "have") platswant <- melt(plats[, c(1, 10:17)], id.vars = "RespondentID", measure.vars = names(plats)[10:17], variable.name = "platform_type", value.name = "want") platsboth <- merge(platshave, platswant, by = c("RespondentID", "platform_type")) #Remove rows where the answer to all questions is NA platsboth <- platsboth[-which(is.na(platsboth[,3]) & is.na(platsboth[,4])), ] #Assumptions: 1) if there was a value for "have" and NA for "want", then they don't want to #expand - they want what they already have. 2) if there was a value for "want" and an #NA for "have" then they currently have 0. platsboth$want[which(is.na(platsboth$want))] <- platsboth$have[which(is.na(platsboth$want))] platsboth$have[which(is.na(platsboth$have))] <- 0 plats_summ <- ddply(platsboth[,2:4], .(platform_type), summarize, have = sum(have), want = sum(want), diff_percent = round(want/have * 100, 1)) plats_summ <- plats_summ[order(plats_summ$diff_percent, descending = TRUE), ] plats_summ_melt <- melt(plats_summ[,1:3], id.vars = "platform_type", variable.name = "have_or_want", value.name = "number") plot_platforms <- ggplot(plats_summ_melt, aes(x = platform_type, y = number, fill = have_or_want, label = number)) + geom_bar(stat = "identity", width = 0.7) + geom_bar(stat = "identity", width = 0.7, color = "black", show_guide=TRUE) + #geom_text(position = "stack", angle = 45, hjust = 1, vjust = -2) + coord_flip(ylim = c(0,8000)) + xlab("") + ylab("Number of platforms") + theme_bw() + scale_fill_manual(values = c("#0DA6F0", "#F0D20D")) + scale_x_discrete(limits=c("UAVs","ULVs","EddyTowers","Trams","Buoys", "ShortTowersTripods","Animals","Surface"), labels = c("Unmanned Aerial Vehicles","Unmanned Land Vehicles", "Eddy Towers", "Trams","Buoys", "Short Towers or Tripods", "Animals (e.g, tracking collars)", "Surface substrate")) + theme(axis.text.x = element_text(family = "Helvetica", size = 11, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 11, color = "black"), legend.title = element_blank(), legend.text = element_text(family = "Helvetica", size = 11, color = "black"), legend.justification=c(0,0), legend.position=c(.75,0), legend.background = element_rect(fill="gray95", size=.5, linetype="solid", colour = "black"), plot.margin=unit(c(.1,.5,0,0),units="cm")) ggsave(filename = "plots/platforms_have_want.eps", plot = plot_platforms, width = 6.5, height = 2, units = "in", bg = "white", colormodel = "cymk") plot_platforms #### Q16. Estimated cost of replacing sensor network #### replace <- data.frame(cost = factor(data_clean[,57][which(data_clean[,57] != "")])) replace <- unique(ddply(replace, "cost", function(x) data.frame(x, count=nrow(x)))) replace <- replace[-1,] replace$cost <- as.factor(as.character(replace$cost)) replace$percent <- replace$count/sum(replace$count) * 100 #correct the factor levels order replace$cost <- factor(replace$cost, levels = levels(replace$cost)[c(3,1,2,4)]) ggplot(replace, aes(x = cost, y = percent)) + geom_bar(colour = "white", fill = "black", stat = "identity") + theme_bw() + xlab("Estimated Replacement Cost") + theme(axis.text.x = element_text(angle = 45, hjust = 1)) summary(replace) #### Q17. Approximate amount of raw data collected annually #### data_collected <- data.frame(amount = factor(data_clean[,58][which(data_clean[,58] != "")])) data_collected <- unique(ddply(data_collected, "amount", function(x) data.frame(x, count=nrow(x)))) data_collected$amount <- as.factor(as.character(data_collected$amount)) data_collected$percent <- data_collected$count/sum(data_collected$count) * 100 #correct the factor levels order data_collected$amount <- factor(data_collected$amount, levels = levels(data_collected$amount)[c(1,3,4,5,2)]) data_collected$amount <- mapvalues(data_collected$amount, levels(data_collected$amount), c("< 1 GB", "1-10 GB", "10-100 GB", "100 GB -1 TB",">1 TB")) plot_datacollected <- ggplot(data_collected, aes(x = amount, y = count)) + geom_bar(colour = "black", fill = "lightblue", stat = "identity") + theme_bw() + xlab("Volume of raw data collected annually") + ylab("Number of groups") + theme(axis.text.x = element_text(angle = 0, hjust = 0.5, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_datacollected.jpg", plot = plot_datacollected, width = 9, height = 3.5, units = "in", dpi = 300) #### Compare data amount with sensor number #### sensors <- data_clean[,c(39:46,58)] sensors <- sensors[-which(is.na(sensors[,1]) & is.na(sensors[,2]) & is.na(sensors[,3]) & is.na(sensors[,4]) & is.na(sensors[,5]) & is.na(sensors[,6]) & is.na(sensors[,7]) & is.na(sensors[,8])),] sensors <- sensors[which(sensors[,9] != ""),] sensors[,9] <- mapvalues(sensors[,9], from = c("< 1 Gigabyte (GB)",">1000 GB (>1 terabyte or TB)"), to = c("< 1 GB", "> 1 TB")) sensors[,9] <- as.factor(as.character(sensors[,9])) names(sensors) <- c("Weather","Soil","Water","Spectral","GasAnalyzers","Cameras", "Sound","Animals","Data") sensors2 <- melt(sensors) sensors2[is.na(sensors2)] <- 0 sensors3 <- tapply(sensors2$value, INDEX = list(sensors2$Data, sensors2$variable), FUN = mean) sensors3 <- melt(sensors3) names(sensors3) <- c("Data","SensorType","value") sensors3$Data <- factor(sensors3$Data, levels = levels(sensors3$Data)[c(1,3,4,5,2)]) ggplot(sensors3, aes(x = Data, y= value, fill = SensorType)) + geom_bar(stat = "identity") + coord_flip() plot_datasensors <- ggplot(sensors3, aes(x = SensorType, y= value)) + geom_bar(stat = "identity") + facet_wrap(~ Data, ncol = 1) + theme_bw() + theme(axis.text.x = element_text(angle = 45, hjust = 1, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_datasensors.jpg", plot = plot_datasensors, width = 4, height = 6, units = "in", dpi = 300) plot_datasensors #lm(sensors3[,2:3]) #### Compare data amount with people number #### datapeople <- data_clean[,c(22:26,58)] names(datapeople) <- c("PhDs","PhD.students","MS.students","Undergrads","Techs","Data") datapeople <- datapeople[-which(is.na(datapeople[,1]) & is.na(datapeople[,2]) & is.na(datapeople[,3]) & is.na(datapeople[,4]) & is.na(datapeople[,5])),] for(i in 1:5){ datapeople[,i][which(is.na(datapeople[,i]))] <- 0 } datapeople$totalpeople <- rowSums(datapeople[,1:5], na.rm = TRUE) datapeople <- datapeople[-which(is.na(datapeople$Data)),] datapeople$Data <- mapvalues(datapeople$Data, from = c("< 1 Gigabyte (GB)",">1000 GB (>1 terabyte or TB)"), to = c("< 1 GB", "> 1 TB")) datapeople$Data <- as.factor(as.character(datapeople$Data)) datapeople$Data <- factor(datapeople$Data, levels = levels(datapeople$Data)[c(1,3,4,5,2)]) plot_datapeople <- ggplot(datapeople, aes(x = Data, y= totalpeople)) + geom_boxplot(outlier.colour = "green", outlier.size = 3) + geom_point() + xlab("Annual Volume of Data") + ylab("Number of personnel") + theme_bw() + coord_cartesian(ylim = c(0,70)) + theme(axis.text.x = element_text(angle = 0, hjust = 0.5, family = "Helvetica", size = 12, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) ggsave(filename = "plots/plot_datapeople.jpg", plot = plot_datapeople, width = 6.5, height = 5, units = "in", dpi = 300) plot_datapeople cor(datapeople$totalpeople, as.numeric(datapeople$Data)) # = 0.396192 peopledata_lm <- lm(totalpeople ~ Data, datapeople) summary(peopledata_lm) plot(peopledata_lm) #### Q23. Estimated cost of ideal sensor network #### idealsn <- data.frame(cost = factor(data_clean[,78][which(data_clean[,78] != "")])) idealsn <- unique(ddply(idealsn, "cost", function(x) data.frame(x, count=nrow(x)))) idealsn$cost <- as.factor(as.character(idealsn$cost)) idealsn$cost <- mapvalues(idealsn$cost, c("$0 (don’t want to install a sensor array)", "<$10,000" , "$10,000-$100,000", "$100,000-$1 million", "> $1 million"), c("$0", "< $10K", "$10K-$100K", "$100K-$1M", "> $1 M")) idealsn$percent <- idealsn$count/sum(idealsn$count) * 100 #correct the factor levels order levels(idealsn$cost) <- levels(idealsn$cost)[c(3,1,4,5,2)] ggplot(idealsn, aes(x = cost, y = count)) + geom_bar(colour = "white", fill = "black", stat = "identity") + theme_bw() + xlab("Ideal Cost") + theme(axis.text.x = element_text(angle = 45, hjust = 1)) #### Compare cost between current and ideal sensor networks #### sn_cost_diff <- data_clean[,c(57,78)] sn_cost_diff <- sn_cost_diff[which(sn_cost_diff[,1] != ""),] sn_cost_diff <- sn_cost_diff[which(sn_cost_diff[,2] != ""),] names(sn_cost_diff) <- c("replacement","ideal") sn_cost_diffs <- unique(ddply(sn_cost_diff, c("replacement","ideal"), function(x) data.frame(x, count=nrow(x)))) sn_cost_diffs$replacement <- mapvalues(sn_cost_diffs$replacement, c("$0 (don’t have a sensor network)", "<$10,000" , "$10,000-$100,000", "$100,000-$1 million", "> $1 million"), c("$0", "< $10K", "$10K-$100K", "$100K-$1M", "> $1 M")) levels(sn_cost_diffs$replacement) <- levels(sn_cost_diffs$replacement)[c(3,1,4,5,2)] sn_cost_diffs$ideal <- mapvalues(sn_cost_diffs$ideal, c("$0 (don’t want to install a sensor array)", "<$10,000" , "$10,000-$100,000", "$100,000-$1 million", "> $1 million"), c("$0", "< $10K", "$10K-$100K", "$100K-$1M", "> $1 M")) levels(sn_cost_diffs$ideal) <- levels(sn_cost_diffs$ideal)[c(3,1,4,5,2)] sn_cost_diffs <- rbind(sn_cost_diffs, data.frame(replacement = "$0", ideal = "$0", count = NA)) sn_cost_diffs <- rbind(sn_cost_diffs, data.frame(replacement = "$10K-$100K", ideal = "$10K-$100K", count = NA)) sn_cost_diffs$replacement <- factor(sn_cost_diffs$replacement, levels = levels(sn_cost_diffs$replacement), ordered = TRUE) sn_cost_diffs$ideal <- factor(sn_cost_diffs$ideal, levels = levels(sn_cost_diffs$ideal), ordered = TRUE) sn_cost_diffs$difference <- rep("ideal cost = replacement cost", nrow(sn_cost_diffs)) sn_cost_diffs$difference[which(sn_cost_diffs$ideal > sn_cost_diffs$replacement)] <- "ideal cost > replacement cost" sn_cost_diffs$difference[which(sn_cost_diffs$ideal < sn_cost_diffs$replacement)] <- "ideal cost < replacement cost" plot_costdiffs <- ggplot(sn_cost_diffs, aes(x = replacement, y = ideal, fill = difference)) + geom_point(aes(size = count), shape = 21, color = "black") + geom_text(aes(label = count)) + scale_fill_manual(values = c("#faf97a", "#b7f97a","#79f7f9")) + scale_size_area(max_size = 15, guide = FALSE) + theme_bw() + xlab("Replacement cost of current network") + ylab("Cost of ideal network") + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1, family = "Helvetica", size = 10, color = "black"), axis.text.y = element_text(family = "Helvetica", size = 10, color = "black"), legend.position = "top", legend.text = element_text(family = "Helvetica", size = 10, color = "black"), legend.title = element_blank(), legend.key.size = unit(0.5, 'cm')) + guides(fill = guide_legend(ncol = 1)) ggsave(filename = "plots/plot_costdiffs.eps", plot = plot_costdiffs, width = 3.8, height = 4.5, units = "in", bg = "white", colormodel = "cymk") plot_costdiffs ####Deprecated plots#### # plot_havesensors_colorful <- ggplot(havesensors2, aes(x = reorder(variable, -value), # y = value, fill = variable)) + # theme_bw() + # geom_bar(stat = "identity") + # geom_point(color = "red") + # xlab("") + ylab("Total # Sensors") + # coord_cartesian(ylim = c(0, 3000)) + # theme(axis.text.x = element_text(angle = 45, hjust = 1, # family = "Helvetica", size = 12, color = "black"), # axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) # # ggsave(filename = "plots/plot_havesensors_colorful.jpg", plot = plot_havesensors_colorful, # width = 6.5, height = 4, units = "in", dpi = 300) # # plot_havesensors_colorful # # plot_havesensors_gray <- ggplot(havesensors2, aes(x = reorder(variable, -value), # y = value)) + # theme_bw() + # geom_bar(stat = "identity", width = 0.7, fill = "gray") + # geom_point(color = "red") + # xlab("") + ylab("Total # Sensors") + # coord_cartesian(ylim = c(0,3000)) + # theme(axis.text.x = element_text(angle = 45, hjust = 1, # family = "Helvetica", size = 12, color = "black"), # axis.text.y = element_text(family = "Helvetica", size = 12, color = "black")) # # # ggsave(filename = "plots/plot_havesensors_gray.jpg", plot = plot_havesensors_gray, # width = 6.5, height = 4, units = "in", dpi = 300) # # plot_havesensors_gray # # plot_havesensors_pie <- ggplot(data =havesensors2, aes(x = factor(1), # y = value, # fill = factor(variable))) + # geom_bar(width = 1, stat = "identity") + # coord_polar(theta = "y") + # xlab("") + ylab("Summary") + labs(fill = "Sensor Type") + # theme(axis.text.y=element_blank(), # axis.ticks.y = element_blank()) # # ggsave(filename = "plots/plot_havesensors_pie.jpg", plot = plot_havesensors_pie, # width = 6.5, height = 6.5, units = "in", dpi = 300) # # plot_havesensors_pie