Skip to content

Commit 62372a6

Browse files
committed
Fixes for R CMD check
1 parent df79d99 commit 62372a6

10 files changed

Lines changed: 47 additions & 29 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Imports:
3232
digest,
3333
viridis,
3434
base64enc,
35-
htmlwidgets
35+
htmlwidgets,
36+
plyr
3637
Suggests:
3738
dplyr,
3839
maps,

NAMESPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@ import(httr)
3030
import(jsonlite)
3131
importFrom(base64enc,base64encode)
3232
importFrom(htmlwidgets,createWidget)
33+
importFrom(htmlwidgets,shinyRenderWidget)
34+
importFrom(htmlwidgets,shinyWidgetOutput)
35+
importFrom(htmlwidgets,sizingPolicy)
3336
importFrom(magrittr,"%>%")
37+
importFrom(plyr,ddply)
38+
importFrom(plyr,join)
39+
importFrom(plyr,summarise)
3440
importFrom(viridis,viridis)

R/plotly_IMAGE.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
#' @param out_file A filename for writing the image to a file.
1212
#' @param ... arguments passed onto \code{httr::POST}
1313
#' @export
14-
#' @examples
14+
#' @examples \dontrun{
1515
#'
1616
#' p <- plot_ly(x = 1:10)
1717
#'
1818
#' Png <- plotly_IMAGE(p, out_file = "plotly-test-image.png")
1919
#' Jpeg <- plotly_IMAGE(p, format = "jpeg", out_file = "plotly-test-image.jpeg")
2020
#' Svg <- plotly_IMAGE(p, format = "svg", out_file = "plotly-test-image.svg")
2121
#' Pdf <- plotly_IMAGE(p, format = "pdf", out_file = "plotly-test-image.pdf")
22+
#' }
2223
#'
2324

2425
plotly_IMAGE <- function(x, width = 1000, height = 500, format = "png",

R/print.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#' Print a plotly object
22
#'
3-
#' @param p a plotly object
3+
#' @param x a plotly object
44
#' @param ... additional arguments (currently ignored)
55
#' @export
66
#' @importFrom htmlwidgets createWidget
7+
#' @importFrom htmlwidgets sizingPolicy
78

8-
print.plotly <- function(p, ...) {
9+
print.plotly <- function(x, ...) {
910
w <- htmlwidgets::createWidget(
1011
name = "plotly",
11-
x = plotly_build(p),
12-
width = p$width,
13-
height = p$height,
12+
x = plotly_build(x),
13+
width = x$width,
14+
height = x$height,
1415
htmlwidgets::sizingPolicy(viewer.padding = 10, browser.fill = TRUE)
1516
)
1617
get("print.htmlwidget", envir = asNamespace("htmlwidgets"))(w)
@@ -30,7 +31,7 @@ embed_notebook <- function(x, width = "100%", height = "525") {
3031
}
3132
resp <- plotly_POST(x)
3233
iframe <- plotly_iframe(attr(resp, "url"), width, height)
33-
IRdisplay::display_html(iframe)
34+
get("display_html", envir = asNamespace("IRdisplay"))(iframe)
3435
}
3536

3637
plotly_iframe <- function(url, width, height) {

R/shiny.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
1313
#' is useful if you want to save an expression in a variable.
1414
#'
15+
#' @importFrom htmlwidgets shinyWidgetOutput
16+
#' @importFrom htmlwidgets shinyRenderWidget
1517
#' @name plotly-shiny
1618
#'
1719
#' @export
1820
plotlyOutput <- function(outputId, width = "100%", height = "400px") {
19-
shinyWidgetOutput(outputId, "plotly", width, height, package = "plotly")
21+
htmlwidgets::shinyWidgetOutput(outputId, "plotly", width, height, package = "plotly")
2022
}
2123

2224
#' @rdname plotly-shiny
2325
#' @export
2426
renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) {
2527
if (!quoted) { expr <- substitute(expr) } # force quoted
26-
shinyRenderWidget(expr, plotlyOutput, env, quoted = TRUE)
28+
htmlwidgets::shinyRenderWidget(expr, plotlyOutput, env, quoted = TRUE)
2729
}

R/subplots.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#' If a single value is provided, it will be used as all four margins.
1414
#' @return A plotly object
1515
#' @export
16+
#' @importFrom plyr join
1617
#' @author Carson Sievert
1718
#' @examples \dontrun{
1819
#' p1 <- plot_ly(economics, x = date, y = uempmed, showlegend = F)

R/trace_generation.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#' @param d one layer of calculated data from ggplot2::ggplot_build(p)
44
#' @param misc named list of plot info, independent of layer.
55
#' @return list representing a layer, with corresponding aesthetics, ranges, and groups.
6+
#' @importFrom plyr ddply
7+
#' @importFrom plyr summarise
68
#' @export
79
layer2traces <- function(l, d, misc) {
810
not.na <- function(df){

inst/htmlwidgets/lib/LICENSE

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
Copyright (c) 2015, Plotly, Inc.
1+
The MIT License (MIT)
22

3-
Permission is hereby granted, free of charge, to any person obtaining
4-
a copy of this software and associated documentation files (the
5-
"Software"), to deal in the Software without restriction, including
6-
without limitation the rights to use, copy, modify, merge, publish,
7-
distribute, sublicense, and/or sell copies of the Software, and to
8-
permit persons to whom the Software is furnished to do so, subject to
9-
the following conditions:
3+
Copyright (c) 2015 Plotly
104

11-
The above copyright notice and this permission notice shall be
12-
included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1311

14-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

man/plotly_IMAGE.Rd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ The images endpoint turn a plot (which may be given in multiple forms)
2727
into an image of the desired format.
2828
}
2929
\examples{
30+
\dontrun{
31+
3032
p <- plot_ly(x = 1:10)
3133

3234
Png <- plotly_IMAGE(p, out_file = "plotly-test-image.png")
3335
Jpeg <- plotly_IMAGE(p, format = "jpeg", out_file = "plotly-test-image.jpeg")
3436
Svg <- plotly_IMAGE(p, format = "svg", out_file = "plotly-test-image.svg")
3537
Pdf <- plotly_IMAGE(p, format = "pdf", out_file = "plotly-test-image.pdf")
3638
}
39+
}
3740

man/print.plotly.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
\alias{print.plotly}
55
\title{Print a plotly object}
66
\usage{
7-
\method{print}{plotly}(p, ...)
7+
\method{print}{plotly}(x, ...)
88
}
99
\arguments{
10-
\item{p}{a plotly object}
10+
\item{x}{a plotly object}
1111

1212
\item{...}{additional arguments (currently ignored)}
1313
}

0 commit comments

Comments
 (0)