Rで何かをしたり、読書をするブログ

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

OECD Doctors' consultations data analysis 1 - Read CSV file data into R

f:id:cross_hyou:20210605102858j:plain

Photo by Tobias Keller on Unsplash

 

f:id:cross_hyou:20210605104403p:plain

This time let's see OECD Dictor's consultations data.

This indicator presents data on the number of consultations patiens have with doctors in a given year.

I download below file from the OECD web site(Health care use - Doctors' consultations - OECD Data)

f:id:cross_hyou:20210605105226p:plain

Let's read this CSV flle with read_csv() function in R.

First, load tidyverse package.

f:id:cross_hyou:20210605105539p:plain

Now, let's use read_csv() function to read the CSV file.

f:id:cross_hyou:20210605105822p:plain

Now using str() function, we can see df structure.

f:id:cross_hyou:20210605110039p:plain

We see we have 1167 observations and 7 columns. 

table() functions and length() shows how many different values in variables.

f:id:cross_hyou:20210605110407p:plain

For LOCATION, we have 41 LOCATIONs.

 

f:id:cross_hyou:20210605110730p:plain

INDICATOR, SUBJECT, MEASURE and FREQUENCY have only one value.
So, we remove those variables.

f:id:cross_hyou:20210605111039p:plain


summary() function shows data frame summary

f:id:cross_hyou:20210605111222p:plain

We can see the oldest time is 1960 and the newest time is 2019. The minimum Value is 0.7 and the maximum value is 16.9, the average value is 5.794.

That's it. Thank you!
Next post is...

 

www.crosshyou.info