Package {HydroPonicsK}


Type: Package
Title: Hydroponic Data Analysis Tools
Version: 1.0.3
Description: Provides statistical and graphical tools for the analysis of hydroponic crop production data. The package includes functions for descriptive statistical analysis, data visualization, correlation analysis, heatmap generation, and graphical summaries of plant growth and nutrient-related variables. These tools support researchers, students, and practitioners in evaluating crop performance and environmental conditions in hydroponic cultivation systems. The package utilizes standard statistical methods implemented in R for data exploration and visualization. Methods are described in James et al. (2021, ISBN:9781071614172) and Wickham (2016, ISBN:9783319242750).
License: GPL-3
Encoding: UTF-8
LazyData: true
Imports: ggplot2, pheatmap, stats
Depends: R (≥ 3.5)
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-06-19 05:24:11 UTC; Dr. Imtiyaz
Author: Khalid Ul Islam Rather [aut, cre]
Maintainer: Khalid Ul Islam Rather <drkhalidulislam@gmail.com>
Repository: CRAN
Date/Publication: 2026-06-24 08:30:02 UTC

Plant Height Plot

Description

Plant Height Plot

Usage

height_plot(data)

Arguments

data

Data frame

Value

Plot


One-Way ANOVA

Description

Performs one-way analysis of variance (ANOVA) for a response variable across treatment groups.

Usage

hydro_anova(data, response, treatment)

Arguments

data

A data frame.

response

Character. Name of response variable.

treatment

Character. Name of treatment/grouping variable.

Value

An object of class "aov".

Examples

hydro_anova(lettuce_data, "Height_cm", "Treatment")

Cluster Analysis

Description

Performs hierarchical clustering using Ward's method on scaled numeric variables.

Usage

hydro_cluster(data)

Arguments

data

A data frame containing numeric variables.

Value

An object of class "hclust".

Examples

hydro_cluster(lettuce_data)

Correlation Matrix

Description

Computes a correlation matrix for numeric variables in a dataset.

Usage

hydro_correlation(data)

Arguments

data

A data frame containing numeric variables.

Value

A correlation matrix.

Examples

hydro_correlation(lettuce_data)

Hydroponic Heatmap Visualization

Description

Creates a heatmap for hydroponic crop data.

Usage

hydro_heatmap(data)

Arguments

data

A numeric matrix or data frame.

Value

A heatmap plot.


Principal Component Analysis for Hydroponic Data

Description

Performs principal component analysis on hydroponic crop data.

Usage

hydro_pca(data)

Arguments

data

A numeric data frame or matrix.

Value

A PCA object produced by prcomp().


Hydroponic Summary Statistics

Description

Hydroponic Summary Statistics

Usage

hydro_summary(data, variable)

Arguments

data

Data frame

variable

Variable name

Value

Summary statistics


Tukey HSD Test

Description

Performs Tukey Honest Significant Difference post-hoc test on an ANOVA model.

Usage

hydro_tukey(model)

Arguments

model

An object of class "aov".

Value

A TukeyHSD object.

Examples

model <- hydro_anova(lettuce_data, "Height_cm", "Treatment")
hydro_tukey(model)

Lettuce Hydroponic Dataset

Description

A controlled hydroponic lettuce experiment dataset used for demonstrating statistical analysis and visualization functions in the package.

Usage

lettuce_data

Format

A data frame with 50 observations and 12 variables:

Plant_ID

Unique identifier for each plant

Treatment

Experimental treatment applied

Replication

Replication number of experimental unit

Days

Days after transplanting

Height_cm

Plant height in centimeters

Root_Length_cm

Root length in centimeters

Leaves

Number of leaves per plant

Fresh_Weight_g

Fresh biomass weight in grams

Dry_Weight_g

Dry biomass weight in grams

pH

Nutrient solution pH level

EC_mScm

Electrical conductivity (mS/cm)

Temp_C

Ambient temperature (°C)

Source

Simulated/experimental hydroponic lettuce growth dataset used for package examples and method validation.


Nutrient Solution Statistics

Description

Computes summary statistics for hydroponic nutrient solution parameters.

Usage

nutrient_stats(data)

Arguments

data

A data frame containing pH, EC_mScm, and Temp_C variables.

Value

A data frame with mean and standard deviation values.

Examples

nutrient_stats(lettuce_data)

Relative Growth Rate

Description

Computes the relative growth rate (RGR) based on initial and final weight and time measurements.

Usage

relative_growth_rate(W1, W2, T1, T2)

Arguments

W1

Numeric. Initial weight (> 0).

W2

Numeric. Final weight (> 0).

T1

Numeric. Initial time.

T2

Numeric. Final time.

Value

Numeric value of relative growth rate.

Examples

relative_growth_rate(10, 20, 1, 5)

Stress Tolerance Index

Description

Computes the Stress Tolerance Index (STI) for yield under stress and non-stress conditions.

Usage

stress_tolerance_index(Ys, Yp)

Arguments

Ys

Numeric vector. Yield under stress condition.

Yp

Numeric vector. Yield under non-stress (optimal) condition.

Value

Numeric vector of STI values.

Examples

stress_tolerance_index(c(10, 12, 9), c(15, 18, 14))

Water Use Efficiency

Description

Computes Water Use Efficiency (WUE) as Yield per unit of water consumed.

Usage

water_use_efficiency(Yield, Water)

Arguments

Yield

Numeric vector. Crop yield values.

Water

Numeric vector. Water consumption values.

Value

Numeric vector of WUE values.

Examples

water_use_efficiency(c(10, 12, 15), c(2, 3, 5))