R tidyverse, view join tables
Repeatable variables are now expressed as multiple lines in a R data frame (see Opal 2.7 presentation)
ID | A | B |
---|---|---|
1 | a | 1 |
1 | b | 2 |
2 | a | 3 |
2 | c | 1 |
ID | A | B |
---|---|---|
1 | a b |
1 2 |
2 | a c |
3 1 |
<=>
Opal
R
A tibble is a modern data.frame that contains the data dictionary
The date and datetime types in Opal are now mapped to their corresponding class in R
Opal type | R class |
---|---|
date | Date |
datetime | POSIXct |
A view joins several tables to combine their entities (=rows) and their variables (=columns)
T2
T1
Entities
Variables
T2
T1
A view inner join combines only the variables of the table
T2 (inner)
T1
Entities
Variables
T2 (inner)
T1
Use case: a large table to contribute only its variables
ID | A | B |
---|---|---|
1 | b | 1 |
2 | c | 3 |
ID | C | D |
---|---|---|
1 | x | 2 |
2 | y | 4 |
3 | z | 6 |
... | ... | ... |
ID | A | B | C | D |
---|---|---|---|---|
1 | b | 1 | x | 2 |
2 | c | 3 | y | 4 |
+
=>
T2 (inner)
T1
View
Use case: a table for providing the entities (rows) and inner tables for providing variables (columns)
ID |
---|
1 |
2 |
ID | A |
---|---|
1 | x |
2 | y |
3 | z |
4 |
ID | A | B |
---|---|---|
1 | x | 2 |
2 | y |
+
=>
T2 (inner)
ID | B |
---|---|
1 | 2 |
+
T3 (inner)
T1
View
Table order affects the value sequences order
ID | A |
---|---|
1 | a |
2 | b |
ID | A |
---|---|
1 | x |
2 | y |
ID | A |
---|---|
1 | a,x |
2 | b,y |
+
=>
T2
T1
View
ID | A |
---|---|
1 | x |
2 | y |
ID | A |
---|---|
1 | a |
2 | b |
ID | A |
---|---|
1 | x,a |
2 | y,b |
+
=>
T1
T2
View
Value access by position or by full table name
are equivalent
ID | A |
---|---|
1 | x |
2 | y |
ID | A |
---|---|
1 | a |
2 | b |
ID | A1 | A2 |
---|---|---|
1 | x | x |
2 | y | y |
+
=>
T1
T2
View
Derivation wizard for transposing a repeatable variable per value occurrence
ID | A_1 | A_2 |
---|---|---|
1 | a | b |
2 | c | d |
ID | A |
---|---|
1 | a b |
2 | c d |
=>
derived to