soilphysics: An R package for calculating soil water availability to plants by different soil physical indices. Soil available water is an important factor for plant growth. It has been estimated by different soil physical indices, such as the least limiting water range (LLWR), integral water capacity (IWC) and integral energy (EI). Moreover, salinity is an important limitation for soil water availability to plants. Despite the advances in the quantification of LLWR, IWC and EI, a comprehensive description of the computational methods, including data management, curve fitting procedures and graphing techniques, is still lacking. The salinity effect on these quantities has still not been implemented in a computer package. In this paper, we present an R package soilphysics and its implementations to determine LLWR, IWC and EI. We described the theory behind each implementation, illustrated the functionalities and validated the outcomes of soilphysics with other software packages for LLWR, IWC and EI calculations (an Excel® algorithm and SAWCal). The salinity effect on soil available water was also employed in the package. The outcomes are basically the same as other software available, with small differences (<4%). The package soilphysics takes advantage of all the power of R for dealing with extensive algorithms and for building high-quality graphics. It is currently available from the CRAN website (http://cran.r-project.org/web/packages/soilphysics/index.html).