Hello,
Iâd like to do next, see if you could help me please: I have a csv called âdatuakâ with a id called âcalee_idâ and a colunm called âpoidsâ. I have another csv called âdatuak2â with the same id called âcalee_idâ, (although there are âcalee_idâ that are in âdatuakâ but not in âdatuak2â and inverse), and a column called âkg_totalesâ in which the values are repeteated for each calee_id because are the sum of the colum âkgâ for each row. I show you the table âdatuakâ and âdatuak2â: Datuak (in the example the calee_id is the same, but there are a lot): poids calee_id maree_id 10 1.27E+12 0.3013157 20 1.27E+12 0.05726046 20 1.27E+12 0.73631699 25 1.27E+12 0.74492002 3 1.27E+12 0.74492002 27 1.27E+12 0.31776439 43 1.27E+12 0.31776439 Datuak2: calee_id maree_id kg_totales effectif 1 1.33959e+12 0.782835873 129.7 30 2 1.33959e+12 0.782835873 129.7 40 3 1.33959e+12 0.782835873 129.7 10 4 1.33959e+12 0.782835873 129.7 5 5 1.33959e+12 0.782835873 129.7 1.7 6 1.33959e+12 0.782835873 129.7 20 7 1.33959e+12 0.782835873 129.7 20 8 1.33959e+12 0.782835873 129.7 1 9 1.33959e+12 0.782835873 129.7 2 I would like to identify in the csv âdatuak2â the corresponding âcalee_idâ that also are in âdatuakâ, and create a new column in âdatuakâ with the values for each âcalee_idâ from âkg_totalesâ, and not repeat them. So the final table would be âdatuakâ, with âcalee_idâ, âpoidsâ, and the new column âkg_totalesâ with its corresponding value for each row. Thank you very much, Nerea -- [[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.