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

Use unnamed label syntax for generated multiverse blocks? #69

Closed mjskay closed 4 years ago

mjskay commented 4 years ago

Why use the explicitly named parameter for generated block labels / in the docs? I didn't even know you could do this:

```{multiverse label = default-m-2, inside = M}

```

When this works equally well and is consistent with every other instance of named blocks in markdown I've seen:

```{multiverse default-m-2, inside = M}

```

I'd say it's better to go with what people tend to see / know from other contexts? (also is shorter, which is nice given the verbose names). Unless I'm crazy and people actually use the label parameter by name.

abhsarma commented 4 years ago

yeah, this can be easily implemented. Just requires some handling of the lists of different lengths. All of the info gets passed as options$params.src and if a label is not explicitly named, we get a list of three character vectors of different lengths. So basically need to handle the case where labels are and not are explicitly specified

mjskay commented 4 years ago

Oh I thought it already worked? I left the arg name off in my tests and it worked fine interactively anyway (didn't test knitting)

abhsarma commented 4 years ago

It was throwing errors while knitting, and looking at the (now old) code I can't imagine it working without these changes

mjskay commented 4 years ago

Ha 🙂