Hello

I have the following dataframe :
df <- data.frame(
Country=c("Zimbabwe","Burkina Faso","South Africa","Madagascar","Tanzania",
"Mali","Mozambique","Madagascar","Ghana","Nigeria","Kenya","Burkina Faso",
  "South Africa","Tanzania","Kenya","Ethiopia" ) ,

Iso=c("ZW","BF","ZA","MG","TZ","ML","MZ","MG","GH","NG","KE","BF",
  "ZA","TZ","KE","ET") ,

Abaco=c(1,0,1,1,0,1,0,0,0,0,1,1,0,0,0,0) ,
Adaptclone= c(0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0)
)
There is a lot of column like Abaco, Adaptclone,...
I would like to built a dataframe
wich transforms the initial dataframe of 4 columns into a dataframe of 3 
columns as the following dataframe

Country          Iso    Project
Zimbabwe         ZW     Abaco
South Africa     ZA     Abaco
Madagascar       MG     Abaco
Tanzania         TZ     Adaptclone
Mali             ML     Abaco
Mali             ML     Adaptclone
......

Any idea ?
Michel

-- 
Michel ARNAUD
Chargé de mission auprès du DRH
DGDRD-Drh - TA 174/04
Av Agropolis 34398 Montpellier cedex 5
tel : 04.67.61.75.38
fax : 04.67.61.57.87
port: 06.47.43.55.31


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to