One way I do this is, assuming the two columns are characters (or are 
transformed using as.character()), concatenate them using paste, and 
then make the new variable a factor.

blah = paste(as.character(genus), as.character(species))
new.factor = as.factor(blah)

Ricardo Rodríguez wrote:
> Hi all,
>
> Given a data frame as...
>
>   
>> head(veg)
>>     
>      genus      species trophia type geo zone importance
> 1 Sphagnum  subsecundum       M        A   En        100
> 2 Sphagnum denticulatum       M        A   En        200
> 3  Molinia     caerulea       M        A   En        300
> 4 Sphagnum    flexuosum       M        A   En        400
> 5   Juncus   squarrosus       M        A   En        500
> 6    Carex     echinata       M        A   En        600
>
> I do need a new one with a new factor constructed from a concatenation of the two first columns, genus and species. I am guessing this must be a simple matter while working with R, but I am stuck at this point.
>
> Any help will be welcome! Thanks.
>
> ---
> Ricardo Rodríguez
> Your XEN ICT Team
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>   

	[[alternative HTML version deleted]]

