time_series_plot: Create a times series plot

View source: R/time_series_plot.R

time_series_plotR Documentation

Create a times series plot

Description

This function ouputs a pie map from the dataset provided as input

Usage

time_series_plot(df_input, time_resolution, dimension_group_by = NULL,
  number_of_classes = 2)

Arguments

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.

Details

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"

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other visualize data: functions_visualize_data, pie_map

Examples


# 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)


ptaconet/rtunaatlas documentation built on June 23, 2024, 9:35 p.m.