[R-sig-Geo] One-to-many table relationship to shapefile polygon in spplot / plot - possible?

Noli Sicad nsicad at gmail.com
Wed Jan 6 09:44:52 CET 2010


> Review ?reshape to convert to wide format before trying to merge into
> your object for using spplot().
>
> Roger

OK. The answer is not possible.

I have been studying reshape - cast and melt.  The illustration submit
in my earlier post, can be easily done. But here is the real data
(below) is bit harder.

I have more problem deleting shapefile polygons that doesn't have data
in dbf.  I am just learning to use R in the last weeks. I have to find
some example script how to do polygon delete. I am reading sp package.
Searching in the archives of various list.

Thanks, Noli
~~~~~~~~~


Input data

C_ID    CROP  Period    Age
83      SORI    1       31
84      SORI    1       32
85      SORI    1       33
86      SORI          1        34
82      SORI       2            28
83      SORI        2   29
84      SORI       2    30
93      SORM    2       35
62      OTRM    3       30
82      SORI        3      27
3       SORM    3       35
82      SORI    4       26
4       SORM    4       34
5       OTRI           5                25
5       OTRM    5       29
5       SORM    5       32
5       SORM    5       33
5       SORM    5       35
6       OTRI    6       22
6       OTRI         6       23
6       OTRI       6        24
6       OTRM    6       26
6       OTRM    6       27
6       OTRM    6       28
7       OTRM    7       26
8       OTRM    8       26
9       OTRM    9       26
10      OTRM    10      24
10      OTRM    10      25
10      OTRM    10      26
10      SORM    10      31

Desired table
C_ID    CROP    P 1     P 2     P 3     P 4     P 5     P 6     P 7
 P 8     P 9     P 10
- Hide quoted text -
83      SORI      31
84      SORI      32
85      SORI      33
86      SORI      34
82      SORI            28
83      SORI            29
84      SORI            30
93      SORM            35
62      OTRM            30
82      SORI                    27
3       SORM                    35
82      SORI                            26
4       SORM                            34
5       OTRI                                    25
5       OTRM                                    29
5       SORM                                    32
5       SORM                                    33
5       SORM                                    35
6       OTRI                                            22
6       OTRI                                            23
6       OTRI                                            24
6       OTRM                                            26
6       OTRM                                            27
6       OTRM                                            28
7       OTRM                                                    26
8       OTRM                                                            26
9       OTRM
         26
10      OTRM
                 24
10      OTRM
                 25
10      OTRM
                 26
10      SORM
                 31



More information about the R-sig-Geo mailing list