Relative Content

Tag Archive for rggplot2rstudio

Saving plots in Rstudio/R

I’ve been using ggplot for the most of data visualizations in R/RStudio.
It’s fantastic and absolutely love the package.

Saving plots in Rstudio/R

I’ve been using ggplot for the most of data visualizations in R/RStudio.
It’s fantastic and absolutely love the package.

Assigning a dynamic title to a plot in R?

createMap <- function(df1) { map <- get_googlemap(center=”Milwaukee”) %>% ggmap()+ stat_density2d(data=df1, aes(x=Longitude, y=Latitude, fill=..density..),geom=’tile’, contour=F, alpha=.5)+ labs(fill=”seizure density”)+ scale_fill_viridis(option=”inferno”) return map } createMap(my_df) I want to call this function to return a plot that is named: map_my_df (i.e. the name of the dataset is included in the name). In other words, I want to create a […]

Add Separate Mean Points to Jitter in R

I am trying to add a mean point for both Experimental and Control, and connect those points with a line to show both progressions over time. I am not sure how to add in the means for two separate things, only for the entire site as seen below. Also, is it possible to distinguish control/experimental at each site through point color? Thank you!

Reorder a ggplot axis by a subset of data

Please see my figure in the image. Currently, the x-axis is ordered by the total number of nests per “bee of wasp group”, so forested and open margin values (see legend) are added together. I want to instead order the x-axis by just the number of nests (y-value) in the open margin category. How would I do this? My current ggplot code is included. Dataset not necessary for this question.