[R-sig-Geo] trunk columns name in a data.frame to convert in a shape-file

Michael Sumner mdsumner at gmail.com
Thu Sep 9 22:26:35 CEST 2010


Many options here, but if you literally just want the first (up to) 8
characters:

names(mydf) <- substr(names(mydf), 1, 8)


On Fri, Sep 10, 2010 at 2:49 AM, gianni lavaredo
<gianni.lavaredo at gmail.com> wrote:
> Dear Researchers,
>
> I have a data frame with several column with the name letters more of 8
> characters. I wish to convert in a shape-file but there is a problem because
> the names of the columns are more the 8 letters limit. Is there a function
> to trunk the names is a data.frame?
>
> this is a easy example
>
> mydf <-
> data.frame(mydatainfield=c(1,2,3,4,5),mydatainlab=c(1,2,3,4,5),intensity=c(1,2,3,4,5))
>
> thanks in advance
> Gianni
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list