Connecting R to Linux-Based Virtual Private Server (VPS) by DigitalOcean for Secure Data Access

Connecting R to Linux-Based Virtual Private Server (VPS) by DigitalOcean for Secure Data Access

I don’t manage my data with Excel, but primarily with SQL. I also don’t store any data on my local PC—not even SQL files. Instead, I keep everything on the server and access it whenever I need it. Previously, I shared how to import data to a cloud MySQL server and how to import data from the MySQL server into R. □ How to Import Data to a Cloud MySQL Server (DigitalOcean) Using Python from Command Prompt□ How to Import…

Read More Read More

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

[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, leverage, and internal studentized residuals. To make it easier to calculate these values, I recently developed an R package called datacooks(). □ datacooks() Before installing…

Read More Read More

[R package] Spatial Heatmap Visualization for Agronomic Grid-based Field Layouts Trials (Feat. agronomymap)

[R package] Spatial Heatmap Visualization for Agronomic Grid-based Field Layouts Trials (Feat. agronomymap)

When analyzing yield, we usually use bar or box plots based on the mean. However, sometimes we need to visualize the spatial variation of yield. In those cases, GIS maps are commonly used, often created with powerful software such as ArcGIS, which I have used and found to be excellent. The drawback is that ArcGIS is not free. If you want to create a simple yield map using R, it is possible, although the map quality may be slightly lower….

Read More Read More

How to analyze quadratic plateau model in R Studio?

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 this post, I’ll explain how to analyze the quadratic plateau model using the same data in R Studio. 1) Data upload If you run the…

Read More Read More

What is the Gamma Distribution? Shape and Scale Parameters, and the Probability Density Function (PDF)

What is the Gamma Distribution? Shape and Scale Parameters, and the Probability Density Function (PDF)

The Gamma distribution is a flexible family of continuous probability distributions defined only for non-negative values (x>0). It’s commonly used to model quantities that represent time, size, or waiting periods—anything that can’t go below zero and often shows right-skewed behavior (a long tail toward larger values). In essence, the Gamma distribution describes how likely different positive values are to occur, determined by two key parameters: the shape (α) and the scale (θ). Together, these parameters control the curve’s form and…

Read More Read More

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

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 DigitalOcean, Linode, and Vultr — I currently use DigitalOcean. A Droplet in DigitalOcean is basically a virtual private server (VPS) — a self-contained Linux machine…

Read More Read More

[Data article] How to Import Data from MySQL Server to R?

[Data article] How to Import Data from MySQL Server to R?

In my previous post, I introduced how to import data into a Cloud MySQL database using Python from the Command Prompt. By typing the code below in your Command Prompt, you can automatically import data into your MySQL server. This is the next step. After importing data into the MySQL server, what if I want to bring that data into R? Is that possible? Yes—it is. 1) install and load the package and library. 2) Create a connection to the…

Read More Read More

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

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

In my previous post, I introduced the R code I developed to capture green color. This updated R function, colorcapture(), replaces the earlier greencapture(). 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 yellow color. If you run the code, it will detect the yellow surface area….

Read More Read More

[Data article] How to Import Data to a Cloud MySQL Server (DigitalOcean) Using Python from Command Prompt

[Data article] How to Import Data to a Cloud MySQL Server (DigitalOcean) Using Python from Command Prompt

In my previous post, I introduced how to import data into SQL. That process was done manually to import data into a local SQL server. I use MySQL. A local SQL server means you can only access the data from your own computer. If you use another computer elsewhere, you won’t be able to access that SQL data. However, I want to access my data universally—from any device, at any location—to manage it more efficiently. To achieve this, we can…

Read More Read More

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

[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 fruits in the lab using a fixed frame. 1. Install the greencapture() package 2. Set up folders for input and output images I will save…

Read More Read More

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

[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 plants and their branches. I want to calculate the cumulative biomass over time. To do this accurately, I’ll first calculate the average biomass of the…

Read More Read More

[R package] Streamlined Mixed-Effects Analysis for Agrivoltaics Experiments (Feat. agrivoltaics)

[R package] Streamlined Mixed-Effects Analysis for Agrivoltaics Experiments (Feat. agrivoltaics)

In my previous post, I suggested different statistical models for agrivoltaics studies to explain why we should consider Linear Mixed Models in this field. In many agrivoltaics studies, researchers overlook the actual experimental layout and analyze data using split-plot or RCBD models, focusing only on treatment variables (e.g., inside vs. outside the solar panel array). However, this approach does not accurately reflect real field conditions. ■ [STAT Article] Statistical Models in Agrivoltaics: Linear Mixed Models Across Different Field Layouts Randomization…

Read More Read More

geom_mark_ellipse

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

[STAT Article] Statistical Models in Agrivoltaics: Linear Mixed Models Across Different Field Layouts

[STAT Article] Statistical Models in Agrivoltaics: Linear Mixed Models Across Different Field Layouts

Agrivoltaics is the study and practice of combining agriculture and solar energy production on the same land. The core idea is to install solar panels above or among crops, allowing for simultaneous food and energy production. Generally, an agrivoltaics study investigates how this dual-use approach affects crop growth and yield (due to changes in light, temperature, and moisture), microclimate conditions under the panels, solar panel efficiency influenced by vegetation, as well as land-use efficiency, economic outcomes, and sustainability metrics. Today,…

Read More Read More

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

[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 post, I explained how to quantify phenotypic plasticity in crops and described three different approaches: Responsiveness, Reaction Norm, and the Finlay-Wilkinson Regression Model. □ Quantifying…

Read More Read More

[STAT Article] How to calculate reaction norm in crop physiology?

[STAT Article] How to calculate reaction norm in crop physiology?

□ Quantifying Phenotypic Plasticity of Crops In my previous post, I explained how to quantify phenotypic plasticity in crops and described three different approaches: 1) Responsiveness, 2) Reaction Norm, and the 3) Finlay-Wilkinson Regression Model. Responsiveness is calculated as (Treatment − Control) / Control. It indicates how the dependent variable (e.g., yield) responds to a given treatment relative to the control. The responsiveness value can range from −1 (complete reduction) to values greater than 0, depending on the magnitude of…

Read More Read More

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

[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 the responsiveness of dependent variables in response to the control. Today, in this article, I will demonstrate how combining these two R packages allows…

Read More Read More

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

[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 B 120 70 -41.7% C 115 90 -21.7% D 95 85 -10.5% E 110 105 -4.5% While calculating responsiveness for a single variable is relatively…

Read More Read More

Amblyseius swirskii – Predatory Mite

Amblyseius swirskii – Predatory Mite

Amblyseius swirskii (commonly called Swirski mite) is a species of mite that feeds on a wide variety of economically important pests including mites, thrips, psyllids, and whiteflies. This article focuses on the use of this predator in outdoor environments. https://cals.cornell.edu/integrated-pest-management/outreach-education/fact-sheets/amblyseius-swirskii-predatory-mite

The New York Night scene from the Airplane

The New York Night scene from the Airplane

I just returned to Ithaca from LA via JFK Airport. The weather in LA was beautiful, and I had a great time in California. This is a view of the New York night scene from the airplane. We aim to develop open-source code for agronomy ([email protected]) © 2022 – 2025 https://agronomy4future.com – All Rights Reserved. Last Updated: 26/05/2025

pepper flowering initiated

pepper flowering initiated

Flowering in pepper (Capsicum spp.) marks a critical transition from vegetative to reproductive growth, significantly influencing fruit set and yield. The flowering process is complex and regulated by genetic, environmental, and physiological factors. In our greenhouse, peppers initiated flowering 58 days after planting. They were planted on 24 March 2025, and flowering began on 21 May 2025. We aim to develop open-source code for agronomy ([email protected]) © 2022 – 2025 https://agronomy4future.com – All Rights Reserved. Last Updated: 21/05/2025

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

[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 begin. I would like to calculate the mean, variance, standard deviation, standard error, 95% confidence interval, coefficient of variation, and the 25th percentile of yield…

Read More Read More

How to upload data from Google Drive to Google Colab in an R environment?

How to upload data from Google Drive to Google Colab in an R environment?

How to use Google Colab for Python (power tool to analyze data)? In my previous post, I introduced how to upload data from Google Drive to Google Colab in a Python environment. Google Colab is primarily Python-based, but now we can change the runtime to R and use R code in Google Colab. Today, I will introduce how to upload data from Google Drive to Google Colab in an R environment. First, let’s upload a data file to Google Drive…

Read More Read More

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

[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 with Zero Intercept This is because that only the SSE (Sum of Squared Error) is calculated as Σ(yi – ŷi)2, regardless of the presence of an…

Read More Read More

How to Upload Data from GitHub Using R and Python?

How to Upload Data from GitHub Using R and Python?

I have soybean yield data that I want to upload to Github and access from R. First, let’s upload the data to Github. The data should be in .csv format. Click Add file, choose Upload files, and, after uploading, select the Raw button to view the data in .csv format as text. and you can find the address for this data, starting with https://raw.githubusercontent.com/… Let’s copy this address. Next, I’ll bring this data into R from Github. Before that, let’s…

Read More Read More