Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201977

Data transformation in R: Splitting a level in two

$
0
0

I've got a df with country-level data entered in 2003.

Several rows of data belong to a country named 'Federal Republic of Yugoslavia'.

These are two separate countries today and I want to duplicate these rows of data so that I can rename each set of rows to its respective modern country name.

data.frame(Country = "Yugoslavia", Chickens = 567)

Using this minimal example, how do I create this dataframe?

data.frame(Country = c("Serbia", "Montenegro"), Chickens = 567)

Viewing all articles
Browse latest Browse all 201977

Trending Articles