Skip to content
Prev 303802 / 398513 Next

irregular splits in dataframe

try this:
+ 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
+ Loamy Upland 16-20 PZ", what = '', sep = '\n')
Read 5 items
[1] "Granitic Hills 16-20 PZ"
[2] "Loamy Upland 16-20 PZ"
[3] "Sandy Loam Upland 12-16 PZ / Sandy Loam, Deep 12-16 PZ"
[4] "Loamy Upland 12-16 PZ / Sandy Loam Upland 12-16 PZ"
[5] "Loamy Upland 16-20 PZ"
+     if (length(.line) == 1) .line <- c(.line, NA)  # add NA
+     .line
+ })
[,1]                          [,2]
[1,] "Granitic Hills 16-20 PZ"     NA
[2,] "Loamy Upland 16-20 PZ"       NA
[3,] "Sandy Loam Upland 12-16 PZ " " Sandy Loam, Deep 12-16 PZ"
[4,] "Loamy Upland 12-16 PZ "      " Sandy Loam Upland 12-16 PZ"
[5,] "Loamy Upland 16-20 PZ"       NA

        
On Tue, Aug 21, 2012 at 1:54 AM, Sapana Lohani <lohani.sapana at ymail.com> wrote: