change the dataset

Hello there,
How can I write a code that creats a time series for each country (let say life expectancy), from a world bank's csv dataset, as shown in the picture

.

Hi,

Welcome to the RStudio community!

Could you provide a bit more detail about the input dataset you have and the output format you like. I'm a bit confused by what you've provided now.

You can always use the following link to learn how to better structure your post:

Good luck!
PJ

many thanks to the replay,

here is the situation:

Yours.

You can use tidyr::pivot_longer()

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like

thank you,
Iwill learn about it, then apply it.

Hello again
Guess what?
It's worked with me like I want. Wow, an exciting achievement for a new bee.
thank you a lot.

1 Like