ridgeline | R Documentation |
Plots ridgeline plots grouped by latitude/longitude or time. This function can take either a stars object or a dataframe. Input arguments differ for each case.
ridgeline( x, num_grps = 10, xlab = "Value", ylab = "Group Intervals", title = "", legend_title = "z", ... ) ## S3 method for class 'data.frame' ridgeline( x, num_grps = 10, xlab = "Value", ylab = "Group Intervals", title = "", legend_title = "z", group_col, z_col, ... ) ## S3 method for class 'stars' ridgeline( x, num_grps = 10, xlab = "Value", ylab = "Group Intervals", title = "", legend_title = "z", group_dim, ... )
x |
A stars object or a dataframe. Arguments differ according to the input type. |
num_grps |
The number of levels for the ridgeline plot. |
xlab |
The x label. |
ylab |
The y label. |
title |
The graph title. |
legend_title |
The title for the legend. |
... |
Other arguments currently ignored. |
group_col |
For dataframes: the column name of the group column. |
z_col |
For dataframes: the The quantity of interest that will be plotted. Eg. temperature. |
group_dim |
For stars objects: the dimension for the grouping variable. |
A ggplot object.
# Dataframe example library(dplyr) data(NOAA_df_1990) TmaxJan <- filter(NOAA_df_1990, proc == "Tmax" & year == 1993 & month == 1) ridgeline(TmaxJan, group_col = 'lat', z_col = 'z', xlab = 'Maximum Temperature', ylab = 'Latitude Intervals') # stars examples library(stars) library(units) # stars Example 1 tif = system.file("tif/olinda_dem_utm25s.tif", package = "stars") x <- read_stars(tif) dim(x) ridgeline(x, group_dim = 1) ridgeline(x, group_dim = 2) # stars Example 2 tif = system.file("tif/lc.tif", package = "stars") x <- read_stars(tif) ridgeline(x, group_dim = 1) ridgeline(x, group_dim = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.