Skip to content

Commit

Permalink
fixed check
Browse files Browse the repository at this point in the history
  • Loading branch information
gluc committed Nov 12, 2023
1 parent bee0d76 commit fcee911
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 152 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [master, dev]
pull_request:
branches: [main, master]
branches: [master, dev]

name: R-CMD-check

Expand Down
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ S3method(as.dendrogram,Node)
S3method(as.list,Node)
S3method(plot,Node)
S3method(print,Node)
export(.parentSeparator)
export(.separator)
export(Aggregate)
export(AreNamesUnique)
export(Climb)
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Upgrade to R 3.4.x and newest package versions.


## Version 0.2.4
- FIX: applications vignette, changed from http://htmlwidgets.org to http://www.htmlwidgets.org, as requested by CRAN
- FIX: applications vignette, changed from https://htmlwidgets.org to https://www.htmlwidgets.org, as requested by CRAN

## Version 0.2.3
- FIX #33: applications vignette doesn't build because of DiagrammeR update
Expand Down
2 changes: 0 additions & 2 deletions R/node_actives.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ changeName <- function(node, oldName, newName) {
return (newName)
}

#' @export
.separator <- function(self) {
if (isRoot(self)) return("")
if (self$position == self$parent$count) mySeparator <- paste0(self$root$printFormatters$s, self$root$printFormatters$l, self$root$printFormatters$h)
else mySeparator <- paste0(self$root$printFormatters$s, self$root$printFormatters$j, self$root$printFormatters$h)
return (paste0(.parentSeparator(self$parent), mySeparator))
}

#' @export
.parentSeparator <- function(self) {
if (isRoot(self)) return("")

Expand Down
2 changes: 1 addition & 1 deletion R/node_methods_traversal.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Traverse = function(node,
traversal = c("pre-order", "post-order", "in-order", "level", "ancestor"),
pruneFun = NULL,
filterFun = NULL) {
#traverses in various orders. See http://en.wikipedia.org/wiki/Tree_traversal
#traverses in various orders. See https://en.wikipedia.org/wiki/Tree_traversal

nodes <- list()

Expand Down
10 changes: 5 additions & 5 deletions R/node_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plot.Node <- function(x, ..., direction = c("climb", "descend"), pruneFun = NULL
#'
#' Use these methods to style your graph, and to plot it. The functionality is built around the
#' DiagrammeR package, so for anything that goes beyond simple plotting, it is recommended to read its
#' documentation at http://rich-iannone.github.io/DiagrammeR/docs.html. Note that DiagrammeR is only suggested
#' documentation at https://rich-iannone.github.io/DiagrammeR/docs.html. Note that DiagrammeR is only suggested
#' by data.tree, so `plot` only works if you have installed it on your system.
#'
#' Use \code{SetNodeStyle} and \code{SetEdgeStyle} to define the style of your plot. Use \code{plot} to display a
Expand Down Expand Up @@ -60,8 +60,8 @@ plot.Node <- function(x, ..., direction = c("climb", "descend"), pruneFun = NULL
#' \item{\code{tailport}}
#' \item{\code{tooltip}}
#' }
#' A good source to understand the attributes is http://graphviz.org/Documentation.php. Another good source
#' is the DiagrammeR package documentation, or more specifically: http://rich-iannone.github.io/DiagrammeR/docs.html
#' A good source to understand the attributes is https://graphviz.org/Documentation.php. Another good source
#' is the DiagrammeR package documentation, or more specifically: https://rich-iannone.github.io/DiagrammeR/docs.html
#'
#' In addition to the standard GraphViz functionality, the \code{data.tree} plotting infrastructure takes advantage
#' of the fact that data.tree structure are always hierarchic. Thus, style attributes are inherited from parents
Expand All @@ -79,7 +79,7 @@ plot.Node <- function(x, ..., direction = c("climb", "descend"), pruneFun = NULL
#' @param root The root \code{\link{Node}} of the data.tree structure to visualize.
#' @param node The \code{\link{Node}} of the data.tree structure on which you would like to set style attributes.
#' @param ... For the SetStyle methods, this can be any stlyeName / value pair. See
#' http://graphviz.org/Documentation.php for details. For the plot.Node generic method, this is not used.
#' https://graphviz.org/Documentation.php for details. For the plot.Node generic method, this is not used.
#'
#' @inheritParams Prune
#'
Expand Down Expand Up @@ -146,7 +146,7 @@ ToDiagrammeRGraph <- function(root, direction = c("climb", "descend"), pruneFun


myargs <- list()
#see http://stackoverflow.com/questions/19749923/function-factory-in-r
#see https://stackoverflow.com/questions/19749923/function-factory-in-r
for (style in es) {
myargs[[style]] <- GetEdgeStyleFactory(style)
}
Expand Down
19 changes: 2 additions & 17 deletions R/register-s3.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,12 @@
#' Code copied into data.tree from `vctrs` (authors Wickham H, Henry L,
#' Vaughan D; https://github.com/r-lib/vctrs)
#'
#' Generally, the recommend way to register an S3 method is to use the
#' `S3Method()` namespace directive (often generated automatically be the
#' `@export` roxygen2 tag). However, this technique requires that the generic
#' be in an imported package, and sometimes you want to suggest a package,
#' and only provide a method when that package is loaded. `s3_register()`
#' can be called from your package's `.onLoad()` to dynamically register
#' a method only if the generic's package is loaded. (To avoid taking a
#' dependency on vctrs for this one function, please feel free to copy
#' and paste the function source into your own package.)
#'
#' For R 3.5.0 and later, `s3_register()` is also useful when demonstrating
#' For R 3.5.0 and later, `s3_register()` is useful when demonstrating
#' class creation in a vignette, since method lookup no longer always involves
#' the lexical scope. For R 3.6.0 and later, you can achieve a similar effect
#' by using "delayed method registration", i.e. placing the following in your
#' `NAMESPACE` file:
#' by using "delayed method registration".
#'
#' ```
#' if (getRversion() >= "3.6.0") {
#' S3method(package::generic, class)
#' }
#' ```
#'
#' @param generic Name of the generic in the form `pkg::generic`.
#' @param class Name of the class
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CRAN: [![CRAN Version](http://www.r-pkg.org/badges/version/data.tree)](https://cran.r-project.org/package=data.tree/) [![CRAN downloads](http://cranlogs.r-pkg.org/badges/data.tree)](https://cran.r-project.org/package=data.tree/)
CRAN: [![CRAN Version](https://www.r-pkg.org/badges/version/data.tree)](https://cran.r-project.org/package=data.tree/) [![CRAN downloads](https://cranlogs.r-pkg.org/badges/data.tree)](https://cran.r-project.org/package=data.tree/)


<!-- badges: start -->
Expand All @@ -23,8 +23,6 @@ To get started, you might want to read the [introduction vignette](https://CRAN.

The manual is [here](https://CRAN.R-project.org/package=data.tree/data.tree.pdf)

Finally, you'll find more examples and background information on my [blog](http://ipub.com/data-tree).

# NOTE:
The latest from github dev branch may have some breaking changes compared to CRAN. See [NEWS](https://github.com/gluc/data.tree/blob/dev/NEWS) for details.

Expand All @@ -33,7 +31,7 @@ The latest from github dev branch may have some breaking changes compared to CRA

Coding Conventions: Google Style Guide, see https://google.github.io/styleguide/Rguide.xml

Versioning Conventions: SemanticVersioning. See http://semver.org/ for details
Versioning Conventions: SemanticVersioning. See https://semver.org/ for details

Branching Conventions: GitFlow. See https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

Expand Down
63 changes: 0 additions & 63 deletions appveyor.yml

This file was deleted.

8 changes: 4 additions & 4 deletions man/ToDiagrammeRGraph.Rd

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

21 changes: 2 additions & 19 deletions man/s3_register.Rd

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

10 changes: 5 additions & 5 deletions vignettes/applications.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ This example shows you the following:

Thanks a lot for all the helpful comments made by Holger von Jouanne-Diedrich.

Classification trees are very popular these days. If you have never come across them, you might be interested in [classification trees](http://en.wikipedia.org/wiki/Decision_tree_learning). These models let you *classify* observations (e.g. things, outcomes) according to the observations' qualities, called *features*. Essentially, all of these models consist of creating a *tree*, where each *node* acts as a *router*. You insert your mushroom *instance* at the *root* of the tree, and then, depending on the mushroom's *features* (size, points, color, etc.), you follow along a different *path*, until a *leaf* node spits out your mushroom's *class*, i.e. whether it's edible or not.
Classification trees are very popular these days. If you have never come across them, you might be interested in [classification trees](https://en.wikipedia.org/wiki/Decision_tree_learning). These models let you *classify* observations (e.g. things, outcomes) according to the observations' qualities, called *features*. Essentially, all of these models consist of creating a *tree*, where each *node* acts as a *router*. You insert your mushroom *instance* at the *root* of the tree, and then, depending on the mushroom's *features* (size, points, color, etc.), you follow along a different *path*, until a *leaf* node spits out your mushroom's *class*, i.e. whether it's edible or not.

There are two different steps involved in using such a model: *training* (i.e. constructing the tree), and *predicting* (i.e. using the tree to predict whether a given mushroom is poisonous). This example provides code to do both, using one of the very early algorithms to classify data according to discrete features: [ID3](http://en.wikipedia.org/wiki/ID3_algorithm). It lends itself well for this example, but of course today there are much more elaborate and refined algorithms available.
There are two different steps involved in using such a model: *training* (i.e. constructing the tree), and *predicting* (i.e. using the tree to predict whether a given mushroom is poisonous). This example provides code to do both, using one of the very early algorithms to classify data according to discrete features: [ID3](https://en.wikipedia.org/wiki/ID3_algorithm). It lends itself well for this example, but of course today there are much more elaborate and refined algorithms available.

## ID3 Introduction

Expand Down Expand Up @@ -623,8 +623,8 @@ plot(jl)

# Bubble Chart (visualization)

In this example, we will replicate Mike Bostock's bubble example. See here for details: http://bl.ocks.org/mbostock/4063269.
We use Joe Cheng's [bubbles](https://github.com/jcheng5/bubbles) package. All of this is inspired by [Timelyportfolio](https://github.com/timelyportfolio), the king of [htmlwidgets](http://www.htmlwidgets.org).
In this example, we will replicate Mike Bostock's bubble example. See here for details: https://bl.ocks.org/mbostock/4063269.
We use Joe Cheng's [bubbles](https://github.com/jcheng5/bubbles) package. All of this is inspired by [Timelyportfolio](https://github.com/timelyportfolio), the king of [htmlwidgets](https://www.htmlwidgets.org).

You'll learn how to convert a complex JSON into a data.frame, and how to use this to plot hierarchic visualizations.

Expand Down Expand Up @@ -666,7 +666,7 @@ head(flare_df)
```


This does not look spectacular. But take a look at this [stack overflow](http://stackoverflow.com/questions/31339805/converting-json-format-to-csv-to-upload-data-table-in-r-to-produce-d3-bubble-cha) question to see how people struggle to do this type of operation.
This does not look spectacular. But take a look at this [stack overflow](https://stackoverflow.com/questions/31339805/converting-json-format-to-csv-to-upload-data-table-in-r-to-produce-d3-bubble-cha) question to see how people struggle to do this type of operation.

Here, it was particularly simple, because the underlying JSON structure is regular. If it were not (e.g. some nodes contain different attributes than others), the conversion from JSON to data.tree would still work. And then, as a second step, we could modify the data.tree structure before converting it into a data.frame. For example, we could use `Prune` and `Remove` to remove unwanted nodes, use `Set` to remove or add default values, etc.

Expand Down
6 changes: 3 additions & 3 deletions vignettes/data.tree.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ plot(acme)

![acme](assets/acmestyle.png)

For details on the styling attributes, see http://graphviz.org/Documentation.php .
For details on the styling attributes, see https://graphviz.org/Documentation.php .

Note that, by default, most Node style attributes will be inherited. Though, for example, `label` will not be inherited. However, inheritance can be avoided for all style attributes, as for the Accounting node in the following example:

Expand Down Expand Up @@ -651,7 +651,7 @@ There are also conversions to igraph objects, to phylo / ape, to dendrogram, and

# Tree Traversal

Tree traversal is one of the core concepts of trees. See, for example, here: [Tree Traversal on Wikipedia](http://en.wikipedia.org/wiki/Tree_traversal).
Tree traversal is one of the core concepts of trees. See, for example, here: [Tree Traversal on Wikipedia](https://en.wikipedia.org/wiki/Tree_traversal).

## `Get`

Expand Down Expand Up @@ -1041,6 +1041,6 @@ c(user = 0.69, system = 0.00, elapsed = 0.69)

data.tree structures have a relatively large memory footprint. However, for every-day applications using modern computers, this will not normally have an impact on your work **except when saving a `data.tree` structure to disk**.

For an explanation why that is the case, you might want to read this answer on [Stack Overflow](http://stackoverflow.com/questions/13912867/empty-r-environment-becomes-large-file-when-saved).
For an explanation why that is the case, you might want to read this answer on [Stack Overflow](https://stackoverflow.com/questions/13912867/empty-r-environment-becomes-large-file-when-saved).

Depending on your development environment, you might want to turn off the option to save the workspace to .RData on exit.

0 comments on commit fcee911

Please sign in to comment.