Opal 2.8

R tidyverse, view join tables

Objectives

  • Improve integration with R
  • Support SAS, SPSS, Stata formats
  • Improve view entities management
  • Improve repeatable variables management

New features

  • Files management from R
  • Multilines in R
  • Integration with the R packages of the tidyverse
    • use of tibble data frames,
    • import/export in SAS, SPSS, Stata using haven
  • SQL-like inner joins in Views
  • View table references can be ordered
  • Repeatable variables derivation wizard

R files

Opal files can be fully managed using R

R multilines

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

R tibble

A tibble is a modern data.frame that contains the data dictionary

  • Opal tables can be pushed to R as a tibble

opal.assign.table.tibble

  • A tibble can be imported as a Opal table

opal.symbol_import

R tibble/data.frame

The date and datetime types in Opal are now mapped to their corresponding class in R

Opal type R class
date Date
datetime POSIXct

R haven

Opal supports SAS, SPSS and Stata data formats using haven

  • Import/export data from/to SAS, SPSS or Stata files integrated to web interface
  • Opal table can be pushed to R as a tibble and saved in a SAS, SPSS or Stata file

opal.symbol_save

View full join

A view joins several tables to combine their entities (=rows) and their variables (=columns)

T2

T1

Entities

Variables

T2

T1

View inner join

A view inner join combines only the variables of the table

T2 (inner)

T1

Entities

Variables

T2 (inner)

T1

View inner join

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

View inner join

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

View tables order

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

View tables order

Value access by position or by full table name

  • A1: $('A').valueAt(1)
  • A2: $('D.T2:A')

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

Repeatable derivation

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

Releases

  • opal 2.8
  • opal-rserver 1.3 (intalls tidyverse)
  • opal R 2.5