Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

vchartr

R Htmlwidget forVChart : VChart is a charting component library in VisActor visualization system. See theonline documentation for examples.

Installation

Install fromCRAN with:

install.packages("vchartr")

You can install the development version of vchartr fromGitHub with:

# install.packages("remotes")remotes::install_github("dreamRs/vchartr")

Examples

A scatter plot withpalmerpenguins dataset and inspired from the documentation:

library(vchartr)library(palmerpenguins)vchart(penguins)%>%v_scatter(aes(      x=bill_length_mm,      y=bill_depth_mm,      color=species,      shape=species))%>%v_smooth(aes(      x=bill_length_mm,      y=bill_depth_mm,      color=species),    method="lm",    se=FALSE)%>%v_scale_x_continuous(    name="Bill length (mm)")%>%v_scale_y_continuous(    name="Bill depth (mm)")%>%v_labs(    title="Penguin bill dimensions",    subtitle="Bill length and depth for Adelie, Chinstrap and Gentoo Penguins at Palmer Station LTER")%>%v_specs_legend(    orient="top",    position="start",    layout="vertical",    layoutType="absolute",    right=0,    bottom=40,    title=list(      visible=TRUE,      text="Penguin species"))

A line chart with area range:

vchart(temperatures,aes(date))%>%v_area(aes(ymin=low, ymax=high),    area=list(style=list(fill="#848585", fillOpacity=0.3)),    name="Low/high between 2019 and 2023")%>%v_line(aes(y=`2024`),    line=list(style=list(stroke="firebrick")),)%>%v_scale_x_date(    date_breaks="2 months",    date_labels="MMMM",    date_labels_tooltip="DD MMMM")%>%v_scale_y_continuous(    name="Temperature in degree celsius",    labels=format_num_d3(".0f", suffix="°C"),    labels_tooltip=format_num_d3(".3r", suffix="°C"))%>%v_labs(    title="Temperatures in France in 2024 compared with previous years",    subtitle="Source: Enedis")%>%v_specs_legend(    visible=TRUE,    orient="top",    position="left")

Development

This package use{packer} to manage JavaScript assets, see packer’sdocumentation for more.

Install nodes modules with:

packer::npm_install()

Modifysrcjs/widgets/vchart.js, then run:

packer::bundle()

Re-install R package and tryvchart() function.

Links

License

Citation

Developers

  • Victor Perrier
    Author, maintainer
  • Fanny Meyer
    Author

Dev status

  • CRAN status
  • Lifecycle: experimental
  • R-CMD-check

[8]ページ先頭

©2009-2025 Movatter.jp