-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
110 lines (73 loc) · 2.2 KB
/
README.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
dpi=200,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# CYTAR
A package for analysing Argentina's Science and technology system (CYT)
<!-- . -->
# Package
# How to get started (Development version)
Install the R package using the following commands on the R console:
```R
# install.packages("devtools")
devtools::install()
```
# How to use it
First add variable with your preferred configurations in `~/.Renviron`.
```.Renviron
CYTAR_data_dir = "~/.R/CYTAR/"
```
```{r, library}
library(CYTAR)
library(ggplot2)
library(lgr)
```
# CYTAR analytics over people and researchs
opendata From Ministerio de Ciencia de la Nación Argentina
```{r, }
log.dir <- file.path(getEnv("data_dir"), "logs")
dir.create(log.dir, recursive = TRUE, showWarnings = FALSE)
log.file <- file.path(log.dir, "cytar.log")
lgr::get_logger("root")$add_appender(AppenderFile$new(log.file))
lgr::threshold("info", lgr::get_logger("root"))
lgr::threshold("info", lgr::get_logger("CYTARPersonal"))
personas <- CYTARPersonas$new()
self <- personas
personas$loadData()
nrow(personas$data)
personas.2018 <- CYTARPersonas2018$new()
self <- personas.2018
personas.2018$loadData()
nrow(personas.2018$data)
personas.2018$consolidate()
nrow(personas.2018$consolidated)
names(personas.2018$consolidated)
```
```{r, producciones}
library(dplyr)
library(readr)
producciones <- CYTARProducciones$new()
self <- producciones
producciones$configAll()
producciones$loadAll()
names(producciones$producciones.years)
personas.selected <- personas$data %>% filter(grepl("kornblihtt", apellido, ignore.case = TRUE))
personas.selected
producciones.personas <- producciones$getProduccionesPersonas(personas.df = personas.selected)
write_csv(producciones.personas, file = file.path(getDataDir(), "producciones_kornblihtt.csv"))
producciones.personas %>%
group_by(persona_id, nombre, apellido, edad) %>%
summarize( min_anio = min(anio_publica, na.rm = TRUE),
max_anio = max(anio_publica, na.rm = TRUE),
n = n()
)
```