2015-10-06 66 views
0

我想用我自己的信息使用优秀的库Diagrammer。但由于重音符号,我无法运行下面的代码。有人知道我怎么能通过这种类型的话?在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. 

我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 
+0

什么错误你好吗?它适用于我(R 3.2.2,OS X 10.11)。 – MrFlick

+0

我在问题中包含错误和sessionInfo。谢谢 – cesc13

+0

可能相关:https://github.com/rich-iannone/DiagrammeR/issues/124 – 2015-10-07 02:49:10

回答

0

继我回顾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