Skip to content

Commit

Permalink
mark functions ph_with_chart and ph_with_chart_at as defunct.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Apr 5, 2021
1 parent a9108fe commit cf61eef
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 62 deletions.
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Package: mschart
Type: Package
Title: Chart Generation for 'Microsoft Word' and 'Microsoft PowerPoint' Documents
Version: 0.2.6.002
Version: 0.2.6.003
Authors@R: c(
person("David", "Gohel", role = c("aut", "cre"), email = "[email protected]"),
person("David", "Gohel", role = c("aut", "cre"),
email = "[email protected]"),
person(given = "ArData", role = "cph"),
person("YouGov", role = "fnd"),
person("David", "Camposeco", role = "ctb", email = "[email protected]", comment = "chart_data_smooth function")
person("David", "Camposeco", role = "ctb",
email = "[email protected]",
comment = "chart_data_smooth function")
)
Description: Create native charts for 'Microsoft PowerPoint' and 'Microsoft Word' documents.
These can then be edited and annotated. Functions are provided to let users create charts, modify
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ importFrom(officer,add_slide)
importFrom(officer,body_add_xml)
importFrom(officer,fp_border)
importFrom(officer,fp_text)
importFrom(officer,ph_location)
importFrom(officer,ph_location_fullsize)
importFrom(officer,ph_location_type)
importFrom(officer,ph_with)
importFrom(officer,read_pptx)
importFrom(officer,styles_info)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* fix issue with labels that contains `<>&`.

## Changes

* mark functions `ph_with_chart` and `ph_with_chart_at` as defunct.

# mschart 0.2.5

Expand Down
19 changes: 19 additions & 0 deletions R/defunct.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' @name mschart-defunct
#' @title Defunct Functions in Package mschart
NULL

#' @export
#' @rdname mschart-defunct
#' @details `ph_with_chart()` is replaced by `ph_with.ms_chart`.
#' @param ... unused arguments
ph_with_chart <- function(...) {
.Defunct("ph_with.ms_chart")
}

#' @export
#' @rdname mschart-defunct
#' @details `ph_with_chart_at()` is replaced by `ph_with.ms_chart`.
ph_with_chart_at <- function(...) {
.Defunct("ph_with.ms_chart")
}

27 changes: 0 additions & 27 deletions R/ph_with_chart.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,6 @@ pml_chart <- function(x, value, id_x, id_y){
graphic_frame
}

#' @export
#' @title add chart into a PowerPoint slide
#' @description add a chart as a new shape in the current slide.
#' These functions are deprecated, function \code{\link{ph_with.ms_chart}} should
#' be used instead.
#' @param x an rpptx object
#' @param chart \code{ms_chart} object
#' @param type placeholder type
#' @param index placeholder index (integer). This is to be used when a placeholder type
#' is not unique in the current slide, e.g. two placeholders with type 'body'.
#' @importFrom officer ph_location_type
ph_with_chart <- function( x, chart, type = "body", index = 1 ){
.Deprecated("ph_with")
ph_with(x, chart, location = ph_location_type(type = type, id = index))
}

#' @export
#' @param left,top location of chart on the slide
#' @param height,width Height and width in inches.
#' @rdname ph_with_chart
#' @importFrom officer ph_location
ph_with_chart_at <- function( x, chart, left, top, width, height ){
.Deprecated("ph_with")
ph_with(x, chart, location = ph_location(left = left, top = top, width = width, height = height))

}

#' @importFrom stats setNames
#' @importFrom writexl write_xlsx
#' @importFrom xml2 read_xml xml_find_first xml_replace as_xml_document xml_add_child write_xml
Expand Down
23 changes: 23 additions & 0 deletions man/mschart-defunct.Rd

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

30 changes: 0 additions & 30 deletions man/ph_with_chart.Rd

This file was deleted.

0 comments on commit cf61eef

Please sign in to comment.