Skip to content
Prev 303872 / 398513 Next

Irregular splits in dataframe

On Aug 21, 2012, at 3:24 PM, Sapana Lohani wrote:

            
inp <- read.table(text="Granitic Hills 16-20 PZ
  Loamy Upland 16-20 PZ
  Sandy Loam Upland 12-16 PZ / Sandy Loam, Deep 12-16 PZ
  Loamy Upland 12-16 PZ / Sandy Loam Upland 12-16 PZ / Limy Slopes  
16-20 PZ
  Loamy Upland 16-20 PZ", sep="/", fill = TRUE)
  is.na(inp) = inp==""
  inp
#-----------------
                            V1                            
V2                    V3
1     Granitic Hills 16-20 PZ                          
<NA>                  <NA>
2       Loamy Upland 16-20 PZ                          
<NA>                  <NA>
3 Sandy Loam Upland 12-16 PZ     Sandy Loam, Deep 12-16  
PZ                  <NA>
4      Loamy Upland 12-16 PZ   Sandy Loam Upland 12-16 PZ   Limy  
Slopes 16-20 PZ
5       Loamy Upland 16-20 PZ                          
<NA>                  <NA>