[R] (no subject)

Henrique Dallazuanna wwwhsd at gmail.com
Thu Jan 21 03:41:50 CET 2010


transform(DF, District_Unique = paste(Province, District, collapse = ''))

On Thu, Jan 21, 2010 at 12:34 AM, teurlai magali <teurlaimag at yahoo.fr> wrote:
> Hi
>
> is there a way in R to create a new column vector with the numbers of 2 others columns simply appended?
>
> Example : I have a column with provinces codes (1 to 19)
> I have a second column with districts codes (1 to ##, depending on the province)
> I want to create a third column with a code that would be unique for each district:
>
> Province  District   District_Unique
> 1             1            11
> 1             2            12
> 13           2            132
>
> I can create a loop, but it becomes complicated with numerous data
>
> Thanks for your help
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list