R mschart关闭线平滑

R mschart关闭线平滑,r,mschart,officer,R,Mschart,Officer,我正在使用mschart版本0.2.6在R中为powerpoint绘制折线图。默认情况下,我会得到平滑的线条,但我不希望这样。我怎么关掉它 我在github上发现了以下功能请求,但该请求已关闭,我不确定如何解决: 以下是一个工作示例: library(officer) library(mschart) dat<-data.frame(Year=c(rep("2010",3), rep("2011",3), rep("2012"

我正在使用mschart版本0.2.6在R中为powerpoint绘制折线图。默认情况下,我会得到平滑的线条,但我不希望这样。我怎么关掉它

我在github上发现了以下功能请求,但该请求已关闭,我不确定如何解决:

以下是一个工作示例:

library(officer)
library(mschart)

dat<-data.frame(Year=c(rep("2010",3), rep("2011",3), rep("2012",3)),
            Fruit=c(rep(c("Apples","Oranges","Pears"),3)),
            Count = c(332,229,168,
                      223,189,225,
                      321,378,261), stringsAsFactors=F)

line_chart <- ms_linechart(data = dat, x = "Year",y = "Count", group="Fruit")

doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(x = doc, value = c("Fruit"),
             location = ph_location_type(type = "title") )
doc <- ph_with(doc, line_chart, location = ph_location_type(type="body"))
fileout <- "./Test.pptx" 
print(doc, target = fileout)
图书馆(官员)
图书馆(mschart)
dat将
ms\u linechart
对象导入(或包装)到
chart\u data\u smooth()函数中,并将
值设置为0

library(officer)
library(mschart)
library(tidyverse)

line_chart <- ms_linechart(data = dat, x = "Year",y = "Count", group="Fruit") %>% 
              chart_data_smooth(values = 0) # Here is the code that sets lines to straight.

doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(x = doc, value = c("Fruit"),
               location = ph_location_type(type = "title") )
doc <- ph_with(doc, line_chart, location = ph_location_type(type="body"))
fileout <- "./Test2.pptx" 
print(doc, target = fileout)
图书馆(官员)
图书馆(mschart)
图书馆(tidyverse)
折线图%
图表_数据_平滑(值=0)#以下是将直线设置为直线的代码。
医生