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

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

OECD Non-Financial Corporations Debt to Surplus Ratio Analysis 1 - Load CSV file data using R

UnsplashJeremy Thomasが撮影した写真 

In this post, I will use R for analysis about OECD Non-Financial Corporations Debt to Surplus Ratio.

This ratio is debt outstanding / annual flow if gross operating surplus. So, the higher the ratio, the more debt & the less surplus.

Firstly, I downloaded the data from OECD website and got below CSV file.

Let's analyze this data using R.
First of all, I load tidyverse package with library() function.

Then, I usr read_csv() function to load CSV file data into R.

I use glimpse() function to see this data frame.

I see there are 833 obervations(Rows) and 7 variables(Columns).

Let's check each variables.

LOCATION

LOCATION is for country, I see main number of observations are 26 or 27.

 

INDICATOR

INDICATOR means data name, it is NONFINCORP only. I will delete this variable later.

 

SUBJECT

I will remove SUBJECT later bacuase it has only one value:TOT.

 

MEASURE

I will remove MEASURE too.

 

FREQUENCY

I will remove FREQUENCy too. A means Annual.

 

TIME

TIME is for year. I see 2015, 2016 and 2017 have 35 observations. So I will use 2015, 2016 and 2017 data only.

 

Value

Value is the Non-Financial Corporations Debt to Surplus Ratio. I see there is not NA observations.

 

So, I will use LOCATION, TIME(only 2015, 2016 and 2017) and Value.

I will make new data frame.

summary() finction shows data frame summary stats

That's it. Thank you!

The next post is

www.crosshyou.info