ggplot printing all text as [special characters] rectangles?

I'm not sure what is causing this to happen - I'm guessing it's some sort of encoding issue. All text from ggplot is printed as special characters (?).

x <- data.frame(
  stringsAsFactors = FALSE,
           Individual = c("GW14","GW14","GW14",
                          "GW17","GW17","GW17","GW17","GW17","GW18","GW18",
                          "GW18","GW18","GW18","GW18_2","GW18_2","GW18_2",
                          "GW18_2","GW18_2","GW19","GW19","GW19","GW19",
                          "GW19","GW19","GW20","GW20","GW20","GW20",
                          "GW20_31","GW20_31","GW20_31","GW20_31","GW20_34",
                          "GW20_34","GW20_34","GW20_34","GW22","GW22","GW22",
                          "GW22","GW22","GW22T","GW22T","GW22T","GW22T",
                          "GW25","GW25","GW25","GW25","GW25"),
                 Area = c("motor","somatosensory",
                          "V1","motor","parietal","PFC","somatosensory",
                          "V1","motor","parietal","PFC","temporal","V1",
                          "motor","parietal","somatosensory","temporal","V1",
                          "motor","parietal","PFC","somatosensory","temporal",
                          "V1","motor","PFC","somatosensory","V1",
                          "parietal","PFC","temporal","V1","motor","parietal",
                          "PFC","V1","motor","parietal","PFC","somatosensory",
                          "V1","motor","parietal","PFC","somatosensory",
                          "motor","parietal","PFC","somatosensory","temporal"),
                    n = c(530L,5329L,1913L,1210L,
                          11L,935L,155L,1125L,13312L,2206L,11863L,2358L,
                          9533L,8476L,12826L,6033L,13817L,7467L,7013L,
                          5824L,7017L,4402L,6812L,5599L,3256L,3851L,4439L,
                          8216L,2844L,6371L,4658L,3598L,24L,8174L,7192L,
                          6327L,3169L,1975L,5377L,4152L,1931L,2418L,
                          2415L,32L,2946L,1923L,22743L,20608L,5956L,1033L)
   )

> ggplot(x) + geom_point(aes(x = Area, y = Individual, size = n))

Warning message:
In readChar(file, size, TRUE) : truncating string with embedded nuls

enter image description here

> sessionInfo

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux

Matrix products: default
BLAS:   /usr/lib/libblas.so.3.9.0
LAPACK: /usr/lib/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] forcats_0.5.0   stringr_1.4.0   purrr_0.3.4     readr_1.3.1     tidyr_1.1.0     tibble_3.0.1    ggplot2_3.3.2   tidyverse_1.3.0
[9] dplyr_1.0.0    

loaded via a namespace (and not attached):
  [1] nlme_3.1-148       fs_1.4.1           reactable_0.2.0    lubridate_1.7.8    RcppAnnoy_0.0.16   RColorBrewer_1.1-2 httr_1.4.1        
  [8] sctransform_0.2.1  tools_4.0.2        backports_1.1.8    R6_2.4.1           irlba_2.3.3        KernSmooth_2.23-17 uwot_0.1.8        
 [15] DBI_1.1.0          lazyeval_0.2.2     colorspace_1.4-1   withr_2.2.0        tidyselect_1.1.0   gridExtra_2.3      compiler_4.0.2    
 [22] rvest_0.3.5        cli_2.0.2          xml2_1.3.2         plotly_4.9.2.1     labeling_0.3       Seurat_3.1.5.9009  scales_1.1.1      
 [29] lmtest_0.9-37      ggridges_0.5.2     pbapply_1.4-2      rappdirs_0.3.1     digest_0.6.25      rmarkdown_2.1      base64enc_0.1-3   
 [36] pkgconfig_2.0.3    htmltools_0.5.0    dbplyr_1.4.4       readxl_1.3.1       htmlwidgets_1.5.1  rlang_0.4.6        rstudioapi_0.11   
 [43] farver_2.0.3       generics_0.0.2     zoo_1.8-8          jsonlite_1.7.0     ica_1.0-2          magrittr_1.5       patchwork_1.0.1   
 [50] Matrix_1.2-18      Rcpp_1.0.4.6       munsell_0.5.0      fansi_0.4.1        ape_5.4            reticulate_1.16    lifecycle_0.2.0   
 [57] stringi_1.4.6      MASS_7.3-51.6      Rtsne_0.15         plyr_1.8.6         grid_4.0.2         blob_1.2.1         parallel_4.0.2    
 [64] listenv_0.8.0      ggrepel_0.8.2      crayon_1.3.4       lattice_0.20-41    haven_2.3.1        cowplot_1.0.0      splines_4.0.2     
 [71] hms_0.5.3          knitr_1.28         pillar_1.4.4       igraph_1.2.5       future.apply_1.6.0 reshape2_1.4.4     codetools_0.2-16  
 [78] leiden_0.3.3       reprex_0.3.0       glue_1.4.1         packrat_0.5.0      evaluate_0.14      modelr_0.1.8       data.table_1.12.8 
 [85] png_0.1-7          vctrs_0.3.1        cellranger_1.1.0   gtable_0.3.0       RANN_2.6.1         future_1.17.0      assertthat_0.2.1  
 [92] xfun_0.14          rsvd_1.0.3         broom_0.5.6        rsconnect_0.8.16   survival_3.1-12    viridisLite_0.3.0  cluster_2.1.0     
 [99] globals_0.12.5     fitdistrplus_1.1-1 ellipsis_0.3.1     ROCR_1.0-11       

Cross-posted here:
https://stackoverflow.com/questions/62841339/ggplot-printing-all-text-as-special-characters-rectangles

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.