-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_variable_report_JMacRun.Rmd
71 lines (64 loc) · 1.82 KB
/
test_variable_report_JMacRun.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: "Test Var Report"
author: "EDI Hackathon"
date: "June 12, 2019"
output:
html_document:
toc: yes
toc_depth: 3
pdf_document:
toc: yes
toc_depth: '3'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# READ IN THE DATA AND FUNCTIONS
source("/Users/Jocelyn/Documents/GitHub/Hackathon-Central-2019/R/knb-lter-vcr.57.15.r")
source("/Users/Jocelyn/Documents/GitHub/Hackathon-Central-2019/R/Jporter.r")
source("/Users/Jocelyn/Documents/GitHub/Hackathon-Central-2019/R/Jocelyn_functions_only.R")
```
## Data Table Report
```{r make_report1, echo=F,warning=F,message=F, fig.height=2,fig.width=6}
library(knitr)
library(pander)
df<-as.data.frame(dt1)
dt2 <- HackathonFunction1(df)
rownames(dt2) <- dt2$column_name
# once on each data frame
# pandoc.table(HackathonFunction1(df),split.cells=10)
# pandoc.table(HackathonFunction2(df),split.cells=10)
print(as.data.frame(dt2))
#print(HackathonFunction1(df),n=1e4)
print(HackathonFunction2(df),n=1e4)
# intitial spatial stuff goes here - id coordinates
```
## Variable Report
```{r make_report2, echo=F,warning=F,message=F, fig.height=2,fig.width=6}
attach(df)
for(varname in names(df)){
var<-get(varname)
if (is.numeric(var)){
print(varname[1])
xsummary<-make_numeric_variable_summary_df(var)
print(kable(xsummary))
#pander(xsummary)
x<-make_numeric_histogram(df,var,varname)
print(x)
}
if(is.factor(var) | is_character(var)){
print(varname[1])
xsummary<-make_cat_variable_summary_df(var)
print(kable(xsummary,format="pandoc"))
#pander(xsummary)
x<-make_categorical_histogram(df,var,varname)
print(x)
}
if(sum(xsummary$num_missing) > 0){
print("View where missing values occur in the data")
x<-make_missing_plot(var)
print(x)
}
# spatial heatmap function for variable
}
detach(df)
```