Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
geom_文本,带“%”高达%r_R_Ggplot2_Expression_Plotmath_Geom Text - Fatal编程技术网

geom_文本,带“%”高达%r

geom_文本,带“%”高达%r,r,ggplot2,expression,plotmath,geom-text,R,Ggplot2,Expression,Plotmath,Geom Text,你知道这是为什么吗?理想情况下,向上箭头前面没有文本,空格是可以接受的,但两者都是r ggplot2是1.0.1版 library(ggplot2) ## Use suppressPackageStartupMessages to eliminate package startup messages. df <- data.frame(x=1,y=1,label=".%up% y") ### <-- this works ggplot(df, aes(x,y,label=label

你知道这是为什么吗?理想情况下,向上箭头前面没有文本,空格是可以接受的,但两者都是r

ggplot2
是1.0.1版

library(ggplot2)
## Use suppressPackageStartupMessages to eliminate package startup messages.
df <- data.frame(x=1,y=1,label=".%up% y")  ### <-- this works
ggplot(df, aes(x,y,label=label)) +
       geom_point() + geom_text(hjust=-1,parse=TRUE)
df <- data.frame(x=1,y=1,label=" %up% y")  ### <-- this crashes
ggplot(df, aes(x,y,label=label)) + 
       geom_point() + geom_text(hjust=-1,parse=TRUE)

 *** caught segfault ***
address 0xfffffffffffffff8, cause 'memory not mapped'
...

R> R.version  
               _                           
platform       x86_64-apple-darwin13.4.0   
arch           x86_64                      
os             darwin13.4.0                
system         x86_64, darwin13.4.0        
status                                     
major          3                           
minor          1.3                         
year           2015                        
month          03                          
day            09                          
svn rev        67962                       
language       R                           
version.string R version 3.1.3 (2015-03-09)
nickname       Smooth Sidewalk             
R>
库(ggplot2)
##使用suppressPackageStartupMessages消除包启动消息。
测向测向测向

我得到了
错误::1:2:意外的特殊1:%up%
(r-devel,32位ubuntu 12.04)
我和你的
r.version
完全一样,我得到了@BenBolker得到的东西。您能添加sessionInfo()的输出吗?
?我还得到了R3.1.2、ggplot2 1.0.1、x86_64-apple-darwin10.8.0(64位)的错误(不是SEGFULT)。MacOS版本可能也很重要(我在10.9.5)。@BenBolker-我在10.10.2
(buzz 532)$uname-一个Darwin buzz.local 14.1.0 Darwin内核版本14.1.0:Thu Feb 26:26:47 PST 2015;root:xnu-2782.10.73~1/RELEASE_X86_64 X86_64
(buzz 506) $ r
R> library(ggplot2)
R> df <- data.frame(x=1,y=1,label=".%up% y")  ### <-- this works
R> ggplot(df, aes(x,y,label=label)) + 
+        geom_point() + geom_text(hjust=-1,parse=TRUE)
R> df <- data.frame(x=1,y=1,label=" %up% y")  ### <-- this crashes
R> ggplot(df, aes(x,y,label=label)) + 
+        geom_point() + geom_text(hjust=-1,parse=TRUE)

 *** caught segfault ***
address 0xfffffffffffffff8, cause 'memory not mapped'

Traceback:
 1: .Call("plyr_loop_apply", PACKAGE = "plyr", n, f)
 2: loop_apply(n, do.ply)
 3: llply(.data = pieces, .fun = .fun, ..., .progress = .progress,     .inform = .inform, .parallel = .parallel, .paropts = .paropts)
 4: dlply(layer_data, "PANEL", function(df) {    panel_i <- match(df$PANEL[1], panel$layout$PANEL)    layer$make_grob(df, scales = panel$ranges[[panel_i]], cs = plot$coord)}, .drop = FALSE)
 5: (function (layer, layer_data) {    if (nrow(layer_data) == 0)         return()    dlply(layer_data, "PANEL", function(df) {        panel_i <- match(df$PANEL[1], panel$layout$PANEL)        layer$make_grob(df, scales = panel$ranges[[panel_i]],             cs = plot$coord)    }, .drop = FALSE)})(dots[[1L]][[2L]], dots[[2L]][[2L]])
 6: mapply(FUN = f, ..., SIMPLIFY = FALSE)
 7: Map(build_grob, plot$layer, data)
 8: ggplot_gtable(data)
 9: print.ggplot(list(data = list(x = 1, y = 1, label = 1L), layers = list(    <environment>, <environment>), scales = <S4 object of class "Scales">,     mapping = list(x = x, y = y, label = label), theme = list(),     coordinates = list(limits = list(x = NULL, y = NULL)), facet = list(        shrink = TRUE), plot_env = <environment>, labels = list(        x = "x", y = "y", label = "label")))
10: print(list(data = list(x = 1, y = 1, label = 1L), layers = list(    <environment>, <environment>), scales = <S4 object of class "Scales">,     mapping = list(x = x, y = y, label = label), theme = list(),     coordinates = list(limits = list(x = NULL, y = NULL)), facet = list(        shrink = TRUE), plot_env = <environment>, labels = list(        x = "x", y = "y", label = "label")))

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 2


(buzz 507) $ R
R> library(ggplot2)
R> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.2 (Yosemite)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_1.0.1

loaded via a namespace (and not attached):
 [1] MASS_7.3-40      Rcpp_0.11.5      colorspace_1.2-6 digest_0.6.8     grid_3.1.3       gtable_0.1.2     labeling_0.3    
 [8] munsell_0.4.2    plyr_1.8.1       proto_0.3-10     reshape2_1.4.1   scales_0.2.4     stringr_0.6.2   
R>