I am new to using R studio and I would like to create a histogram on lake lengths. I currently have my data in meters with my lowest number being 150 and my highest 600000.
This is my current code:
library(dplyr)
library(ggplot2)
#setwd()
data<-read.csv('SS_histo.csv')
llength<-data$Length
hist(lllength,main="Distribution of Lake Lengths",
xlab="Lake length Range", col="blue", freq=TRUE, breaks=3)
I have three problems which I would appreciate some help with:
- My x-axis is presented in 0e+00, 1e+00, 2e+00, etc. Please may you advise on how I change this to a number?
- I would like to create an overflow bin, where all values greater than 1500m are found.
- I am aware that the Sturges rule may help with determining the number of bins I should use. Please may I ask if anyone knows of any code which I can use/adapt for this rule?
Apologies that the code is very basic as I am new to R. Any help would be greatly appreciated!