MUCollective / multiverse

R package for creating explorable multiverse analysis
https://mucollective.github.io/multiverse/
GNU General Public License v3.0
62 stars 5 forks source link

A multiverse with no branches should still have one universe in it #21

Closed mjskay closed 5 years ago

mjskay commented 5 years ago

Currently a multiverse with no branches is empty:

M = multiverse()
multiverse_table(M)
data frame with 0 columns and 0 rows

But it should be a single universe with no parameters; e.g. something like this:

M = multiverse()
multiverse_table(M)
# A tibble: 1 x 3
  .parameter_assignment .code      .results
  <list>                <list>     <list>  
1 <list [0]>            <language> <env>  

because you should still be able to write code into the multiverse even if it has no branches, which would create a single universe, up until the point where you write in some code with branches in it.

abhsarma commented 5 years ago

It's initialised empty, but if you add some code like this:

M$x <- ~ 5
multiverse_table(M)

It creates :

# A tibble: 1 x 3
  .parameter_assignment .code      .results
  <list>                <list>     <list>  
1 <lgl [1]>            <language> <env> 

idk if that's the way to go

mjskay commented 5 years ago

That seems fine for now.

I wonder why an empty parameter assignment is a list(NA) ? I'd have thought it would be a list()

abhsarma commented 5 years ago

It should have been list( list() ) The outer list is the column type, and the inner list is actually an empty list