Posts

Outliers Outliers Out!!

Image
Identify and Remove the Outliers Whether your data contains outliers? Which are those samples, and, how to remove them from your data? We will see these things with example in R. The library we use is “metan” . Install the package if required [use the code install.packages(“metan”) ] and load it. library(metan) Now set the working directory. I have created a folder in the folder Blog of drive E . You have to use your folder here. Remember to use either / or \\ between folder and sub folders and not \. setwd( "E: \\ Blog" ) I have created a sample data having four variables and 28 samples in .csv format and named it “outlier.csv” . The data table is given in the last section of the blog. Read the data and see the header of the data. The function head() shows the first 6 rows of the data by default. data <- read.csv( "outlier.csv" , header = T) head(data) ##     pH    EC    OC    BD ## 1 7.2 1.80 1.60 1.19 ## 2 7.2...

Presenting major cations and anions in soil or water samples through Maucha Diagrams

Image
  A Maucha diagram, or Maucha symbol, is a graphical representation of the major cations and anions in a chemical sample. The star shape diagram comprises eight kite-shaped polygons, the area of each of which is proportional to the concentration of an ion in milliequivalents per litre. The anions carbonate, bicarbonate, chloride and sulphate are on the left, while the cations potassium, sodium, calcium and magnesium are on the right. The total ionic concentration adds up to the area of the background circle, the total anion concentration adds up to the left semicircle and the total cation concentration adds up to the right semicircle. A package “oviz” is available in ‘github’ for developing Maucha diagram. We need to install it from github. devtools::install_github( "fkeck/oviz" ) Once installed, load the library library(oviz) Now, set your working directory using function “setwd( )”. path <- ( "E: \\ Blog" )      # Write your working directory p...

Creating Soil Textural Triangles in R

Image
  Creating Soil Textural Triangles ⛛   How do you create a textural triangle form the data on clay, silt, and sand percent in soils? Or, how do you classify these data to their textural classes? Do you use some online sources for that? R provides a comprehensive tool for creating these textural triangles in various textural classification systems all over the world such as USDA, ISSS, HYPRES, ASINE, GEPPA, etc.   We will see in this blog, the use of R in creating textural triangles ⛛. We need to install the package “soiltexture” . Use the following lines of code to install the package and load the library. install.packages( pkgs = "soiltexture" ) library( soiltexture ) Now, set your working directory using function “setwd( )”. path <- ( "E: \\ Blog" )      # Write your working directory path here setwd(path) Do notice the “\\” in the path. It’s not “\”. You can use “/” too instead of “\\”. Next, read your data on particle s...