Skip to contents

Package info

ecokit ecokit-package
ecokit: Tools for Ecological and General Utilities
chelsa_var_info
CHELSA Variable Information
get_chelsa_links()
Retrieve CHELSA Data Links
check_gbif()
Check and Load GBIF Credentials from .Renviron

Package management

stop_ctx()
Signal structured errors with metadata, timestamps, and backtraces
package_functions()
List of functions in a package
load_packages()
Load or install multiple R packages
load_packages_future()
Prepare Packages for Parallel Processing with Future
quiet_device()
Suppress Future Device Warnings and Startup Messages
reload_package()
Reload an R package
loaded_packages()
List of loaded packages
package_remote_sha()
Retrieve Remote SHAs for R Packages
assign_env_vars()
Assign environment variables from a .env file
check_args()
Check function arguments for specific types
function_arguments()
Print function Arguments
record_arguments()
Capture and record evaluated function arguments
used_packages()
Extract package names used with :: in an R script

File / data operations

file_extension() file_size() file_type()
File Information Utilities
dir_size()
Calculate the Size of a Directory
normalize_path()
Normalise and quote file paths
load_as()
Load objects from RData / qs2 / rds / feather file
load_multiple()
Load multiple data files together
check_data() check_rdata() check_qs() check_rds() check_feather()
Check Integrity of Data Files
check_zip()
Check the Integrity of a ZIP File
check_image()
Verify Image File Integrity
save_as()
Save an object to a file with a new name
save_multiple()
Save multiple objects to their respective .RData files
list_to_rdata()
Split list items into separate .RData files
assign_if_not_exist()
Assign a value to a variable if it does not already exist in the specified environment
cc()
Concatenate without quotes
ht()
Print head and tail of a data frame or vector with indices
cat_names()
Print Names of an Object with Optional Sorting
arrange_alphanum()
Arrange Dataframe Rows Alphanumerically
n_decimals()
Number of decimal places in a numeric value
replace_space()
Replace whitespace with underscores
scrape_link()
Extracts link texts and URLs from a web page
split_vector()
Split a vector into smaller chunks
split_df_to_chunks()
Split a data.frame into smaller chunks
range_to_new_value()
Changes values within a specified range, or greater than or less than a specific value to a new value in a vector, data.frame, or raster
all_objects_sizes()
Size of objects in memory
tibble_column_size()
Calculate Column Sizes in a Tibble
keep_only()
Keep only specified objects in the environment, removing all others.
source_silent()
Silently source R script with optional message and warning suppression
n_unique()
Number of unique values for all columns of a data frame
add_missing_columns()
Add missing columns to a data frame with specified fill values

Printing/logging functions

cat_sep()
Print separator(s) to the console
cat_time()
Print text with time stamp
cat_diff()
Print time difference
info_chunk()
Print Information chunk with time stamp

Utility functions

set_parallel()
Set up or stop parallel processing plan
os()
Current operating system
system_command()
Run a system command in a cross-platform manner
check_url()
Check the validity of a URL
script_location()
Retrieve the location of the current R script.
clear_console()
Clear the console
check_rstudio()
Check if the installed RStudio version is up to date
check_quarto()
Check if the installed Quarto version is up to date
save_session()
Save non-function objects from the global environment to an RData file
save_session_info()
Save session information to a text file
git_log()
Print or return a detailed Git log of a repository
bash_variables()
Read command line arguments passed to an R script
detect_alias()
Detect aliased variables in a linear model
get_mode()
Calculate the mode of a numeric vector
check_system_command()
Check system commands availability
lapply_() sapply_()
Apply a function over a list or vector with optional silence

Spatial functions

check_tiff()
Check if a tiff file corrupted
boundary_to_wkt()
Determine the boundaries of the requested GBIF data
polygon_centroid()
Replace Polygon Geometry with Centroid Point
rename_geometry()
Rename Active Geometry Column of an sf Object
split_raster()
Split a raster object into a list of smaller rasters
set_geometry()
Set Geometry Column of an sf Object in a Pipeline
text_to_coordinates()
Extract longitude and latitude from string
clip_raster_by_polygon()
Clip a raster layer by a spatial polygon
check_stack_in_memory()
Check if a raster stack reads from disk or memory
sf_add_coords()
Add longitude and latitude coordinates to an sf object
raster_to_pres_abs()
Convert raster map into binary (1/0)
nc_global_attributes()
Get global attributes for NetCDF files
scale_0_1()
Scale a raster object’s values to a range between 0 and 1
set_raster_crs()
Set CRS for a SpatRaster in a Pipeline
add_cross_to_grid() add_diagonals_to_grid()
Add Geometric Features to Spatial Grid Cells
range_to_new_value()
Changes values within a specified range, or greater than or less than a specific value to a new value in a vector, data.frame, or raster

Plotting functions

add_image_to_plot()
Add an image to an existing plot in R
add_line()
Add a horizontal or vertical line to the current plot
integer_breaks()
Integer breaks for ggplot axis