-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00_main_script.R
71 lines (58 loc) · 1.62 KB
/
00_main_script.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
61
62
63
64
65
66
67
68
69
70
71
# New database version script
#
# This is needed because the db must be improved to better implementation of all
# the data.
#### Libraries and data access ####
library(tidyverse)
library(dbplyr)
library(RPostgres)
library(pool)
library(magrittr)
library(sp)
# library(rgdal)
library(stringr)
library(glue)
# library(tidyIFN)
# db connections
oracle_db <- dbPool(
RPostgres::Postgres(),
user = Sys.getenv("DB_ADMIN"),
password = Sys.getenv("DB_PASS"),
dbname = 'oracle_ifn',
host = Sys.getenv("DB_HOST"),
port = as.numeric(Sys.getenv("DB_PORT"))
)
access4_db <- dbPool(
RPostgres::Postgres(),
user = Sys.getenv("DB_ADMIN"),
password = Sys.getenv("DB_PASS"),
dbname = 'ifn4_access',
host = Sys.getenv("DB_HOST"),
port = as.numeric(Sys.getenv("DB_PORT"))
)
brand_new_nfi_db <- pool::dbPool(
RPostgres::Postgres(),
user = Sys.getenv("DB_ADMIN"), host = Sys.getenv("DB_HOST"),
password = Sys.getenv("DB_PASS"),
dbname = 'tururu', port = as.numeric(Sys.getenv("DB_PORT"))
)
#### plots data ####
source('01_nfi234_plots_data.R')
#### topo clim own species info ####
source('02_topo_climatic_ownership_species_info.R')
#### PLOT statatic and dynamic tables ####
source('03_PLOT_static_and_dynamic_tables.R')
#### results tables ####
source('04_results_tables.R')
#### comparision tables ####
source('05_comparision_tables.R')
#### tree, shrub and regeneration tables ####
source('06_tree_shrub_regeneration_tables.R')
#### thesauruses ####
source('07_thesauruses.R')
#### building the database ####
source('99_db_building.R')
#### CLOSE POOLS ####
poolClose(oracle_db)
poolClose(access4_db)
poolClose(brand_new_nfi_db)