Closed toorukt closed 2 years ago
I installed VS Code on an Ubuntu server and couldn't reproduce your error. The chart from your example showed up fine using R 4.2.1:
You could try explicitly telling {ggpattern}
your graphic device's R 4.1 graphic feature support since your weird bug happens when it tries to detect it:
options(ggpattern_use_R4.1_features = FALSE) # unsure of graphics device support
options(ggpattern_use_R4.1_features = TRUE) # sure that device supports them
The traceback indicates you had a SegFault when grDevices::dev.capabilities()
was called. What happens when you just call that in VS Code?
grDevices::dev.capabilities()
Thanks for the prompt reply! That's wired. I check it using another ubuntu VPS and my friend's M2 MacBook Air, it crashed again.
for the grDevices::dev.capabilities()
code,
if I ran it by a normal user, error happened again (see the screenshot)
However, if I ran it by root user, it seems fine by showing the following Info:
grDevices::dev.capabilities()
$semiTransparency
[1] TRUE
$transparentBackground
[1] "semi"
$rasterImage
[1] "yes"
$capture
[1] FALSE
$locator
[1] FALSE
$events
character(0)
$patterns
[1] "LinearGradient" "RadialGradient" "TilingPattern"
$clippingPaths
[1] TRUE
$masks
[1] "alpha" "luminance"
$compositing
[1] "multiply" "screen" "overlay" "darken" "lighten"
[6] "color.dodge" "color.burn" "hard.light" "soft.light" "difference"
[11] "exclusion"
$transformations
[1] TRUE
$paths
[1] TRUE
I'm not familiar with code and technical stuff so I am wondering what the problem is.🤣
Weird, on my Ubuntu machine I ran VS Code as a normal user and it worked fine...
sudo dpgk -i
and then within VS Code installed some of the R plugins when prompted to...sudo R
with install.packages()
This seems to be either a bug in base R and/or a faulty R installation so I am closing this issue. Not our fault that grDevices::dev.capabilities()
is segfaulting. Other websites may be better suited for figuring out why that core R function is segfaulting.
As I suggested before you may be able to sidestep this by manually setting options(ggpattern_use_R4.1_features)
...
Bug description
I was trying to fill in a bar plot with patterns and then found this amazing package. However, it seems not working with VS Code, by showing up a "Segmentation fault" which I have no idea what it is. I've attached a screenshot to display the problem.
BTW, I ran same codes under R studio and it did work, so I suspect there might be some conflicts with httpgd (the package VS Code used to display plot) or something else. Also, the problem has been reproduced under Macs and ubuntu VPS (connected through SSH by VS Code).
Minimal, reproducible example
Session info