Making some notes here on functions that are not currently working with the efile data:
d1 <- readRDS( "F9-P09-T00-EXPENSES-2018.rds" )
d2 <- readRDS( "F9-P01-T00-SUMMARY-2018.rds" )
d3 <- readRDS( "F9-P10-T00-BALANCE-SHEET-2018.rds" )
df <- merge( d1, d2 )
df <- merge( df, d3 )
> df <- get_dgdr( df ) #Donation/Grant Dependence Ratio
Error in sum(sapply(d[these], function(x) is.numeric(x))) :
invalid 'type' (list) of argument
> df <- get_eidr( df ) #Earned Income Dependence Ratio
Error in sum(sapply(d[these], function(x) is.numeric(x))) :
invalid 'type' (list) of argument
> df <- get_ggr( df ) #Government Grants Ratio
Error in sum(sapply(d[these], function(x) is.numeric(x))) :
invalid 'type' (list) of argument
> df <- get_iidr( df ) #Investment Income Dependence Ratio
Error in sum(sapply(d[these], function(x) is.numeric(x))) :
invalid 'type' (list) of argument
> df <- get_podpm( df ) #Post-Depreciation Profitability Margin
[1] "Revenues cannot be equal to zero: 0 cases have been replaced with NA."
podpm podpm.w podpm.n podpm.p
Min. : NA Min. : NA Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA Median : NA Median : NA
Mean :NaN Mean :NaN Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA Max. : NA Max. : NA
Error in density.default(podpm, na.rm = T) :
need at least 2 points to select a bandwidth automatically
In addition: Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 1 variables were ( was) coerced to numeric.
> df <- get_predpm( df ) #Pre-Depreciation Profitability Margin
[1] "Revenue cannot be zero: 0 cases have been replaced with NA."
predpm predpm.w predpm.n predpm.p
Min. : NA Min. : NA Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA Median : NA Median : NA
Mean :NaN Mean :NaN Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA Max. : NA Max. : NA
Error in density.default(predpm, na.rm = T) :
need at least 2 points to select a bandwidth automatically
In addition: Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
The rest seem to work fine:
> df <- get_arr( df )
[1] "Total revenue cannot be equal to zero: 5507 cases have been replaced with NA."
arr arr.w arr.n arr.p
Min. : -35478 Min. : 0.000 Min. :-0.406 Min. : 1.0
1st Qu.: 0 1st Qu.: 0.445 1st Qu.:-0.359 1st Qu.: 25.0
Median : 1 Median : 1.084 Median :-0.291 Median : 50.0
Mean : 516 Mean : 3.833 Mean : 0.000 Mean : 50.5
3rd Qu.: 3 3rd Qu.: 2.863 3rd Qu.:-0.103 3rd Qu.: 75.0
Max. :128954332 Max. :73.178 Max. : 7.350 Max. :100.0
NA's :7834 NA's :7834 NA's :7834 NA's :7834
Warning messages:
1: In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
2: In get_arr(df) :
One denominator variable detected in the dataset but not the other. Ratios calculated in the presence of the missing variable. Check to ensure data is sound.
> df <- get_aer( df )
[1] "total.expense cannot be equal to zero: 2242 cases have been replaced with NA."
aer aer.w aer.n aer.p
Min. :-9.05 Min. :0.00 Min. :-0.79 Min. : 1.0
1st Qu.: 0.02 1st Qu.:0.02 1st Qu.:-0.66 1st Qu.: 25.0
Median : 0.10 Median :0.10 Median :-0.27 Median : 50.0
Mean : 0.15 Mean :0.15 Mean : 0.00 Mean : 50.5
3rd Qu.: 0.19 3rd Qu.:0.19 3rd Qu.: 0.21 3rd Qu.: 75.0
Max. :56.79 Max. :1.00 Max. : 4.37 Max. :100.0
NA's :161079 NA's :161079 NA's :161079 NA's :161079
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_cr( df )
[1] "Payables cannot be zero: 3103 cases have been replaced with NA."
cr cr.w cr.n cr.p
Min. : -8760.3 Min. : 0.0 Min. :-0.2 Min. : 1.0
1st Qu.: 1.9 1st Qu.: 1.9 1st Qu.:-0.2 1st Qu.: 25.0
Median : 4.6 Median : 4.6 Median :-0.2 Median : 50.0
Mean : 455.8 Mean : 57.7 Mean : 0.0 Mean : 50.5
3rd Qu.: 15.2 3rd Qu.: 15.2 3rd Qu.:-0.2 3rd Qu.: 75.0
Max. :1115988.4 Max. :2053.0 Max. : 8.1 Max. :100.0
NA's :396879 NA's :396879 NA's :396879 NA's :396879
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 8 variables were ( was) coerced to numeric.
> df <- get_dar( df ) #Debt to Asset Ratio
[1] "Assets cannot be equal to zero: 10608 cases have been replaced with NA."
dar dar.w dar.z dar.p
Min. :-5662.29 Min. :0.00 Min. :-0.44 Min. : 1.0
1st Qu.: 0.00 1st Qu.:0.00 1st Qu.:-0.44 1st Qu.: 25.0
Median : 0.04 Median :0.04 Median :-0.38 Median : 50.0
Mean : 2.55 Mean :0.28 Mean : 0.00 Mean : 50.5
3rd Qu.: 0.29 3rd Qu.:0.29 3rd Qu.: 0.01 3rd Qu.: 75.0
Max. :76219.08 Max. :4.70 Max. : 6.94 Max. :100.0
NA's :67830 NA's :67830 NA's :67830 NA's :67830
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 4 variables were ( was) coerced to numeric.
> df <- get_der( df ) #Debt to Equity Ratio
[1] "Equity cannot be equal to zero: 998 cases have been replaced with NA."
der der.w der.n der.p
Min. :-34226726 Min. :-2.91 Min. :-4.10 Min. : 1.00
1st Qu.: 0 1st Qu.: 0.01 1st Qu.:-0.17 1st Qu.: 25.00
Median : 0 Median : 0.03 Median :-0.13 Median : 50.00
Mean : -230 Mean : 0.13 Mean : 0.00 Mean : 50.49
3rd Qu.: 0 3rd Qu.: 0.13 3rd Qu.:-0.01 3rd Qu.: 75.00
Max. : 1022239 Max. : 4.89 Max. : 6.41 Max. :100.00
NA's :261801 NA's :261801 NA's :261801 NA's :261801
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_dmr( df ) #Debt Management Ratio
[1] "Unrestricted net assets cannot be equal to zero: 998 cases have been replaced with NA."
dmr dmr.w dmr.n dmr.p
Min. :-34302446 Min. :-13.44 Min. :-4.38 Min. : 1.00
1st Qu.: 0 1st Qu.: 0.00 1st Qu.:-0.12 1st Qu.: 25.00
Median : 0 Median : 0.06 Median :-0.10 Median : 50.00
Mean : -163 Mean : 0.38 Mean : 0.00 Mean : 50.49
3rd Qu.: 0 3rd Qu.: 0.39 3rd Qu.: 0.00 3rd Qu.: 75.00
Max. : 1793333 Max. : 19.99 Max. : 6.21 Max. :100.00
NA's :206623 NA's :206623 NA's :206623 NA's :206623
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_doch( df ) #Days of Operating Cash on Hand
[1] "Denominator cannot be zero: 812 cases have been replaced with NA."
doch doch.w doch.n doch.p
Min. : -5315055 Min. : 0.0 Min. :-0.4 Min. : 1.0
1st Qu.: 75 1st Qu.: 74.9 1st Qu.:-0.4 1st Qu.: 25.0
Median : 161 Median : 161.5 Median :-0.3 Median : 50.0
Mean : 7246 Mean : 427.7 Mean : 0.0 Mean : 50.5
3rd Qu.: 354 3rd Qu.: 353.9 3rd Qu.:-0.1 3rd Qu.: 75.0
Max. :200833950 Max. :7907.2 Max. : 7.4 Max. :100.0
NA's :344262 NA's :344262 NA's :344262 NA's :344262
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 6 variables were ( was) coerced to numeric.
> df <- get_doci( df ) #Days of Operating Cash and Investments
[1] "Denominator cannot be zero: 812 cases have been replaced with NA."
doci doci.w doci.n doci.p
Min. :-770904130 Min. :-12669.1 Min. :-5.4 Min. : 1.0
1st Qu.: -295 1st Qu.: -295.5 1st Qu.: 0.0 1st Qu.: 25.0
Median : -9 Median : -9.2 Median : 0.1 Median : 50.0
Mean : 67303 Mean : -219.0 Mean : 0.0 Mean : 50.5
3rd Qu.: 151 3rd Qu.: 150.9 3rd Qu.: 0.2 3rd Qu.: 75.0
Max. :2594488620 Max. : 10268.3 Max. : 4.6 Max. :100.0
NA's :383996 NA's :383996 NA's :383996 NA's :383996
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 6 variables were ( was) coerced to numeric.
> df <- get_er( df ) #Equity Ratio
[1] "Total assets cannot be equal to zero: 10608 cases have been replaced with NA."
er er.w er.n er.p
Min. :-76218.08 Min. :-2.886 Min. :-6.723 Min. : 1.0
1st Qu.: 0.79 1st Qu.: 0.786 1st Qu.: 0.031 1st Qu.: 25.0
Median : 0.99 Median : 0.986 Median : 0.399 Median : 50.0
Mean : -1.18 Mean : 0.769 Mean : 0.000 Mean : 50.5
3rd Qu.: 1.00 3rd Qu.: 1.000 3rd Qu.: 0.425 3rd Qu.: 75.0
Max. : 5663.29 Max. : 1.000 Max. : 0.425 Max. :100.0
NA's :10608 NA's :10608 NA's :10608 NA's :10608
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_lar( df ) #Lands to Assets Ratio
[1] "assets cannot be equal to zero: 10608 cases have been replaced with NA."
lar lar.w lar.n lar.p
Min. :-8387.95 Min. :0.00 Min. :-0.66 Min. : 1.00
1st Qu.: 0.05 1st Qu.:0.05 1st Qu.:-0.59 1st Qu.: 25.00
Median : 0.20 Median :0.20 Median :-0.36 Median : 50.00
Mean : 0.68 Mean :0.44 Mean : 0.00 Mean : 50.49
3rd Qu.: 0.54 3rd Qu.:0.54 3rd Qu.: 0.14 3rd Qu.: 75.00
Max. :34640.00 Max. :4.08 Max. : 5.41 Max. :100.00
NA's :225150 NA's :225150 NA's :225150 NA's :225150
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_moch( df ) #Months of Operating Cash on Hand
[1] "Denominator cannot be zero: 812 cases have been replaced with NA."
moch moch.w moch.n moch.p
Min. :-174742 Min. : 0.0 Min. :-0.4 Min. : 1.0
1st Qu.: 2 1st Qu.: 2.5 1st Qu.:-0.4 1st Qu.: 25.0
Median : 5 Median : 5.3 Median :-0.3 Median : 50.0
Mean : 238 Mean : 14.1 Mean : 0.0 Mean : 50.5
3rd Qu.: 12 3rd Qu.: 11.6 3rd Qu.:-0.1 3rd Qu.: 75.0
Max. :6602760 Max. :260.0 Max. : 7.4 Max. :100.0
NA's :344262 NA's :344262 NA's :344262 NA's :344262
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 6 variables were ( was) coerced to numeric.
> df <- get_or( df ) #Operating Margin
[1] "Equity (BOY) cannot be equal to zero: 672 cases have been replaced with NA."
or or.w or.n or.p
Min. :-830340.0 Min. :-2.35 Min. :-3.01 Min. : 1.0
1st Qu.: 0.9 1st Qu.: 0.92 1st Qu.:-0.21 1st Qu.: 25.0
Median : 1.0 Median : 1.02 Median :-0.13 Median : 50.0
Mean : 11.1 Mean : 1.17 Mean : 0.00 Mean : 50.5
3rd Qu.: 1.2 3rd Qu.: 1.16 3rd Qu.:-0.01 3rd Qu.: 75.0
Max. :1134049.0 Max. : 9.22 Max. : 6.89 Max. :100.0
NA's :208263 NA's :208263 NA's :208263 NA's :208263
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 2 variables were ( was) coerced to numeric.
> df <- get_per( df ) #Program Efficiency Ratio
[1] "Total expenses cannot be equal to zero: 3604 cases have been replaced with NA."
per per.w per.n per.p
Min. : -472.5 Min. : 0.000 Min. :-0.460 Min. : 1.0
1st Qu.: 0.6 1st Qu.: 0.644 1st Qu.:-0.272 1st Qu.: 25.0
Median : 0.9 Median : 0.865 Median :-0.207 Median : 50.0
Mean : 10.6 Mean : 1.574 Mean : 0.000 Mean : 50.5
3rd Qu.: 1.0 3rd Qu.: 1.000 3rd Qu.:-0.168 3rd Qu.: 75.0
Max. :1784888.7 Max. :26.462 Max. : 7.279 Max. :100.0
NA's :6950 NA's :6950 NA's :6950 NA's :6950
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 3 variables were ( was) coerced to numeric.
> df <- get_qr( df ) #Quick Ratio
[1] "Payables cannot be zero: 3103 cases have been replaced with NA."
qr qr.w qr.n qr.p
Min. : -8732.7 Min. : 0.0 Min. :-0.2 Min. : 1.0
1st Qu.: 1.7 1st Qu.: 1.7 1st Qu.:-0.2 1st Qu.: 25.0
Median : 4.2 Median : 4.2 Median :-0.2 Median : 50.0
Mean : 367.2 Mean : 52.0 Mean : 0.0 Mean : 50.5
3rd Qu.: 13.9 3rd Qu.: 13.9 3rd Qu.:-0.2 3rd Qu.: 75.0
Max. :600121.8 Max. :1863.3 Max. : 8.1 Max. :100.0
NA's :396065 NA's :396065 NA's :396065 NA's :396065
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 6 variables were ( was) coerced to numeric.
> df <- get_ssr( df ) #Self Sufficiency Ratio
[1] "Total expenses cannot be equal to zero: 3617 cases have been replaced with NA."
ssr ssr.w ssr.n ssr.p
Min. : -222.84 Min. :0.00 Min. :-0.96 Min. : 1.0
1st Qu.: 0.00 1st Qu.:0.00 1st Qu.:-0.96 1st Qu.: 25.0
Median : 0.28 Median :0.28 Median :-0.34 Median : 50.0
Mean : 1.12 Mean :0.43 Mean : 0.00 Mean : 50.5
3rd Qu.: 0.85 3rd Qu.:0.85 3rd Qu.: 0.95 3rd Qu.: 75.0
Max. :72668.71 Max. :1.65 Max. : 2.78 Max. :100.0
NA's :76142 NA's :76142 NA's :76142 NA's :76142
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 3 variables were ( was) coerced to numeric.
> df <- get_stdr( df ) #Short Term Debt Ratio
[1] "Net assets cannot be zero: 10220 cases have been replaced with NA."
stdr stdr.w stdr.n stdr.p
Min. :-7385.5 Min. :-2.9 Min. :-3.1 Min. : 1.0
1st Qu.: 0.0 1st Qu.: 0.0 1st Qu.:-0.2 1st Qu.: 25.0
Median : 0.0 Median : 0.0 Median :-0.2 Median : 50.0
Mean : 0.0 Mean : 0.2 Mean : 0.0 Mean : 50.4
3rd Qu.: 0.2 3rd Qu.: 0.2 3rd Qu.:-0.1 3rd Qu.: 75.0
Max. : 1050.4 Max. : 7.1 Max. : 6.9 Max. :100.0
NA's :389731 NA's :389731 NA's :389731 NA's :389731
Warning message:
In coerce_numeric(d = dat, vars = v) :
At least one of the provided numerator variables was not of object class numeric. 3 variables were ( was) coerced to numeric.
>
Making some notes here on functions that are not currently working with the efile data:
The rest seem to work fine: