Learn R Programming

apexcharter (version 0.4.4)

parse_df: Convert a data.frame to a list

Description

Convert data to a format suitable for ApexCharts.js

Usage

parse_df(data, add_names = FALSE)

Value

A list that can be used to specify data in ax_series for example.

Arguments

data

A data.frame or an object coercible to data.frame.

add_names

Use names of columns in output. Can be logical to reuse data names or a character vector of new names.

Examples

Run this code

# All iris dataset
parse_df(iris)

# Keep variables names
parse_df(iris[, 1:2], add_names = TRUE)

# Use custom names

parse_df(iris[, 1:2], add_names = c("x", "y"))

Run the code above in your browser using DataLab