View source: R/time_series_plot.R
time_series_plot | R Documentation |
This function ouputs a pie map from the dataset provided as input
time_series_plot(df_input, time_resolution, dimension_group_by = NULL,
number_of_classes = 2)
df_input |
data.frame to map |
time_resolution |
string time resolution to visualize on the plot. |
dimension_group_by |
string. Name of the dimension that will be the classes in the chart or NULL if no aggregation dimension. |
number_of_classes |
integer. Number of classes to visualize on the chart. |
All values in df_input
must be expressed with the same unit (since the function aggregates the data).
time_resolution takes one of the following values: "month", "quarter", "semester", "year", "decade"
Paul Taconet, paul.taconet@ird.fr
Other visualize data: functions_visualize_data
,
pie_map
# Connect to Tuna atlas database
con<-db_connection_tunaatlas_world()
# Extract IOTC (Indian Ocean) georeferenced catch time series of catches from Sardara DB, in 5° resolution
ind_catch_tunaatlasird_level2<-extract_dataset(con,list_metadata_datasets(con,identifier="indian_ocean_catch_5deg_1m_1952_11_01_2016_01_01_tunaatlasIRD_level2"))
head(ind_catch_tunaatlasird_level2)
# filter the data to keep only catches on log schools in 2014:
ind_catch_tunaatlasird_level2 <- ind_catch_tunaatlasird_level2 %>% filter (year==2014) %>% filter (schooltype=="LS")
# Map the catches made on log schools in 2014 by species:
time_series_plot(
df_input=ind_catch_tunaatlasird_level2,
time_resolution="month",
dimension_group_by="species",
number_of_classes=4
)
dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.