0

我正在尝试将优秀的库 Diagrammer 与我自己的信息一起使用。但是由于重音,我无法运行以下代码。有谁知道我怎样才能通过这种类型的词?

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.

我的 sessionInfo 是:

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   
4

1 回答 1

0

根据 Pascal 的建议,我查看了 https://github.com/rich-iannone/DiagrammeR/issues/124并按照 sdc3 的建议,我使用了 é 和 ó 的 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

于 2015-10-07T15:16:25.700 回答