-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadatatae.Rmd
65 lines (51 loc) · 2.41 KB
/
metadatatae.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
---
title: "metadatatables"
author: "Steven Sabol"
date: "7/16/2021"
output: html_document
---
```{r setup, include=FALSE,warning=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre1.8.0_271') # for 64-bit versi
library(DT)
library(readxl)
library(tidyverse)
# meta_table <- read_excel("C:/Users/sabol/Google Drive/Model Master/Data/Update/meta_table.xlsx")
# cmd_meta_final <- read_excel("C:/Users/sabol/Google Drive/Model Master/Data/Update/Meta/cmd_meta_final.xlsx",
# col_types = c("text", "text", "date",
# "date", "text", "text", "text", "text",
# "text", "text", "text", "text", "text",
# "numeric", "text", "text", "text",
# "text", "text", "text", "text", "text",
# "text", "text", "text", "text", "text",
# "text", "text", "text", "text", "text",
# "text", "text", "text", "text", "text",
# "text", "text", "text"))
cmd_meta_csv <- read_excel("C:/Users/sabol/Google Drive/Model Master/Data/Update/Meta/Final_Monthly/final_meta_website.xlsx")
cmd_meta_csv <- data.frame(cmd_meta_csv[,c(1:15)]) #5777
cmd_meta_csv = cmd_meta_csv[!duplicated(cmd_meta_csv$cmd_id),] #5766
cmd_meta_all <- read_excel("C:/Users/sabol/Google Drive/Model Master/Data/Update/Meta/Final_Monthly/final_meta_all.xlsx")
cmd_meta_dups = cmd_meta_all[duplicated(cmd_meta_all$cmd_id),] #5766
df[duplicated(df) | duplicated(df, fromLast=TRUE), ]
cmd_meta_dups = cmd_meta_all %>% group_by_at(vars(cmd_id)) %>% filter(n()>1) %>% ungroup()
cmd_meta_csv <- (unique.data.frame(cmd_meta_csv))
# cmd_meta_csv = cmd_meta_csv[duplicated(cmd_meta_csv$ï..cmd_id) == FALSE,]
# rownames(cmd_meta_csv) <- cmd_meta_csv$ï..cmd_id
# cmd_meta_final <- (cmd_meta_csv[,-1])
cmd_meta_final <- cmd_meta_csv
cmd_meta_final$series_start <- lubridate::ymd(cmd_meta_final$series_start)
# cmd_meta_final <- cmd_meta_final[,c(1:13)]
# row.names.data.frame(cmd_meta_final) <- cmd_meta_final$cmd_id
# cmd_meta_final
# plotting columns of a datatable https://laustep.github.io/stlahblog/posts/PlotDatatableColumns.html
```
## Data Tables
Adding filtering!
```{r meta-filter, echo=FALSE}
datatable(cmd_meta_final, colnames = c("Start Date" = "start_date"), filter = 'top', options = list(
pageLength = 20, autoWidth = TRUE, initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#000', 'color': '#fff'});",
"}")
))
```