-
Notifications
You must be signed in to change notification settings - Fork 2
/
project.6.R
60 lines (46 loc) · 1.35 KB
/
project.6.R
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
rm(list = ls())
library(EML)
library(rmarkdown)
library(RPostgreSQL)
library(dplyr)
library(data.table)
library(tools)
library(methods)
library(xlsx)
#read all the functions
source("../posgre.r")
source("../datatable.r")
source("../dataset.r")
#read a user info code that has all the postgres credential info
source("../user_info.r")
# input postgreSQL table
posgre<-posgrefun(dbname = dbname,
host = host,
user = user,
password = password)
meta <- posgre$meta
fact<-posgre$fact
unit <- posgre$unit
creator <- posgre$creator
keyword <- posgre$keyword
entities <- posgre$entities
dataset <- posgre$dataset
method <- posgre$method
geo <- posgre$geo
tempo <- posgre$tempo
#----------------------
#input datatable
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
datasetid=6
datatable1<-datatablefun(datasetid = datasetid,
entity = 1)
otherentity1<-datatablefun(datasetid = datasetid,
entity = 2)
#-----------------------------
#generate EML
eml<-datasetfun(datasetid = datasetid,
dataTable = datatable1,
otherentity = otherentity1)
#-----------------------------
#eml_validate(eml)
write_eml(eml, "XML_6.xml")