Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

number_unnamed

Number Starting at 1


Description

JavaScript starts at 0, but R starts at 1. This means unnamed lists and vectors are indexed starting at 0 in listviewer widgets. This little helper function tries to resolve the disconnect by assigning sequential numbers starting at 1 to names for unnamed lists and vectors. Please note though that using number_unnamed will potentially cause difficulties serializing back and forth between JavaScript and R.

Usage

number_unnamed(l)

Arguments

l

list

Examples

library(listviewer)
jsonedit(
  number_unnamed(list(x=list(letters[1:3])))
)

listviewer

'htmlwidget' for Interactive Views of R Lists

v3.0.0
MIT + file LICENSE
Authors
Jos de Jong [aut, cph] (jsoneditor.js library in htmlwidgets/jsoneditor, http://github.com/josdejong/jsoneditor/), Mac Gainer [aut, cph] (react-json-view library in htmlwidgets/react-json, https://github.com/mac-s-g/react-json-view), Kent Russell [aut, cre] (R interface)
Initial release
2019-11-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.