www.crosshyou.info

政府統計の総合窓口のデータや、OECDやUCIやのデータを使って、Rの練習をしています。ときどき、読書記録も載せています。

OECD Nuclear power plants data analysis 1 - Loading CSV data with R - USA has the most nuclear power plants.


UnsplashLukáš Lehotskýが撮影した写真 

In this post, I will playaround with OECD Nuclear power plants data with R.

OECD Nuclear power plants data is defined as the number of nuclear units in operation as of 1 January 2019. It is measured as a number.

I download data from OECD web site, 

https://data.oecd.org/energy/nuclear-power-plants.htm

I got below CSV file.

It is aprety small data set.

Anyway, I load this data into R.

Firstly, I load tidyverse package, it is very useful package for data analysis.

Then, let's load data into R with read_csv() function.

We see this dataframe has 21 roes and 7 columns.

Using glimpse() function, we can see those data strutcture.

We need LOCATION and Value only because other columns have same value.

Thus, I only select LOCATION and Value and change column name.

Let's visualize data with ggplot() + geom_col().

I know OECD means OECD Total and OECDE means OECD Europe, they are not country.
So, I deleted them using filer function.

Again, let's visualize data.

All right. I see USA has the most many nuclear power plants, France has the 2nd most and Japan has the 3rd most.

That's it today. Thank you!

Next post is

www.crosshyou.info