小编mtr*_*reg的帖子

如何为绘图森伯斯特图格式化数据

我正在尝试通过 R 使用 Plotly 制作森伯斯特图。我正在努力处理层次结构所需的数据模型,无论是在概念化它是如何工作的方面,还是看看是否有任何简单的方法来转换常规数据框,用代表不同层次级别的列,转换为所需的格式。

我已经查看了 R 中绘图森伯斯特图表的示例,例如,here,并查看了参考页面,但没有完全获得数据格式的模型。

# Create some fake data - say ownership and land use data with acreage
df <- data.frame(ownership=c(rep("private", 3), rep("public",3),rep("mixed", 3)), 
                 landuse=c(rep(c("residential", "recreation", "commercial"),3)),
                 acres=c(108,143,102, 300,320,500, 37,58,90))

# Just try some quick pie charts of acreage by landuse and ownership
plot_ly(data=df, labels= ~landuse, values= ~acres, type='pie')
plot_ly(data=df, labels= ~ownership, values= ~acres, type='pie')

# This doesn't render anything... not that I'd expect it to given the data format doesn't seem …
Run Code Online (Sandbox Code Playgroud)

r plotly sunburst-diagram r-plotly

7
推荐指数
1
解决办法
3204
查看次数

Markdown中的特殊字符 - Pandoc和Github调味

我正在尝试在我在Markdown中生成的文档中使用"大于或等于"和"小于或等于"符号.我正在努力通过Pandoc和GitHub将这个文档正确呈现为PDF,通过Github风格的Markdown.但是,我找不到解决方案来生成这些符号,这些符号在Markdown的两种解释中都有效

常规符号(≥和≤)在Git Flavored Markdown中显示正常,HTML样式的特殊字符也是如此.但是,当我尝试运行它以通过Pandoc获取PDF时,我收到此错误:

pandoc test.md -o test.pdf
pandoc.exe: Error producing PDF from TeX source.
! Package inputenc Error: Unicode char \u8:? not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.120 ?

Try running pandoc with --latex-engine=xelatex.
Run Code Online (Sandbox Code Playgroud)

我使用了xelatex引擎,它根本不会在那个地方产生一个角色.

乳胶风格的特殊字符(例如,$\geq $)通过Pandoc对PDF进行精细渲染,但不会被Git Flavored Markdown解释.

有没有关于使用与Github风味Markdown和Pandoc/Latex一起使用的特殊字符的建议?或者有没有办法向Pandoc/LaTeX表明它需要解释HTML格式的特殊字符或什么?

pdf markdown latex special-characters pandoc

4
推荐指数
1
解决办法
4763
查看次数