Skip to content

Commit

Permalink
add dplyr
Browse files Browse the repository at this point in the history
  • Loading branch information
helgasoft committed Dec 19, 2024
1 parent f03c0d6 commit 7bf1dc9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
11 changes: 6 additions & 5 deletions R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
#'     from - name of 'from' column\cr
#'     to - name of 'to' column\cr
#'
#' @examples
#' @examples
#' library(dplyr)
#' if (interactive()) { # comm.out: Fedora errors about some 'browser'
#' library(sf)
#' fname <- system.file("shape/nc.shp", package="sf")
Expand All @@ -85,15 +86,15 @@
#' )
#'
#' htmltools::browsable(
#' lapply(iris |> dplyr::group_by(Species) |> dplyr::group_split(),
#' lapply(iris |> group_by(Species) |> group_split(),
#' function(x) {
#' x |> ec.init(ctype= 'scatter', title= list(text= unique(x$Species)))
#' }) |>
#' ec.util(cmd= 'tabset')
#' )
#'
#' p1 <- cars |> ec.init(grid= list(top=26), height=333) # move chart up
#' p2 <- mtcars |> dplyr::arrange(mpg) |> ec.init(height=333, ctype='line')
#' p2 <- mtcars |> arrange(mpg) |> ec.init(height=333, ctype='line')
#' ec.util(cmd= 'tabset', cars= p1, mtcars= p2)
#' }
#'
Expand All @@ -113,7 +114,7 @@
#' sers <- lapply(mtcars |> group_by(cyl) |> group_split(), \(x) {
#' cyl <- as.character(unique(x$cyl))
#' list(type='scatter', id=cyl, dataGroupId=cyl,
#' data= ec.data(x|>select(mpg,hp)),
#' data= ec.data(x |> select(mpg,hp)),
#' universalTransition= TRUE)
#' })
#' oscatter <- list(
Expand All @@ -129,7 +130,7 @@
#' type= 'pie', label= list(show=TRUE), colorBy= 'data',
#' data= ec.data(mtcars |> group_by(cyl) |> summarize(value= mean(hp)) |>
#' mutate(groupId= as.character(cyl), name= as.character(cyl)),'names'),
#' universalTransition= list(enabled=T, seriesKey= cyls)
#' universalTransition= list(enabled=TRUE, seriesKey= cyls)
#' ))
#' )
#' ec.util(cmd='morph', oscatter, opie)
Expand Down
1 change: 1 addition & 0 deletions demo/00Index
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
eshiny echarty and Shiny integration showcase
js2r Translation assistant - ECharty javaScript to R
coder Edit and plot charts with R code scaffolding
examples Collection of code examples
10 changes: 5 additions & 5 deletions demo/examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
#' #------ Pie
#' isl <- data.frame(name=names(islands), value=islands) |> filter(value>100) |> arrange(value)
#' ec.init( preset= FALSE,
#' title= list(text = "Landmasses over 60,000 mi\u00B2", left = 'center'),
#' title= list(text = "Landmasses over 60,000 sq.mi", left = 'center'),
#' tooltip= list(trigger='item'), #, formatter= ec.clmn()),
#' series= list(list(type= 'pie', radius= '50%',
#' data= ec.data(isl, 'names'), name='mi\u00B2'))
#' data= ec.data(isl, 'names'), name='sq.mi'))
#' )
#'
#'
Expand Down Expand Up @@ -350,9 +350,9 @@
#' list('Jasmin Krause', 52, 'Musician', 287, '2011-02-14'),
#' list('Li Lei', 37, 'Teacher', 219, '2011-02-18'),
#' list('Karle Neumann', 25, 'Engineer', 253, '2011-04-02'),
#' list('Adrian Groß', 19, 'Teacher', NULL, '2011-01-16'),
#' list('Adrian Gro?', 19, 'Teacher', NULL, '2011-01-16'),
#' list('Mia Neumann', 71, 'Engineer', 165, '2011-03-19'),
#' list('Böhm Fuchs', 36, 'Musician', 318, '2011-02-24'),
#' list('B?hm Fuchs', 36, 'Musician', 318, '2011-02-24'),
#' list('Han Meimei', 67, 'Engineer', 366, '2011-03-12'))),
#' list(transform = list(type= 'sort', config=list(
#' list(dimension='profession', order='desc'),
Expand Down Expand Up @@ -406,7 +406,7 @@
#' ec.init(preset= FALSE,
#' series= list(list(
#' type = 'gauge', max = 160, min=40,
#' detail = list(formatter='\U1F9E0={value}'),
#' detail = list(formatter='{value}'),
#' data = list(list(value=85, name='IQ test')) )) )
#'
#'
Expand Down
9 changes: 5 additions & 4 deletions man/ec.util.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7bf1dc9

Please sign in to comment.