[R-sig-Geo] Local_coord

Loïc Dutrieux loic.dutrieux at wur.nl
Sun Jul 20 23:17:33 CEST 2014


Hello Kátia,

That sounds more like a dataframe manipulation problem; though we can 
help. See the code below.

library(dplyr)

coord <- read.table('Coord_ha_R.txt', header = TRUE, fill = TRUE)

plots <- 'ref_sub_parc_coord.txt' %.%
   read.table(header = TRUE) %.%
   mutate(Sub_parc = seq(1,10)) %.%
   merge(coord, by = 'Sub_parc') %.%
   mutate(X_global = X_local + X, Y_global = Y_local + Y)


Is it more or less what you're aiming at? There are certainly many ways 
to come to the same result.
Also you may want to take a look at the dplyr vignette, it's a quick 
read. 
(http://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html)

Cheers,
--
Loïc Dutrieux
Wageningen University

On 14-07-20 05:51 PM, Kátia Emidio wrote:
> Hi there,
> I need to consolidate my local coordinates gotten in 10x10m sub-plots
> and to transform them into 100x100m reference. I am doing this by hand
> in excel... too much time!!
> I need to sum up a reference measure to subplots measure by creating a
> loop..
> The file "Coord_ha_R" has the columns names "ParcelaSub_parcX_localY_local"
> The reference file (ref_sub_parc_coord) to sum up values to X and Y_
> local has  the colums name  "sub-parcXY".
>
> For each "XY_local fields in the "coord_ha_R", I need to sum up the
> respective XY  values in the  "ref_sub_parc_coord" file, considering
> each sub-parcel.
>
> I'll really apreciate any help, because I have too many plots!!
>
> Thanks
> --
> Kátia Emídio da Silva DSc
> Eng. Florestal
> Manaus/AM
>
>
>
> Forestry Engineer
> Manaus/AM-Brazil
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list