Skip to contents

This function returns a character vector listing all the functions available in the specified R package. It first checks if the package is installed and can be loaded; if not, it raises an error.

Usage

package_functions(package)

Arguments

package

Character. Package name.

Value

A character vector containing the names of all functions in the specified package.

Author

Ahmed El-Gabbas

Examples

str(package_functions(package = "raster"))
#>  chr [1:281] "%in%" "Arith" "Compare" "Geary" "GearyLocal" "KML" "Logic" ...

str(package_functions(package = "sf"))
#>  chr [1:156] "%>%" "FULL_bbox_" "NA_agr_" "NA_bbox_" "NA_crs_" ...

package_functions(package = "ecokit")
#>  [1] "%>%"                        "add_cross_to_grid"         
#>  [3] "add_diagonals_to_grid"      "add_image_to_plot"         
#>  [5] "add_line"                   "add_missing_columns"       
#>  [7] "all_objects_sizes"          "arrange_alphanum"          
#>  [9] "assign_env_vars"            "assign_if_not_exist"       
#> [11] "bash_variables"             "boundary_to_wkt"           
#> [13] "cat_diff"                   "cat_names"                 
#> [15] "cat_sep"                    "cat_time"                  
#> [17] "cc"                         "check_args"                
#> [19] "check_data"                 "check_env_file"            
#> [21] "check_feather"              "check_gbif"                
#> [23] "check_image"                "check_qs"                  
#> [25] "check_quarto"               "check_rdata"               
#> [27] "check_rds"                  "check_rstudio"             
#> [29] "check_stack_in_memory"      "check_system_command"      
#> [31] "check_tiff"                 "check_url"                 
#> [33] "check_zip"                  "chelsa_var_info"           
#> [35] "clear_console"              "clip_raster_by_polygon"    
#> [37] "detect_alias"               "dir_size"                  
#> [39] "file_extension"             "file_size"                 
#> [41] "file_type"                  "find_duplicates"           
#> [43] "function_arguments"         "get_chelsa_links"          
#> [45] "get_mode"                   "git_log"                   
#> [47] "ht"                         "info_chunk"                
#> [49] "integer_breaks"             "keep_only"                 
#> [51] "lapply_"                    "list_to_rdata"             
#> [53] "load_as"                    "load_multiple"             
#> [55] "load_packages"              "load_packages_future"      
#> [57] "loaded_packages"            "maxent_open"               
#> [59] "maxent_variable_importance" "n_decimals"                
#> [61] "n_unique"                   "nc_global_attributes"      
#> [63] "normalize_path"             "os"                        
#> [65] "package_functions"          "package_remote_sha"        
#> [67] "pak_from_renv"              "parent_dir"                
#> [69] "polygon_centroid"           "quiet_device"              
#> [71] "quietly"                    "range_to_new_value"        
#> [73] "raster_to_pres_abs"         "record_arguments"          
#> [75] "reload_package"             "rename_geometry"           
#> [77] "replace_space"              "sapply_"                   
#> [79] "save_as"                    "save_multiple"             
#> [81] "save_session"               "save_session_info"         
#> [83] "scale_0_1"                  "scrape_link"               
#> [85] "script_location"            "set_geometry"              
#> [87] "set_parallel"               "set_raster_crs"            
#> [89] "sf_add_coords"              "source_silent"             
#> [91] "split_df_to_chunks"         "split_raster"              
#> [93] "split_vector"               "stop_ctx"                  
#> [95] "system_command"             "text_to_coordinates"       
#> [97] "tibble_column_size"         "used_packages"             

if (FALSE) { # \dontrun{
  # Error: package not found
  package_functions(package = "non_exist")
} # }