### Install soilquality using pak Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Installs the development version of the soilquality package from GitHub using the pak package manager. Ensure pak is installed first. ```r if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak") } pak::pak("ccarbajal16/soilquality") ``` -------------------------------- ### Install soilquality using devtools Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Installs the development version of the soilquality package from GitHub using the devtools package. Ensure devtools is installed first. ```r if (!requireNamespace("devtools", quietly = TRUE)) { install.packages("devtools") } devtools::install_github("ccarbajal16/soilquality") ``` -------------------------------- ### Launch Interactive Soil Quality Application Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Starts the interactive Shiny application for the soilquality package, providing a graphical user interface for analysis. ```r # Start Shiny app for GUI-based analysis run_sqi_app() ``` -------------------------------- ### Basic Soil Quality Index (SQI) Calculation Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Loads example soil data, computes SQI using automatic property detection, and prints a summary of the results. Visualizes the SQI distribution and generates a comprehensive report. ```r library(soilquality) # Load example data data(soil_ucayali) # Compute SQI with automatic property detection result <- compute_sqi_properties( data = soil_ucayali, properties = c("Sand", "Silt", "Clay", "pH", "OM", "P", "K") ) # View results summary print(result) # Visualize SQI distribution plot(result, type = "distribution") # Create comprehensive report plot_sqi_report(result) ``` -------------------------------- ### Interactive Tools Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Launch the interactive Shiny application for a user-friendly experience of SQI calculation and analysis. ```APIDOC ## Interactive Tools ### `run_sqi_app()` **Description**: Launch interactive Shiny application with file upload, property selection, scoring configuration, AHP input, results display, and CSV download. ``` -------------------------------- ### Interactive AHP Matrix Creation and SQI Calculation Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Creates an Analytic Hierarchy Process (AHP) matrix interactively to define indicator importance, then uses the computed weights for SQI calculation. ```r # Create AHP matrix interactively indicators <- c("pH", "OM", "P", "K") ahp_matrix <- create_ahp_matrix(indicators, mode = "interactive") # Use computed AHP weights in SQI calculation result <- compute_sqi_properties( data = soil_ucayali, properties = ahp_matrix$indicators, pairwise_matrix = ahp_matrix$weights ) ``` -------------------------------- ### Access Function Documentation Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Access detailed documentation for any function within the soilquality package using the '?' operator or the help() function. ```r ?function_name ``` ```r help(function_name) ``` -------------------------------- ### Browse Vignettes Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Open the vignettes for the soilquality package in your web browser to explore its features and usage. ```r browseVignettes("soilquality") ``` -------------------------------- ### Report Issues Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md If you encounter any problems or have suggestions, report them on the package's GitHub issues page. ```r https://github.com/ccarbajal16/soilquality/issues ``` -------------------------------- ### Scoring Constructors (User-facing) Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md User-friendly constructors for defining various scoring rules for soil properties. ```APIDOC ## Scoring Constructors (User-facing) ### `higher_better()` **Description**: Constructor for higher-is-better scoring rules. ### `lower_better()` **Description**: Constructor for lower-is-better scoring rules. ### `optimum_range()` **Description**: Constructor for optimal range scoring with tolerance. ### `threshold_scoring()` **Description**: Constructor for custom threshold-based scoring. ### `print.scoring_rule()` **Description**: S3 print method for scoring rule objects. ``` -------------------------------- ### Property Sets and Standard Rules Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Access pre-defined soil property sets and automatically generate standard scoring rules. ```APIDOC ## Property Sets and Standard Rules ### `soil_property_sets` **Description**: Pre-defined collections: basic (pH, OM, P, K), standard (9 properties), comprehensive (14 properties), physical, chemical, fertility. ### `standard_scoring_rules()` **Description**: Automatic scoring rule assignment based on property name patterns. ``` -------------------------------- ### Cite the soilquality Package Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Use this R code to generate the citation for the soilquality package, which can be included in research publications. ```r citation("soilquality") ``` -------------------------------- ### SQI Calculation with Pre-defined Property Sets Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Computes the Soil Quality Index (SQI) using a pre-defined set of soil properties, such as the 'standard' set available in the package. ```r # Use standard property set result <- compute_sqi_properties( data = soil_ucayali, properties = soil_property_sets$standard ) ``` -------------------------------- ### SQI Computation Functions Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Core functions for computing the Soil Quality Index (SQI) using different workflows. ```APIDOC ## SQI Computation Functions ### `compute_sqi()` **Description**: File-based SQI computation with CSV input/output. ### `compute_sqi_df()` **Description**: In-memory SQI computation with data frame input. ### `compute_sqi_properties()` **Description**: Enhanced SQI computation with property selection and constructor-based scoring. ``` -------------------------------- ### Visualization Functions Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Functions for generating various plots and reports to visualize SQI results and indicator performance. ```APIDOC ## Visualization Functions ### `plot.sqi_result()` **Description**: S3 plot method supporting five plot types: - "distribution": Histogram of SQI values with mean line - "indicators": Boxplots of indicator scores - "weights": Bar chart of AHP weights with CR annotation - "scree": Variance explained by principal components - "biplot": PCA biplot of observations and variables ### `plot_sqi_report()` **Description**: Generate comprehensive 2x2 multi-panel visualization report. ``` -------------------------------- ### AHP Weighting Functions Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Functions for calculating indicator weights using the Analytic Hierarchy Process (AHP) and managing AHP matrices. ```APIDOC ## AHP Weighting Functions ### `ahp_weights()` **Description**: Calculate indicator weights from pairwise comparison matrix using eigenvalue decomposition. ### `create_ahp_matrix()` **Description**: Interactive or programmatic AHP matrix creation with validation. ### `ratio_to_saaty()` **Description**: Convert importance ratios to Saaty scale (1-9). ### `print.ahp_matrix()` **Description**: S3 print method for AHP matrix objects. ``` -------------------------------- ### Scoring Functions (Low-level) Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Low-level functions for normalizing and scoring individual soil properties based on different rules. ```APIDOC ## Scoring Functions (Low-level) ### `score_higher_better()` **Description**: Normalize properties where higher values indicate better quality. ### `score_lower_better()` **Description**: Normalize properties where lower values indicate better quality. ### `score_optimum()` **Description**: Normalize properties with optimal range using linear or quadratic penalty. ### `score_threshold()` **Description**: Custom piecewise linear scoring based on threshold-score pairs. ### `score_indicators()` **Description**: Apply scoring functions to multiple indicators. ``` -------------------------------- ### SQI Calculation with Custom Scoring Rules Source: https://github.com/ccarbajal16/soilquality/blob/master/README.md Computes SQI using custom scoring rules defined for specific soil properties, including optimal ranges, higher-is-better, lower-is-better, and threshold-based scoring. ```r # Define custom scoring for specific properties custom_rules <- list( pH = optimum_range(optimal = 6.5, tolerance = 1), OM = higher_better(), BD = lower_better(), P = threshold_scoring( thresholds = c(0, 10, 20, 50), scores = c(0, 0.5, 0.8, 1.0) ) ) result <- compute_sqi_properties( data = soil_ucayali, properties = c("pH", "OM", "BD", "P"), scoring_rules = custom_rules ) ``` -------------------------------- ### Data Handling Functions Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Functions for reading CSV files, standardizing numeric data, and safe type conversion. ```APIDOC ## Data Handling Functions ### `read_soil_csv()` **Description**: Import soil data from CSV files with encoding handling. ### `standardize_numeric()` **Description**: Z-score standardization of numeric columns. ### `to_numeric()` **Description**: Safe type conversion with NA for failures. ``` -------------------------------- ### PCA and MDS Selection Source: https://github.com/ccarbajal16/soilquality/blob/master/NEWS.md Function to perform Principal Component Analysis and select a Minimum Data Set (MDS) based on specified thresholds. ```APIDOC ## PCA and MDS Selection ### `pca_select_mds()` **Description**: Perform PCA and select minimum data set based on variance and loading thresholds. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.