Hello,
Using the dataset below I produce a soil.texture plot (R code for this
included at the end). One will notice I have plotted the points based on
whether or not they are in a region called 'upstream' or
'downstream'. I'm
curious if there is a way to somehow extract counts of the number of points
(red points and blue points) falling within each classification (e.g. silty
loam, sandy clay, etc.)?
Eric
soil.dat<-read.table(textConnection("Field_Num Region Region_Num
Region_Sym
Region_Col Date Location Location_Num sand silt clay
1 US 1 1 4 6/3/1999 Surface 1 26.25 52.5 21.25
1 US 1 1 4 8/8/2000 Surface 1 27.5 52.5 20
1 US 1 1 4 8/8/2000 One_Foot 2 27.5 50 22.5
1 US 1 1 4 8/8/2000 Two_Foot 3 80 20 0
1 US 1 1 4 8/8/2000 Three_Foot 4 67.5 22.5 10
1 US 1 1 4 8/8/2000 Four_Foot 5 95 0 5
2 US 1 1 4 8/8/2000 Surface 1 55 12.5 32.5
2 US 1 1 4 6/4/2001 Surface 1 48.75 43.75 7.5
2 US 1 1 4 6/1/1999 Surface 1 28 34 38
2 US 1 1 4 8/8/2000 One_Foot 2 62.5 7.5 30
2 US 1 1 4 6/4/2001 One_Foot 2 65 16.25 18.75
2 US 1 1 4 8/8/2000 Two_Foot 3 55 0 45
2 US 1 1 4 6/4/2001 Two_Foot 3 50 21.25 28.75
2 US 1 1 4 8/8/2000 Three_Foot 4 47.5 5 47.5
2 US 1 1 4 6/4/2001 Three_Foot 4 77.5 15 7.5
2 US 1 1 4 8/8/2000 Four_Foot 5 62.5 0 37.5
2 US 1 1 4 6/4/2001 Four_Foot 5 75 15 10
5 US 1 1 4 8/1/2000 Surface 1 25 36.25 38.75
5 US 1 1 4 6/9/1999 Surface 1 48.75 31.25 20
5 US 1 1 4 8/1/2000 One_Foot 2 25 40 35
5 US 1 1 4 8/1/2000 Two_Foot 3 21.13 30.99 47.89
5 US 1 1 4 8/1/2000 Three_Foot 4 37.5 25 37.5
5 US 1 1 4 8/1/2000 Four_Foot 5 37.5 25 37.5
6 US 1 1 4 5/28/2003 Surface 1 37.5 37.5 25
6 US 1 1 4 8/8/2000 Surface 1 37.5 22.5 40
6 US 1 1 4 5/31/2001 Surface 1 21.25 35 43.75
6 US 1 1 4 5/28/2003 One_Foot 2 77.5 10 12.5
6 US 1 1 4 8/8/2000 One_Foot 2 82.5 5 12.5
6 US 1 1 4 5/31/2001 One_Foot 2 61.25 21.25 17.5
6 US 1 1 4 5/28/2003 Two_Foot 3 82.5 6.25 11.25
6 US 1 1 4 8/8/2000 Two_Foot 3 85 5 10
6 US 1 1 4 5/31/2001 Two_Foot 3 76.25 15 8.75
6 US 1 1 4 5/28/2003 Three_Foot 4 85 5 10
6 US 1 1 4 8/8/2000 Three_Foot 4 72.5 7.5 20
6 US 1 1 4 5/31/2001 Three_Foot 4 68.75 16.25 15
6 US 1 1 4 5/28/2003 Four_Foot 5 67.5 18.75 13.75
6 US 1 1 4 8/8/2000 Four_Foot 5 67.5 7.5 25
6 US 1 1 4 5/31/2001 Four_Foot 5 76.25 13.75 10
6 US 1 1 4 5/28/2003 Six_Foot 6 61.25 23.75 15
7 US 1 1 4 8/4/2003 Surface 1 40 42.5 17.5
7 US 1 1 4 6/2/2003 Surface 1 41.25 46.25 12.5
7 US 1 1 4 8/8/2000 Surface 1 52.5 12.5 35
7 US 1 1 4 6/1/2001 Surface 1 40 27.5 32.5
7 US 1 1 4 8/4/2003 One_Foot 2 42.5 40 17.5
7 US 1 1 4 6/2/2003 One_Foot 2 40 48.75 11.25
7 US 1 1 4 8/8/2000 One_Foot 2 47.5 10 42.5
7 US 1 1 4 6/1/2001 One_Foot 2 47.5 26.25 26.25
7 US 1 1 4 8/4/2003 Two_Foot 3 65 20 15
7 US 1 1 4 6/2/2003 Two_Foot 3 40 55 5
7 US 1 1 4 8/8/2000 Two_Foot 3 45 5 50
7 US 1 1 4 6/1/2001 Two_Foot 3 57.5 17.5 25
7 US 1 1 4 8/4/2003 Three_Foot 4 77.5 11.25 11.25
7 US 1 1 4 6/2/2003 Three_Foot 4 85 12.5 2.5
7 US 1 1 4 8/8/2000 Three_Foot 4 60 7.5 32.5
7 US 1 1 4 6/1/2001 Three_Foot 4 65 18.75 16.25
7 US 1 1 4 8/4/2003 Four_Foot 5 22.5 60 17.5
7 US 1 1 4 6/2/2003 Four_Foot 5 86.25 6.25 7.5
7 US 1 1 4 8/8/2000 Four_Foot 5 25 20 55
7 US 1 1 4 6/1/2001 Four_Foot 5 37.5 35 27.5
7 US 1 1 4 8/4/2003 Six_Foot 6 52.5 33.75 13.75
7 US 1 1 4 6/2/2003 Six_Foot 6 56.25 36.25 7.5
8 US 1 1 4 8/8/2000 Surface 1 40 15 45
8 US 1 1 4 6/3/1999 Surface 1 32.5 45 22.5
8 US 1 1 4 8/8/2000 One_Foot 2 45 21.25 33.75
8 US 1 1 4 8/8/2000 Two_Foot 3 33.75 20 46.25
8 US 1 1 4 8/8/2000 Three_Foot 4 38.75 18.75 42.5
8 US 1 1 4 8/8/2000 Four_Foot 5 32.5 23.75 43.75
11 US 1 1 4 8/4/2003 Surface 1 28.75 45 26.25
11 US 1 1 4 5/29/2003 Surface 1 27.5 47.5 25
11 US 1 1 4 8/9/2000 Surface 1 32.5 20 47.5
11 US 1 1 4 5/31/2001 Surface 1 25 30 45
11 US 1 1 4 6/2/1999 Surface 1 26 34 40
11 US 1 1 4 8/4/2003 One_Foot 2 20 50 30
11 US 1 1 4 5/29/2003 One_Foot 2 25 47.5 27.5
11 US 1 1 4 8/9/2000 One_Foot 2 25 25 50
11 US 1 1 4 5/31/2001 One_Foot 2 12.5 37.5 50
11 US 1 1 4 8/4/2003 Two_Foot 3 20 20 60
11 US 1 1 4 5/29/2003 Two_Foot 3 20 57.5 22.5
11 US 1 1 4 8/9/2000 Two_Foot 3 27.5 30 42.5
11 US 1 1 4 5/31/2001 Two_Foot 3 10 37.5 52.5
11 US 1 1 4 8/4/2003 Three_Foot 4 22.5 60 17.5
11 US 1 1 4 5/29/2003 Three_Foot 4 26.25 51.25 22.5
11 US 1 1 4 8/9/2000 Three_Foot 4 30 22.5 47.5
11 US 1 1 4 5/31/2001 Three_Foot 4 15 22.5 62.5
11 US 1 1 4 8/4/2003 Four_Foot 5 30 47.5 22.5
11 US 1 1 4 5/29/2003 Four_Foot 5 35 43.75 21.25
11 US 1 1 4 8/9/2000 Four_Foot 5 30 22.5 47.5
11 US 1 1 4 5/31/2001 Four_Foot 5 20 25 55
11 US 1 1 4 8/4/2003 Six_Foot 6 51.25 18.75 30
11 US 1 1 4 5/29/2003 Six_Foot 6 56.25 17.5 26.25
12 US 1 1 4 8/4/2003 Surface 1 28.75 55 16.25
12 US 1 1 4 6/9/2003 Surface 1 32.5 36.25 31.25
12 US 1 1 4 8/9/2000 Surface 1 30 27.5 42.5
12 US 1 1 4 6/9/1999 Surface 1 37.5 38.75 23.75
12 US 1 1 4 8/4/2003 One_Foot 2 18.75 45 36.25
12 US 1 1 4 6/9/2003 One_Foot 2 21.25 43.75 35
12 US 1 1 4 8/9/2000 One_Foot 2 15 38.75 46.25
12 US 1 1 4 8/4/2003 Two_Foot 3 15 45 40
12 US 1 1 4 6/9/2003 Two_Foot 3 12.5 38.75 48.75
12 US 1 1 4 8/9/2000 Two_Foot 3 7.5 52.5 40
12 US 1 1 4 8/4/2003 Three_Foot 4 8.75 42.5 48.75
12 US 1 1 4 6/9/2003 Three_Foot 4 8.75 62.5 28.75
12 US 1 1 4 8/9/2000 Three_Foot 4 0 58.75 41.25
12 US 1 1 4 8/4/2003 Four_Foot 5 15 53.75 31.25
12 US 1 1 4 6/9/2003 Four_Foot 5 11.25 43.75 45
12 US 1 1 4 8/9/2000 Four_Foot 5 5 50 45
12 US 1 1 4 8/4/2003 Six_Foot 6 17.5 51.25 31.25
12 US 1 1 4 6/9/2003 Six_Foot 6 13.75 55 31.25
13 US 1 1 4 8/5/2003 Surface 1 21.25 46.25 32.5
13 US 1 1 4 8/9/2000 Surface 1 22.5 25 52.5
13 US 1 1 4 6/9/1999 Surface 1 27.5 48.75 23.75
13 US 1 1 4 8/17/1999 Surface 1 27.5 51.25 21.25
13 US 1 1 4 8/5/2003 One_Foot 2 15 43.75 41.25
13 US 1 1 4 8/9/2000 One_Foot 2 27.5 25 47.5
13 US 1 1 4 8/17/1999 One_Foot 2 12.5 62.5 25
13 US 1 1 4 8/5/2003 Two_Foot 3 25 43.75 31.25
13 US 1 1 4 8/9/2000 Two_Foot 3 60 12.5 27.5
13 US 1 1 4 8/17/1999 Two_Foot 3 63.75 16.25 20
13 US 1 1 4 8/5/2003 Three_Foot 4 50 21.25 28.75
13 US 1 1 4 8/9/2000 Three_Foot 4 62.5 12.5 25
13 US 1 1 4 8/17/1999 Three_Foot 4 86.25 6.25 7.5
13 US 1 1 4 8/5/2003 Four_Foot 5 72.5 0 27.5
13 US 1 1 4 8/9/2000 Four_Foot 5 40 20 40
13 US 1 1 4 8/17/1999 Four_Foot 5 61.25 3.75 35
13 US 1 1 4 8/5/2003 Six_Foot 6 35 38.75 26.25
14 US 1 1 4 8/5/2003 Surface 1 35 32.5 32.5
14 US 1 1 4 5/28/2003 Surface 1 30 37.5 32.5
14 US 1 1 4 8/9/2000 Surface 1 27.5 32.5 40
14 US 1 1 4 6/4/2001 Surface 1 25 35 40
14 US 1 1 4 6/3/1999 Surface 1 43.75 38.75 17.5
14 US 1 1 4 8/5/2003 One_Foot 2 37.5 30 32.5
14 US 1 1 4 5/28/2003 One_Foot 2 13.75 56.25 30
14 US 1 1 4 8/9/2000 One_Foot 2 20 40 40
14 US 1 1 4 6/4/2001 One_Foot 2 30 37.5 32.5
14 US 1 1 4 8/5/2003 Two_Foot 3 25 40 35
14 US 1 1 4 5/28/2003 Two_Foot 3 18.75 47.5 33.75
14 US 1 1 4 8/9/2000 Two_Foot 3 25 25 50
14 US 1 1 4 6/4/2001 Two_Foot 3 42.5 37.5 20
14 US 1 1 4 8/5/2003 Three_Foot 4 32.5 45 22.5
14 US 1 1 4 5/28/2003 Three_Foot 4 17.5 57.5 25
14 US 1 1 4 8/9/2000 Three_Foot 4 30 32.5 37.5
14 US 1 1 4 6/4/2001 Three_Foot 4 20 32.5 47.5
14 US 1 1 4 8/5/2003 Four_Foot 5 12.5 22.5 65
14 US 1 1 4 5/28/2003 Four_Foot 5 2.5 25 72.5
14 US 1 1 4 8/9/2000 Four_Foot 5 17.5 50 32.5
14 US 1 1 4 6/4/2001 Four_Foot 5 10 57.5 32.5
14 US 1 1 4 8/5/2003 Six_Foot 6 12.5 23.75 63.75
14 US 1 1 4 5/28/2003 Six_Foot 6 5 23.75 71.25
17 US 1 1 4 5/28/2003 Surface 1 48.75 31.25 20
17 US 1 1 4 8/9/2000 Surface 1 52.5 17.5 30
17 US 1 1 4 6/1/2001 Surface 1 65 18.75 16.25
17 US 1 1 4 6/3/1999 Surface 1 64 12 24
17 US 1 1 4 8/11/1999 Surface 1 46 26 28
17 US 1 1 4 5/28/2003 One_Foot 2 66.25 21.25 12.5
17 US 1 1 4 8/9/2000 One_Foot 2 65 17.5 17.5
17 US 1 1 4 6/1/2001 One_Foot 2 63.75 21.25 15
17 US 1 1 4 5/28/2003 Two_Foot 3 66.25 22.5 11.25
17 US 1 1 4 8/9/2000 Two_Foot 3 80 10 10
17 US 1 1 4 6/1/2001 Two_Foot 3 71.25 13.75 15
17 US 1 1 4 5/28/2003 Three_Foot 4 73.75 17.5 8.75
17 US 1 1 4 8/9/2000 Three_Foot 4 72.5 10 17.5
17 US 1 1 4 6/1/2001 Three_Foot 4 78.75 11.25 10
17 US 1 1 4 5/28/2003 Four_Foot 5 86.25 8.75 5
17 US 1 1 4 8/9/2000 Four_Foot 5 65 12.5 22.5
17 US 1 1 4 6/1/2001 Four_Foot 5 76.25 11.25 12.5
17 US 1 1 4 5/28/2003 Six_Foot 6 46.25 36.25 17.5
18 US 1 1 4 5/29/2003 Surface 1 25 45 30
18 US 1 1 4 8/10/2000 Surface 1 42.5 7.5 50
18 US 1 1 4 5/31/2001 Surface 1 36.25 28.75 35
18 US 1 1 4 6/3/1999 Surface 1 30 36 34
18 US 1 1 4 5/29/2003 One_Foot 2 27.5 37.5 35
18 US 1 1 4 8/10/2000 One_Foot 2 32.5 10 57.5
18 US 1 1 4 5/31/2001 One_Foot 2 41.25 27.5 31.25
18 US 1 1 4 5/29/2003 Two_Foot 3 10 55 35
18 US 1 1 4 8/10/2000 Two_Foot 3 50 12.5 37.5
18 US 1 1 4 5/31/2001 Two_Foot 3 23.75 32.5 43.75
18 US 1 1 4 5/29/2003 Three_Foot 4 12.5 53.75 33.75
18 US 1 1 4 8/10/2000 Three_Foot 4 40 15 45
18 US 1 1 4 5/31/2001 Three_Foot 4 23.75 31.25 45
18 US 1 1 4 5/29/2003 Four_Foot 5 17.5 53.75 28.75
18 US 1 1 4 8/10/2000 Four_Foot 5 50 7.5 42.5
18 US 1 1 4 5/31/2001 Four_Foot 5 52.5 23.75 23.75
18 US 1 1 4 5/29/2003 Six_Foot 6 40 40 20
20 US 1 1 4 6/9/2003 Surface 1 28.75 43.75 27.5
20 US 1 1 4 8/10/2000 Surface 1 32.5 27.5 40
20 US 1 1 4 6/1/2001 Surface 1 20 35 45
20 US 1 1 4 8/4/2003 Surface 1 28.75 41.25 30
20 US 1 1 4 6/9/2003 One_Foot 2 23.75 45 31.25
20 US 1 1 4 8/10/2000 One_Foot 2 20 30 50
20 US 1 1 4 6/1/2001 One_Foot 2 15 38.75 46.25
20 US 1 1 4 8/4/2003 One_Foot 2 22.5 40 37.5
20 US 1 1 4 6/9/2003 Two_Foot 3 20 62.5 17.5
20 US 1 1 4 8/10/2000 Two_Foot 3 25 30 45
20 US 1 1 4 6/1/2001 Two_Foot 3 20 32.5 47.5
20 US 1 1 4 8/4/2003 Two_Foot 3 23.75 48.75 27.5
20 US 1 1 4 6/9/2003 Three_Foot 4 31.25 41.25 27.5
20 US 1 1 4 8/10/2000 Three_Foot 4 25 30 45
20 US 1 1 4 6/1/2001 Three_Foot 4 20 27.5 52.5
20 US 1 1 4 8/4/2003 Three_Foot 4 31.25 31.25 37.5
20 US 1 1 4 6/9/2003 Four_Foot 5 35 37.5 27.5
20 US 1 1 4 8/10/2000 Four_Foot 5 27.5 27.5 45
20 US 1 1 4 6/1/2001 Four_Foot 5 20 30 50
20 US 1 1 4 8/4/2003 Four_Foot 5 37.5 25 37.5
20 US 1 1 4 6/9/2003 Six_Foot 6 23.75 46.25 30
20 US 1 1 4 8/4/2003 Six_Foot 6 32.5 27.5 40
21 US 1 1 4 6/2/1999 Surface 1 38.75 38.75 22.5
22 US 1 1 4 8/10/2000 Surface 1 55 22.5 22.5
22 US 1 1 4 6/2/1999 Surface 1 77.5 12.5 10
22 US 1 1 4 8/17/1999 Surface 1 57.5 30 12.5
22 US 1 1 4 8/10/2000 One_Foot 2 47.5 28.75 23.75
22 US 1 1 4 8/10/2000 Two_Foot 3 47.5 35 17.5
22 US 1 1 4 8/10/2000 Three_Foot 4 56.76 37.84 5.41
22 US 1 1 4 8/10/2000 Four_Foot 5 55 27.5 17.5
23 US 1 1 4 5/22/2002 Surface 1 21.25 53.75 25
23 US 1 1 4 8/9/2000 Surface 1 35 17.5 47.5
23 US 1 1 4 6/2/1999 Surface 1 30 50 20
23 US 1 1 4 8/17/1999 Surface 1 30 45 25
23 US 1 1 4 5/22/2002 One_Foot 2 16.25 53.75 30
23 US 1 1 4 8/9/2000 One_Foot 2 25 20 55
23 US 1 1 4 8/17/1999 One_Foot 2 25 50 25
23 US 1 1 4 5/22/2002 Two_Foot 3 13.75 60 26.25
23 US 1 1 4 8/9/2000 Two_Foot 3 30 12.5 57.5
23 US 1 1 4 5/22/2002 Three_Foot 4 16.25 60 23.75
23 US 1 1 4 8/9/2000 Three_Foot 4 25 12.5 62.5
23 US 1 1 4 8/17/1999 Three_Foot 4 25 51.25 23.75
23 US 1 1 4 5/22/2002 Four_Foot 5 13.75 66.25 20
23 US 1 1 4 8/9/2000 Four_Foot 5 30 5 65
23 US 1 1 4 8/17/1999 Four_Foot 5 22.5 65 12.5
23 US 1 1 4 5/22/2002 Six_Foot 6 21.25 55 23.75
24 US 1 1 4 5/28/2003 Surface 1 26.25 30 43.75
24 US 1 1 4 8/9/2000 Surface 1 37.5 22.5 40
24 US 1 1 4 6/4/2001 Surface 1 20 40 40
24 US 1 1 4 5/28/2003 One_Foot 2 40 23.75 36.25
24 US 1 1 4 8/9/2000 One_Foot 2 42.5 30 27.5
24 US 1 1 4 6/4/2001 One_Foot 2 20 47.5 32.5
24 US 1 1 4 5/28/2003 Two_Foot 3 65 12.5 22.5
24 US 1 1 4 8/9/2000 Two_Foot 3 65 17.5 17.5
24 US 1 1 4 6/4/2001 Two_Foot 3 45 36.25 18.75
24 US 1 1 4 5/28/2003 Three_Foot 4 68.75 15 16.25
24 US 1 1 4 8/9/2000 Three_Foot 4 80 7.5 12.5
24 US 1 1 4 6/4/2001 Three_Foot 4 62.5 30 7.5
24 US 1 1 4 5/28/2003 Four_Foot 5 62.5 17.5 20
24 US 1 1 4 8/9/2000 Four_Foot 5 72.5 7.5 20
24 US 1 1 4 6/4/2001 Four_Foot 5 65 25 10
24 US 1 1 4 5/28/2003 Six_Foot 6 77.5 8.75 13.75
27 US 1 1 4 5/29/2003 Surface 1 27.5 40 32.5
27 US 1 1 4 8/9/2000 Surface 1 42.5 22.5 35
27 US 1 1 4 6/4/2001 Surface 1 12.5 47.5 40
27 US 1 1 4 6/10/1999 Surface 1 40 42.5 17.5
27 US 1 1 4 5/29/2003 One_Foot 2 27.5 38.75 33.75
27 US 1 1 4 8/9/2000 One_Foot 2 40 25 35
27 US 1 1 4 6/4/2001 One_Foot 2 12.5 47.5 40
27 US 1 1 4 5/29/2003 Two_Foot 3 58.75 3.75 37.5
27 US 1 1 4 8/9/2000 Two_Foot 3 47.5 20 32.5
27 US 1 1 4 6/4/2001 Two_Foot 3 30 45 25
27 US 1 1 4 5/29/2003 Three_Foot 4 38.75 26.25 35
27 US 1 1 4 8/9/2000 Three_Foot 4 52.5 17.5 30
27 US 1 1 4 6/4/2001 Three_Foot 4 32.5 45 22.5
27 US 1 1 4 5/29/2003 Four_Foot 5 41.25 23.75 35
27 US 1 1 4 8/9/2000 Four_Foot 5 55 15 30
27 US 1 1 4 6/4/2001 Four_Foot 5 50 35 15
28 US 1 1 4 8/10/2000 Surface 1 46.25 22.5 31.25
28 US 1 1 4 6/10/1999 Surface 1 52.5 26.25 21.25
28 US 1 1 4 8/10/2000 One_Foot 2 18.75 28.75 52.5
28 US 1 1 4 8/10/2000 Two_Foot 3 13.75 32.5 53.75
28 US 1 1 4 8/10/2000 Three_Foot 4 55 20 25
28 US 1 1 4 8/10/2000 Four_Foot 5 46.25 25 28.75
29 US 1 1 4 5/22/2002 Surface 1 18.75 43.75 37.5
29 US 1 1 4 6/9/2003 Surface 1 25 42.5 32.5
29 US 1 1 4 8/15/2000 Surface 1 35 27.5 37.5
29 US 1 1 4 6/4/1999 Surface 1 31.25 45 23.75
29 US 1 1 4 5/22/2002 One_Foot 2 18.75 45 36.25
29 US 1 1 4 6/9/2003 One_Foot 2 20 52.5 27.5
29 US 1 1 4 8/15/2000 One_Foot 2 32.5 22.5 45
29 US 1 1 4 5/22/2002 Two_Foot 3 16.25 51.25 32.5
29 US 1 1 4 6/9/2003 Two_Foot 3 22.5 51.25 26.25
29 US 1 1 4 8/15/2000 Two_Foot 3 25 20 55
29 US 1 1 4 5/22/2002 Three_Foot 4 16.25 58.75 25
29 US 1 1 4 6/9/2003 Three_Foot 4 18.75 56.25 25
29 US 1 1 4 8/15/2000 Three_Foot 4 25 20 55
29 US 1 1 4 5/22/2002 Four_Foot 5 22.5 55 22.5
29 US 1 1 4 6/9/2003 Four_Foot 5 22.5 56.25 21.25
29 US 1 1 4 8/15/2000 Four_Foot 5 32.5 15 52.5
29 US 1 1 4 5/22/2002 Six_Foot 6 35 31.25 33.75
29 US 1 1 4 6/9/2003 Six_Foot 6 37.5 36.25 26.25
30 US 1 1 4 5/28/2003 Surface 1 26.25 48.75 25
30 US 1 1 4 8/10/2000 Surface 1 22.5 22.5 55
30 US 1 1 4 6/3/1999 Surface 1 30 47.5 22.5
30 US 1 1 4 8/17/1999 Surface 1 35 42.5 22.5
30 US 1 1 4 5/28/2003 One_Foot 2 26.25 48.75 25
30 US 1 1 4 8/10/2000 One_Foot 2 30 35 35
30 US 1 1 4 8/17/1999 One_Foot 2 50 26.25 23.75
30 US 1 1 4 5/28/2003 Two_Foot 3 41.25 28.75 30
30 US 1 1 4 8/10/2000 Two_Foot 3 57.5 25 17.5
30 US 1 1 4 8/17/1999 Two_Foot 3 60 17.5 22.5
30 US 1 1 4 5/28/2003 Three_Foot 4 52.5 25 22.5
30 US 1 1 4 8/17/1999 Three_Foot 4 72.5 12.5 15
30 US 1 1 4 5/28/2003 Four_Foot 5 62.5 17.5 20
30 US 1 1 4 8/17/1999 Four_Foot 5 77.5 10 12.5
302 DS 19 0.5 2 8/13/2003 Surface 1 31.25 51.25 17.5
302 DS 19 0.5 2 6/7/2002 Surface 1 21.25 56.25 22.5
302 DS 19 0.5 2 5/19/2003 Surface 1 28.75 48.75 22.5
302 DS 19 0.5 2 8/13/2003 One_Foot 2 36.25 36.25 27.5
302 DS 19 0.5 2 6/7/2002 One_Foot 2 18.75 50 31.25
302 DS 19 0.5 2 5/19/2003 One_Foot 2 31.25 41.25 27.5
302 DS 19 0.5 2 8/13/2003 Two_Foot 3 37.5 41.25 21.25
302 DS 19 0.5 2 6/7/2002 Two_Foot 3 22.5 48.75 28.75
302 DS 19 0.5 2 5/19/2003 Two_Foot 3 28.75 42.5 28.75
302 DS 19 0.5 2 8/13/2003 Three_Foot 4 28.75 43.75 27.5
302 DS 19 0.5 2 6/7/2002 Three_Foot 4 18.75 50 31.25
302 DS 19 0.5 2 5/19/2003 Three_Foot 4 28.75 46.25 25
302 DS 19 0.5 2 8/13/2003 Four_Foot 5 26.25 48.75 25
302 DS 19 0.5 2 6/7/2002 Four_Foot 5 8.75 50 41.25
302 DS 19 0.5 2 5/19/2003 Four_Foot 5 26.25 37.5 36.25
302 DS 19 0.5 2 8/13/2003 Six_Foot 6 46.25 33.75 20
302 DS 19 0.5 2 6/7/2002 Six_Foot 6 6.25 52.5 41.25
302 DS 19 0.5 2 5/19/2003 Six_Foot 6 13.75 48.75 37.5
303 DS 19 0.5 2 5/19/2003 Surface 1 27.5 45 27.5
303 DS 19 0.5 2 5/19/2003 One_Foot 2 16.25 58.75 25
303 DS 19 0.5 2 5/19/2003 Two_Foot 3 16.25 61.25 22.5
303 DS 19 0.5 2 5/19/2003 Three_Foot 4 21.25 58.75 20
303 DS 19 0.5 2 5/19/2003 Four_Foot 5 17.5 65 17.5
303 DS 19 0.5 2 5/19/2003 Six_Foot 6 25 67.5 7.5
304 DS 19 0.5 2 8/12/2003 Surface 1 18.75 51.25 30
304 DS 19 0.5 2 5/19/2003 Surface 1 13.75 48.75 37.5
304 DS 19 0.5 2 8/12/2003 One_Foot 2 15 52.5 32.5
304 DS 19 0.5 2 5/19/2003 One_Foot 2 13.75 61.25 25
304 DS 19 0.5 2 8/12/2003 Two_Foot 3 18.75 58.75 22.5
304 DS 19 0.5 2 5/19/2003 Two_Foot 3 18.75 61.25 20
304 DS 19 0.5 2 8/12/2003 Three_Foot 4 13.75 70 16.25
304 DS 19 0.5 2 5/19/2003 Three_Foot 4 17.5 67.5 15
304 DS 19 0.5 2 8/12/2003 Four_Foot 5 16.25 66.25 17.5
304 DS 19 0.5 2 5/19/2003 Four_Foot 5 18.75 60 21.25
304 DS 19 0.5 2 8/12/2003 Six_Foot 6 13.75 56.25 30
304 DS 19 0.5 2 5/19/2003 Six_Foot 6 57.5 20 22.5
305 DS 19 0.5 2 5/19/2003 Surface 1 38.75 40 21.25
305 DS 19 0.5 2 5/19/2003 One_Foot 2 41.25 33.75 25
305 DS 19 0.5 2 5/19/2003 Two_Foot 3 27.5 38.75 33.75
305 DS 19 0.5 2 5/19/2003 Three_Foot 4 25 45 30
305 DS 19 0.5 2 5/19/2003 Four_Foot 5 28.75 43.75 27.5
305 DS 19 0.5 2 5/19/2003 Six_Foot 6 15 41.25 43.75
306 DS 19 0.5 2 8/12/2003 Surface 1 23.75 51.25 25
306 DS 19 0.5 2 6/7/2002 Surface 1 6.25 58.75 35
306 DS 19 0.5 2 8/12/2003 One_Foot 2 18.75 50 31.25
306 DS 19 0.5 2 6/7/2002 One_Foot 2 8.75 51.25 40
306 DS 19 0.5 2 8/12/2003 Two_Foot 3 18.75 78.75 2.5
306 DS 19 0.5 2 6/7/2002 Two_Foot 3 8.75 58.75 32.5
306 DS 19 0.5 2 8/12/2003 Three_Foot 4 18.75 72.5 8.75
306 DS 19 0.5 2 6/7/2002 Three_Foot 4 6.25 63.75 30
306 DS 19 0.5 2 8/12/2003 Four_Foot 5 22.5 67.5 10
306 DS 19 0.5 2 6/7/2002 Four_Foot 5 8.75 63.75 27.5
306 DS 19 0.5 2 8/12/2003 Six_Foot 6 21.25 68.75 10
306 DS 19 0.5 2 6/7/2002 Six_Foot 6 13.75 71.25 15
307 DS 19 0.5 2 5/20/2003 Surface 1 12.5 66.25 21.25
307 DS 19 0.5 2 5/20/2003 One_Foot 2 17.5 66.25 16.25
307 DS 19 0.5 2 5/20/2003 Two_Foot 3 21.25 65 13.75
307 DS 19 0.5 2 5/20/2003 Three_Foot 4 22.5 63.75 13.75
307 DS 19 0.5 2 5/20/2003 Four_Foot 5 18.75 65 16.25
307 DS 19 0.5 2 5/20/2003 Six_Foot 6 20 53.75 26.25
308 DS 19 0.5 2 5/20/2003 Surface 1 20 45 35
308 DS 19 0.5 2 5/20/2003 One_Foot 2 13.75 50 36.25
308 DS 19 0.5 2 5/20/2003 Two_Foot 3 12.5 60 27.5
308 DS 19 0.5 2 5/20/2003 Three_Foot 4 15 63.75 21.25
308 DS 19 0.5 2 5/20/2003 Four_Foot 5 17.5 67.5 15
308 DS 19 0.5 2 5/20/2003 Six_Foot 6 27.5 60 12.5
313 DS 19 0.5 2 8/8/2002 Surface 1 17.5 50 32.5
313 DS 19 0.5 2 5/21/2003 Surface 1 25 50 25
313 DS 19 0.5 2 8/8/2002 One_Foot 2 30 42.5 27.5
313 DS 19 0.5 2 5/21/2003 One_Foot 2 27.5 50 22.5
313 DS 19 0.5 2 8/8/2002 Two_Foot 3 15 55 30
313 DS 19 0.5 2 5/21/2003 Two_Foot 3 32.5 41.25 26.25
313 DS 19 0.5 2 8/8/2002 Three_Foot 4 15 58.75 26.25
313 DS 19 0.5 2 5/21/2003 Three_Foot 4 26.25 50 23.75
313 DS 19 0.5 2 8/8/2002 Four_Foot 5 10 70 20
313 DS 19 0.5 2 5/21/2003 Four_Foot 5 21.25 56.25 22.5
313 DS 19 0.5 2 8/8/2002 Six_Foot 6 15 57.5 27.5
313 DS 19 0.5 2 5/21/2003 Six_Foot 6 30 62.5 7.5
314 DS 19 0.5 2 8/8/2002 Surface 1 32.5 35 32.5
314 DS 19 0.5 2 8/12/2003 Surface 1 27.5 55 17.5
314 DS 19 0.5 2 6/7/2002 Surface 1 32.5 43.75 23.75
314 DS 19 0.5 2 5/14/2003 Surface 1 37.5 50 12.5
314 DS 19 0.5 2 8/8/2002 One_Foot 2 36.25 28.75 35
314 DS 19 0.5 2 8/12/2003 One_Foot 2 35 36.25 28.75
314 DS 19 0.5 2 6/7/2002 One_Foot 2 37.5 38.75 23.75
314 DS 19 0.5 2 5/14/2003 One_Foot 2 42.5 45 12.5
314 DS 19 0.5 2 8/8/2002 Two_Foot 3 57.5 21.25 21.25
314 DS 19 0.5 2 8/12/2003 Two_Foot 3 43.75 32.5 23.75
314 DS 19 0.5 2 6/7/2002 Two_Foot 3 35 43.75 21.25
314 DS 19 0.5 2 5/14/2003 Two_Foot 3 63.75 18.75 17.5
314 DS 19 0.5 2 8/8/2002 Three_Foot 4 57.5 20 22.5
314 DS 19 0.5 2 8/12/2003 Three_Foot 4 45 31.25 23.75
314 DS 19 0.5 2 6/7/2002 Three_Foot 4 21.25 48.75 30
314 DS 19 0.5 2 5/14/2003 Three_Foot 4 37.5 37.5 25
314 DS 19 0.5 2 8/8/2002 Four_Foot 5 62.5 16.25 21.25
314 DS 19 0.5 2 8/12/2003 Four_Foot 5 45 36.25 18.75
314 DS 19 0.5 2 6/7/2002 Four_Foot 5 71.25 2.5 26.25
314 DS 19 0.5 2 5/14/2003 Four_Foot 5 46.25 33.75 20
314 DS 19 0.5 2 8/12/2003 Six_Foot 6 28.75 48.75 22.5
314 DS 19 0.5 2 6/7/2002 Six_Foot 6 45 20 35
314 DS 19 0.5 2 5/14/2003 Six_Foot 6 32.5 47.5 20
318 DS 19 0.5 2 8/13/2002 Surface 1 11.25 47.5 41.25
318 DS 19 0.5 2 8/12/2003 Surface 1 22.5 45 32.5
318 DS 19 0.5 2 5/19/2003 Surface 1 15 38.75 46.25
318 DS 19 0.5 2 8/13/2002 One_Foot 2 21.25 38.75 40
318 DS 19 0.5 2 8/12/2003 One_Foot 2 22.5 42.5 35
318 DS 19 0.5 2 5/19/2003 One_Foot 2 25 43.75 31.25
318 DS 19 0.5 2 8/13/2002 Two_Foot 3 28.75 41.25 30
318 DS 19 0.5 2 8/12/2003 Two_Foot 3 25 42.5 32.5
318 DS 19 0.5 2 5/19/2003 Two_Foot 3 22.5 42.5 35
318 DS 19 0.5 2 8/13/2002 Three_Foot 4 17.5 48.75 33.75
318 DS 19 0.5 2 8/12/2003 Three_Foot 4 22.5 45 32.5
318 DS 19 0.5 2 5/19/2003 Three_Foot 4 5 57.5 37.5
318 DS 19 0.5 2 8/13/2002 Four_Foot 5 17.5 50 32.5
318 DS 19 0.5 2 8/12/2003 Four_Foot 5 23.75 43.75 32.5
318 DS 19 0.5 2 5/19/2003 Four_Foot 5 1.25 43.75 55
318 DS 19 0.5 2 8/13/2002 Six_Foot 6 12.5 50 37.5
318 DS 19 0.5 2 8/12/2003 Six_Foot 6 25 32.5 42.5
318 DS 19 0.5 2 5/19/2003 Six_Foot 6 15 42.5 42.5
320 DS 19 0.5 2 6/8/2002 Surface 1 31.25 43.75 25
320 DS 19 0.5 2 5/21/2003 Surface 1 32.5 40 27.5
320 DS 19 0.5 2 6/8/2002 One_Foot 2 31.25 41.25 27.5
320 DS 19 0.5 2 5/21/2003 One_Foot 2 42.5 27.5 30
320 DS 19 0.5 2 6/8/2002 Two_Foot 3 13.75 33.75 52.5
320 DS 19 0.5 2 5/21/2003 Two_Foot 3 20 40 40
320 DS 19 0.5 2 6/8/2002 Three_Foot 4 36.25 40 23.75
320 DS 19 0.5 2 5/21/2003 Three_Foot 4 17.5 48.75 33.75
320 DS 19 0.5 2 6/8/2002 Four_Foot 5 57.5 25 17.5
320 DS 19 0.5 2 5/21/2003 Four_Foot 5 32.5 42.5 25
320 DS 19 0.5 2 5/21/2003 Six_Foot 6 91.25 1.25 7.5
321 DS 19 0.5 2 8/13/2003 Surface 1 30 33.75 36.25
321 DS 19 0.5 2 5/14/2003 Surface 1 40 35 25
321 DS 19 0.5 2 8/13/2003 One_Foot 2 22.5 48.75 28.75
321 DS 19 0.5 2 5/14/2003 One_Foot 2 28.75 45 26.25
321 DS 19 0.5 2 8/13/2003 Two_Foot 3 40 35 25
321 DS 19 0.5 2 5/14/2003 Two_Foot 3 27.5 55 17.5
321 DS 19 0.5 2 8/13/2003 Three_Foot 4 82.5 5 12.5
321 DS 19 0.5 2 5/14/2003 Three_Foot 4 12.5 45 42.5
321 DS 19 0.5 2 8/13/2003 Four_Foot 5 87.5 3.75 8.75
321 DS 19 0.5 2 5/14/2003 Four_Foot 5 17.5 58.75 23.75
321 DS 19 0.5 2 8/13/2003 Six_Foot 6 95 1.25 3.75
321 DS 19 0.5 2 5/14/2003 Six_Foot 6 12.5 38.75 48.75
322 DS 19 0.5 2 5/14/2003 Surface 1 53.75 28.75 17.5
322 DS 19 0.5 2 5/14/2003 One_Foot 2 52.5 22.5 25
322 DS 19 0.5 2 5/14/2003 Two_Foot 3 53.75 28.75 17.5
322 DS 19 0.5 2 5/14/2003 Three_Foot 4 15 53.75 31.25
322 DS 19 0.5 2 5/14/2003 Four_Foot 5 16.25 36.25 47.5
322 DS 19 0.5 2 5/14/2003 Six_Foot 6 28.75 51.25 20
323 DS 19 0.5 2 5/14/2003 Surface 1 48.75 36.25 15
323 DS 19 0.5 2 5/14/2003 One_Foot 2 47.5 37.5 15
323 DS 19 0.5 2 5/14/2003 Two_Foot 3 72.5 22.5 5
323 DS 19 0.5 2 5/14/2003 Three_Foot 4 37.5 47.5 15
323 DS 19 0.5 2 5/14/2003 Four_Foot 5 92.5 7.5 0
323 DS 19 0.5 2 5/14/2003 Six_Foot 6 100 0 0
325 DS 19 0.5 2 5/30/2002 Surface 1 40 42.5 17.5
325 DS 19 0.5 2 5/21/2003 Surface 1 65 12.5 22.5
325 DS 19 0.5 2 5/30/2002 One_Foot 2 57.5 30 12.5
325 DS 19 0.5 2 5/21/2003 One_Foot 2 60 27.5 12.5
325 DS 19 0.5 2 5/30/2002 Two_Foot 3 55 32.5 12.5
325 DS 19 0.5 2 5/21/2003 Two_Foot 3 57.5 32.5 10
325 DS 19 0.5 2 5/30/2002 Three_Foot 4 20 60 20
325 DS 19 0.5 2 5/21/2003 Three_Foot 4 42.5 42.5 15
325 DS 19 0.5 2 5/30/2002 Four_Foot 5 30 62.5 7.5
325 DS 19 0.5 2 5/21/2003 Four_Foot 5 27.5 56.25 16.25
325 DS 19 0.5 2 5/30/2002 Six_Foot 6 82.5 15 2.5
325 DS 19 0.5 2 5/21/2003 Six_Foot 6 87.5 7.5 5
327 DS 19 0.5 2 8/8/2002 Surface 1 7.5 57.5 35
327 DS 19 0.5 2 8/12/2003 Surface 1 28.75 52.5 18.75
327 DS 19 0.5 2 5/14/2003 Surface 1 20 51.25 28.75
327 DS 19 0.5 2 8/8/2002 One_Foot 2 10 53.75 36.25
327 DS 19 0.5 2 8/12/2003 One_Foot 2 27.5 67.5 5
327 DS 19 0.5 2 5/14/2003 One_Foot 2 18.75 50 31.25
327 DS 19 0.5 2 8/8/2002 Two_Foot 3 3.75 43.75 52.5
327 DS 19 0.5 2 8/12/2003 Two_Foot 3 18.75 68.75 12.5
327 DS 19 0.5 2 5/14/2003 Two_Foot 3 13.75 50 36.25
327 DS 19 0.5 2 8/8/2002 Three_Foot 4 15 35 50
327 DS 19 0.5 2 8/12/2003 Three_Foot 4 22.5 61.25 16.25
327 DS 19 0.5 2 5/14/2003 Three_Foot 4 18.75 47.5 33.75
327 DS 19 0.5 2 8/8/2002 Four_Foot 5 70 12.5 17.5
327 DS 19 0.5 2 8/12/2003 Four_Foot 5 21.25 58.75 20
327 DS 19 0.5 2 5/14/2003 Four_Foot 5 35 26.25 38.75
327 DS 19 0.5 2 8/12/2003 Six_Foot 6 96.25 1.25 2.5
327 DS 19 0.5 2 5/14/2003 Six_Foot 6 91.25 1.25 7.5
328 DS 19 0.5 2 8/13/2002 Surface 1 12.5 55 32.5
328 DS 19 0.5 2 5/19/2003 Surface 1 22.5 46.25 31.25
328 DS 19 0.5 2 8/13/2002 One_Foot 2 12.5 55 32.5
328 DS 19 0.5 2 5/19/2003 One_Foot 2 12.5 57.5 30
328 DS 19 0.5 2 8/13/2002 Two_Foot 3 10 62.5 27.5
328 DS 19 0.5 2 5/19/2003 Two_Foot 3 22.5 57.5 20
328 DS 19 0.5 2 8/13/2002 Three_Foot 4 15 57.5 27.5
328 DS 19 0.5 2 5/19/2003 Three_Foot 4 35 41.25 23.75
328 DS 19 0.5 2 8/13/2002 Four_Foot 5 25 42.5 32.5
328 DS 19 0.5 2 5/19/2003 Four_Foot 5 33.75 36.25 30
328 DS 19 0.5 2 8/13/2002 Six_Foot 6 32.5 27.5 40
328 DS 19 0.5 2 5/19/2003 Six_Foot 6 40 31.25 28.75
330 DS 19 0.5 2 8/8/2002 Surface 1 26.25 41.25 32.5
330 DS 19 0.5 2 6/8/2002 Surface 1 22.5 45 32.5
330 DS 19 0.5 2 8/8/2002 One_Foot 2 28.75 46.25 25
330 DS 19 0.5 2 6/8/2002 One_Foot 2 22.5 47.5 30
330 DS 19 0.5 2 8/8/2002 Two_Foot 3 26.25 51.25 22.5
330 DS 19 0.5 2 6/8/2002 Two_Foot 3 17.5 56.25 26.25
330 DS 19 0.5 2 8/8/2002 Three_Foot 4 21.25 56.25 22.5
330 DS 19 0.5 2 6/8/2002 Three_Foot 4 17.5 60 22.5
330 DS 19 0.5 2 8/8/2002 Four_Foot 5 22.5 52.5 25
330 DS 19 0.5 2 6/8/2002 Four_Foot 5 12.5 67.5 20
330 DS 19 0.5 2 8/8/2002 Six_Foot 6 31.25 55 13.75
330 DS 19 0.5 2 6/8/2002 Six_Foot 6 23.75 58.75 17.5"),header=T)
closeAllConnections()
library(plotrix)
soil.texture(soil.dat[,c(9,10,11)],main='',show.lines=TRUE,show.names=TRUE,pch=soil.dat$Region_Num,cex=soil.dat$Region_Sym,col.names="grey10",col.lines="grey30",col.symbols=soil.dat$Region_Col)
legend(x=0.10,y=0.9,c("Upstream","Downstream"),pch=c(1,20),col=c("blue","red"),bty="o",bg="white",box.col="white")
title(main="Soil Texture",line=-1,cex=2.5)
--
View this message in context:
http://r.789695.n4.nabble.com/histograms-resulting-from-call-to-soil-texture-tp3004778p3004778.html
Sent from the R help mailing list archive at Nabble.com.
On 10/21/2010 10:03 AM, emorway wrote:> Hello, > > Using the dataset below I produce a soil.texture plot (R code for this > included at the end). One will notice I have plotted the points based on > whether or not they are in a region called 'upstream' or 'downstream'. I'm > curious if there is a way to somehow extract counts of the number of points > (red points and blue points) falling within each classification (e.g. silty > loam, sandy clay, etc.)?Hi emorway, It is possible, but you would have to look at the code for soil.texture and get the values from the internal function triax.segments. Then you could test the values to see into which of these little polygons they fell. A rather laborious task. Perhaps someone who does a lot of soil analysis has already done this. Jim
Hi Eric
The package "soiltexture" has a function (TT.points.in.classes)
to classify soil texture data according to various soil texture
triangles. It is based on the function point.in.polygon() from
the sp package.
See the example below, based on your example code.
(The package has a rather comprehensive reference manual
http://cran.r-project.org/web/packages/soiltexture/soiltexture.pdf)
all the best
Julien
### R code example (I have cut some rows out)
soil.dat<-read.table(textConnection(
"Field_Num Region Region_Num Region_Sym Region_Col Date Location
Location_Num sand silt clay
1 US 1 1 4 6/3/1999 Surface 1 26.25 52.5 21.25
1 US 1 1 4 8/8/2000 Surface 1 27.5 52.5 20
1 US 1 1 4 8/8/2000 One_Foot 2 27.5 50 22.5
1 US 1 1 4 8/8/2000 Two_Foot 3 80 20 0
1 US 1 1 4 8/8/2000 Three_Foot 4 67.5 22.5 10
1 US 1 1 4 8/8/2000 Four_Foot 5 95 0 5
2 US 1 1 4 8/8/2000 Surface 1 55 12.5 32.5
2 US 1 1 4 6/4/2001 Surface 1 48.75 43.75 7.5
2 US 1 1 4 6/1/1999 Surface 1 28 34 38
2 US 1 1 4 8/8/2000 One_Foot 2 62.5 7.5 30
2 US 1 1 4 6/4/2001 One_Foot 2 65 16.25 18.75
2 US 1 1 4 8/8/2000 Two_Foot 3 55 0 45
2 US 1 1 4 6/4/2001 Two_Foot 3 50 21.25 28.75
2 US 1 1 4 8/8/2000 Three_Foot 4 47.5 5 47.5
2 US 1 1 4 6/4/2001 Three_Foot 4 77.5 15 7.5
2 US 1 1 4 8/8/2000 Four_Foot 5 62.5 0 37.5
2 US 1 1 4 6/4/2001 Four_Foot 5 75 15 10
5 US 1 1 4 8/1/2000 Surface 1 25 36.25 38.75
330 DS 19 0.5 2 6/8/2002 One_Foot 2 22.5 47.5 30
330 DS 19 0.5 2 8/8/2002 Two_Foot 3 26.25 51.25 22.5
330 DS 19 0.5 2 6/8/2002 Two_Foot 3 17.5 56.25 26.25
330 DS 19 0.5 2 8/8/2002 Three_Foot 4 21.25 56.25 22.5
330 DS 19 0.5 2 6/8/2002 Three_Foot 4 17.5 60 22.5
330 DS 19 0.5 2 8/8/2002 Four_Foot 5 22.5 52.5 25
330 DS 19 0.5 2 6/8/2002 Four_Foot 5 12.5 67.5 20
330 DS 19 0.5 2 8/8/2002 Six_Foot 6 31.25 55 13.75
330 DS 19 0.5 2 6/8/2002 Six_Foot 6 23.75 58.75
17.5"),header=T,sep="",dec=".")
closeAllConnections()
library(plotrix)
soil.texture(soil.dat[,c(9,10,11)],main='',show.lines=TRUE,show.names=TRUE,pch=soil.dat$Region_Num,cex=soil.dat$Region_Sym,col.names="grey10",col.lines="grey30",col.symbols=soil.dat$Region_Col)
legend(x=0.10,y=0.9,c("Upstream","Downstream"),pch=c(1,20),col=c("blue","red"),bty="o",bg="white",box.col="white")
title(main="Soil Texture",line=-1,cex=2.5)
### New code with soiltexture -------------------
install.packages("soiltexture")
require("soiltexture")
# Texture plot
TT.plot(
tri.data =
soil.dat[,c("clay","silt","sand")],
class.sys = "USDA.TT",
css.names = c("clay","silt","sand"),
main = "",
pch = soil.dat$Region_Num,
cex = soil.dat$Region_Sym,
col = soil.dat$Region_Col
) #
# Returns a vector of charcater strings with
# texture class abbreviation for each point
TT.points.in.classes(
tri.data =
soil.dat[,c("clay","silt","sand")],
class.sys = "USDA.TT",
css.names = c("clay","silt","sand"),
PiC.type = "t",
) #
# Set PiC.type to "l" for returning a table of logical
# or to "n" for returning a numerical 0, 1, 2 or 3 is
# outputed (0 if the sample does not belong to a class,
# 1 if it does, 2 if it lies on an edge and 3 if it lies
# on a vertex)
# Returns a table of numerical with one column
# per texture class and one row per texture point
TT.points.in.classes(
tri.data =
soil.dat[,c("clay","silt","sand")],
class.sys = "USDA.TT",
css.names = c("clay","silt","sand"),
PiC.type = "n",
) #
### End of R code
--
-~-~-~-~-~-~
Julien MOEYS, post-doc researcher/Forskare
Swedish University of Agricultural Sciences (SLU)
Department of Soil and Environment
Biogeophysics and water quality
Ulls v?g 17 ; box 7014
750 07 Uppsala, Sweden
<http://www.slu.se/mark>
<http://julienmoeys.free.fr/>
-~-~-~-~-~-~
-----Original Message-----
Message: 119
Date: Wed, 20 Oct 2010 16:03:30 -0700 (PDT)
From: emorway <emorway at engr.colostate.edu>
To: r-help at r-project.org
Subject: [R] histograms resulting from call to soil.texture
Message-ID: <1287615810423-3004778.post at n4.nabble.com>
Content-Type: text/plain; charset=us-ascii
Hello,
Using the dataset below I produce a soil.texture plot (R code for this
included at the end). One will notice I have plotted the points based on
whether or not they are in a region called 'upstream' or
'downstream'. I'm
curious if there is a way to somehow extract counts of the number of points
(red points and blue points) falling within each classification (e.g. silty
loam, sandy clay, etc.)?
Eric
soil.dat<-read.table(textConnection("Field_Num Region Region_Num
Region_Sym
Region_Col Date Location Location_Num sand silt clay
1 US 1 1 4 6/3/1999 Surface 1 26.25 52.5 21.25
1 US 1 1 4 8/8/2000 Surface 1 27.5 52.5 20
1 US 1 1 4 8/8/2000 One_Foot 2 27.5 50 22.5
1 US 1 1 4 8/8/2000 Two_Foot 3 80 20 0
1 US 1 1 4 8/8/2000 Three_Foot 4 67.5 22.5 10
1 US 1 1 4 8/8/2000 Four_Foot 5 95 0 5
2 US 1 1 4 8/8/2000 Surface 1 55 12.5 32.5
2 US 1 1 4 6/4/2001 Surface 1 48.75 43.75 7.5
2 US 1 1 4 6/1/1999 Surface 1 28 34 38
2 US 1 1 4 8/8/2000 One_Foot 2 62.5 7.5 30
2 US 1 1 4 6/4/2001 One_Foot 2 65 16.25 18.75
2 US 1 1 4 8/8/2000 Two_Foot 3 55 0 45
2 US 1 1 4 6/4/2001 Two_Foot 3 50 21.25 28.75
2 US 1 1 4 8/8/2000 Three_Foot 4 47.5 5 47.5
2 US 1 1 4 6/4/2001 Three_Foot 4 77.5 15 7.5
2 US 1 1 4 8/8/2000 Four_Foot 5 62.5 0 37.5
2 US 1 1 4 6/4/2001 Four_Foot 5 75 15 10
5 US 1 1 4 8/1/2000 Surface 1 25 36.25 38.75
330 DS 19 0.5 2 6/8/2002 One_Foot 2 22.5 47.5 30
330 DS 19 0.5 2 8/8/2002 Two_Foot 3 26.25 51.25 22.5
330 DS 19 0.5 2 6/8/2002 Two_Foot 3 17.5 56.25 26.25
330 DS 19 0.5 2 8/8/2002 Three_Foot 4 21.25 56.25 22.5
330 DS 19 0.5 2 6/8/2002 Three_Foot 4 17.5 60 22.5
330 DS 19 0.5 2 8/8/2002 Four_Foot 5 22.5 52.5 25
330 DS 19 0.5 2 6/8/2002 Four_Foot 5 12.5 67.5 20
330 DS 19 0.5 2 8/8/2002 Six_Foot 6 31.25 55 13.75
330 DS 19 0.5 2 6/8/2002 Six_Foot 6 23.75 58.75 17.5"),header=T)
closeAllConnections()
library(plotrix)
soil.texture(soil.dat[,c(9,10,11)],main='',show.lines=TRUE,show.names=TRUE,pch=soil.dat$Region_Num,cex=soil.dat$Region_Sym,col.names="grey10",col.lines="grey30",col.symbols=soil.dat$Region_Col)
legend(x=0.10,y=0.9,c("Upstream","Downstream"),pch=c(1,20),col=c("blue","red"),bty="o",bg="white",box.col="white")
title(main="Soil Texture",line=-1,cex=2.5)
--
View this message in context:
http://r.789695.n4.nabble.com/histograms-resulting-from-call-to-soil-texture-tp3004778p3004778.html
Sent from the R help mailing list archive at Nabble.com.