The Best Linear Unbiased Estimator (BLUE): Step-by-Step Guide

In this session, I will introduce the method of calculating the Best Linear Unbiased Estimator (BLUE). Instead of simply listing formulas as many websites do to explain BLUE, this post aims to help readers understand the process of calculating BLUE with an actual dataset using R. I have the following data. The dataset comprises three … Read more

facetext() R Package: Easy Text Annotation for ggplot2 Faceted Plots

In my previous post, I demonstrated how to add distinct text to panels created with facet_wrap() or facet_grid(), and I proposed the following simple method. I first created a data frame containing the labels, which I then used to map the text to the corresponding panels. Let’s practice using this method This data is from … Read more

phenokio() R Package: Grain Size Analysis – Length, Width, and Area Metrics

When analyzing grain size, we’ve used high-throughput image scanning machines. However, if we can detect grains using R code, estimating grain size becomes possible. In my previous R function, colorcapture(), we were able to detect fruit size and estimate its surface area in 2D. Recently, I developed a new R function called phenokio() specifically designed … Read more

Converting Rows to Columns in R: A Guide to Transposing Data (feat. pivot_wider and pivot_longer)

When data is arranged, it can be structured either vertically (row-based) or horizontally (column-based). The choice depends on your preference for organizing data. However, when running statistics, data should be arranged row-based, as variables need to be in the same column. On the other hand, when calculating per variable, it is much easier to organize … Read more

[R package] Cook’s Distance Diagnostics and Outlier Detection (Feat. datacooks)

In my previous post, I explained how to calculate Cook’s Distance step by step, and noted that in R you can simply use the function cooks.distance(). However, this simple function only provides the Cook’s Distance values. In my previous post, I explained the formula for Cook’s Distance step by step, including how to compute residuals, … Read more

How to analyze quadratic plateau model in R Studio?

Previous post□ How to analyze linear plateau model in R Studio? In my previous post, I explained how to analyze the linear plateau model. I simulated yield data for five different crop varieties with varying sulphur applications and suggested that the optimum sulphur application would be 23.3 kg/ha based on the linear plateau model. In … Read more

How to Set Up RStudio Server on a Linux-Based Virtual Private Server (VPS)

A Virtual Private Server (VPS) is a virtualized computer within a larger physical server. It acts like an independent server, offering dedicated resources and control at a lower cost than a full physical machine. VPS hosting uses this setup to give users private, customizable environments for web hosting or applications. Some reputable VPS providers include … Read more

[R package] Segment and Measure Colored Objects in Images (Feat. colorcapture)

This colorcapture() R function provides easy image analysis to estimate fruit surface area. 1. Install the pacakge Before installing colorcapture(), please download Rtools (https://cran.r-project.org/bin/windows/Rtools), and install the following package. □ colorcapture() 2. Basic code If you want to change other criteria, type ?colorcapture to see detailed information about the colorcapture() function. The default code is set to capture the … Read more

[R package] Segment and Measure Green Objects in Images (Feat. greencapture)

When measuring leaf area or fruit surface area, these have usually been measured manually, which is time-consuming and often inaccurate, especially when the shape is not perpendicular. For more reliable measurement, image analysis provides a good alternative. To facilitate this process, I developed an R function, greencapture() that captures the green area of leaves or … Read more

[R package] Compute Cumulative Summaries of Grouped Data (Feat. datacume)

When analyzing data, we sometimes need to analyze cumulative data. When calculating cumulative data, grouping is important, and it takes time to perform the grouping and calculations. To simplify this process, I developed an R package called datacume(). Let’s upload the dataset. This dataset contains biomass measurements across different treatments over time, recorded for various … Read more

geom_mark_ellipse

https://github.com/agronomy4future/r_code/blob/main/geom_mark_ellipse.ipynb We aim to develop open-source code for agronomy ([email protected]) © 2022 – 2025 https://agronomy4future.com – All Rights Reserved. Last Updated: 19/07/2025

[R package] Quantifying Reaction Norm Plasticity from Slopes to Individual Responses (Feat. nrmodel)

This post is part of a series introducing R packages that present methods for calculating phenotypic plasticity. □ [R package] Finlay-Wilkinson Regression model (feat. fwrmodel)□ [R package] Calculate the responsiveness of each treatment relative to a control (Feat. deltactrl)□ [R package] Quantifying Reaction Norm Plasticity from Slopes to Individual Responses (Feat. nrmodel) In my previous … Read more

[Data article] Visualizing Responsiveness: Integrating Raw Data for a Holistic Dataset View

■ [R package] Embedding Key Descriptive Statistics within Original Data (Feat. descriptivestat)■ [R package] Calculate the responsiveness of each treatment relative to a control (Feat. deltactrl) In my previous posts, I introduced two R packages. The first package, descriptivestat(), displays raw data along with mean values and additional descriptive statistics. The second package, deltactrl(), calculates … Read more

[R package] Calculate the responsiveness of each treatment relative to a control (Feat. deltactrl)

■ Quantifying Phenotypic Plasticity of Crops In my previous posts, I explained how to quantify phenotypic plasticity of crops in response to environmental factors, and introduced the concept of responsiveness, calculated using the formula: (Treatment – Control) / Control, as shown in the table below. Genotype Control Treatment Responsiveness A 100 90 -10.0% = (90-100)/100 … Read more

[R package] Embedding Key Descriptive Statistics within Original Data (Feat. descriptivestat)

When analyzing data, we often need to examine descriptive statistics such as standard deviation, standard error, or the coefficient of variation (CV). These are typically summarized in a short table, but in some cases, it may be necessary to include such statistics directly in the original dataset for further analysis. Let’s upload a dataset to … Read more

[R package] R-Squared Calculation in Simple Linear Regression with Zero Intercept (Feat. Intercept0)

In my previous article, I suggested when forcing the intercept to zero in simple linear regression model, the existing calculation R2 = SSR / SST is incorrect. Instead, when forcing the intercept to zero, R2 should be calculated as shown below. 1 – SSE (when intercept is 0) / SST (when intercept exists) ■ R-Squared Calculation in Linear Regression … Read more

[STAT Article] RMSE Calculation with Excel and R: A Comprehensive Guide

When running statistical programs, you might encounter RMSE (Root Mean Square Error). For example, the table below shows RMSE values obtained from SAS, indicating that it is ca. 2.72. I’m curious about how RMSE is calculated. Below is the equation for RMSE. First, calculate the difference between the estimated and observed values: (ŷi – yi), … Read more

What is split-plot design in agronomy research?

Split-plot design has been widely used particularly in the agronomy research. In split-plot design, the experimental units are divided into smaller units. Split-plot designs are useful when some factors are difficult or expensive to change or when the levels of the factors cannot be randomized (I’ll explain in detail later). Split-plot design consists of one … Read more

[R package] An easy way to use interpolation code to predict in-between data points

In my previous post, I explained how to calculate interpolation to predict in-between data points. ■ [Data article] Predicting Intermediate Data Points with Linear Interpolation in Excel and R To make interpolation calculations easier, particularly for groups, I recently developed a new R package, interpolate(). First, let’s upload a dataset. This dataset contains chlorophyll content … Read more

How to Rename Variables within Columns in R (feat. case_when() code)?

In my previous post, I introduced how to change variable names within columns. In the post, I provided a simple code to rename variables and also used the stringr package for renaming variables. ■ How to Rename Variables within Columns in R? Today I’ll introduce another code to simply rename variables using dplyr() package. In … Read more

How to automatically insert linear regression equation in graph in RSTUDIO?

Sometimes, we need to insert a linear regression equation inside a graph, but it’s an annoying to type an equation every time when generating a linear regression graph. Using stat_poly_eq(), we can automatically insert a linear regression equation. Let’s generate one data frame. Then, I’ll generate a regression graph. Now let’s analyze a linear regression. … Read more

Practices in Data Normalization using normtools() in R

■ [R package] Normalization Methods for Data Scaling (Feat. normtools) In my previous post, I introduced the R package normtools(), which I developed to normalize data using various methods. This time, I’ll demonstrate how to use the R package normtools() for data normalization. 1. Data upload This data includes kernel number (KN), average kernel weight … Read more

[R package] Normalization Methods for Data Scaling (Feat. normtools)

■ [Data article] Data Normalization Techniques: Excel and R as the Initial Steps in Machine Learning In my previous post, I explained how to normalize data using various methods and demonstrated how to perform the calculations for each method. To simplify these calculations, I recently developed an R package that easily generates normalized data. 1. … Read more