在DiagrammeR中使用重音(utf8)



我正试图使用优秀的图书馆图表与我自己的信息。但由于重音,我无法运行以下代码。有人知道我怎么传递这类单词吗?

library(DiagrammeR)
DiagrammeR("
  graph BT;
           A(Entorno familiar)-->B(Desinterés)
           B-->C(Deserción);
           style A fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
           style B fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
           style C fill:#ffffff, stroke:#FF5E5E, stroke-width:1.5px;
           ")

得到的错误是:

parse error with 
       graph BT;
       A(Entorno familiar)-->B(Desinter�s)
       B-->C(Deserci�n);
       style A fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
       style B fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
       style C fill:#ffffff, stroke:#FF5E5E, stroke-width:1.5px;
Maximum call stack size exceeded.

My sessionInfo is:

R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252   
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                  
[5] LC_TIME=Spanish_Spain.1252    
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] DiagrammeR_0.7
loaded via a namespace (and not attached):
 [1] htmlwidgets_0.5  magrittr_1.5     htmltools_0.2.6  tools_3.2.2     
 [5] rstudioapi_0.3.1 yaml_2.1.13      stringi_0.5-5    jsonlite_0.9.17 
 [9] stringr_1.0.0    digest_0.6.8   

根据Pascal的建议,我审查了https://github.com/rich-iannone/DiagrammeR/issues/124,并按照ssd3的建议使用了和ó的html代码。代码运行良好。

DiagrammeR("
           graph BT;
           A(Entorno familiar)-->B(Desinterés)
           B-->C(Deserción);
           style A fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
           style B fill:#ffffff, stroke:#04C4AB, stroke-width:1.5px;
           style C fill:#ffffff, stroke:#FF5E5E, stroke-width:1.5px;
           ")
https://drive.google.com/file/d/0B93USEgDQ_ylV29jN28xckd5cVE/view?usp=sharing

相关内容

  • 没有找到相关文章

最新更新