Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VI() function does not extract correct graphic title #24

Closed
jooyoungseo opened this issue Aug 28, 2020 · 3 comments · Fixed by #58
Closed

VI() function does not extract correct graphic title #24

jooyoungseo opened this issue Aug 28, 2020 · 3 comments · Fixed by #58

Comments

@jooyoungseo
Copy link

When generating text description for R graphics via BrailleR::VI() function, user-defined title is not extracted. It would be better for us to fix this.

Reproducible Example

# Loading package:
library(BrailleR)
#> The BrailleR.View,  option is set to FALSE.
#> 
#> Attaching package: 'BrailleR'
#> The following objects are masked from 'package:graphics':
#> 
#>     boxplot, hist
#> The following object is masked from 'package:utils':
#> 
#>     history
#> The following objects are masked from 'package:base':
#> 
#>     grep, gsub

# Making histogram object with customized title:
x <- hist(airquality$Ozone, main = "test")

# Generating text description:
VI(x)
#> This is a histogram, with the title: Histogram of airquality$Ozone
#> "airquality$Ozone" is marked on the x-axis.
#> Tick marks for the x-axis are at: 0, 50, 100, and 150 
#> There are a total of 116 elements for this variable.
#> Tick marks for the y-axis are at: 0, 10, 20, and 30 
#> It has 9 bins with equal widths, starting at 0 and ending at 180 .
#> The mids and counts for the bins are:
#> mid = 10  count = 37 
#> mid = 30  count = 34 
#> mid = 50  count = 14 
#> mid = 70  count = 15 
#> mid = 90  count = 9 
#> mid = 110  count = 4 
#> mid = 130  count = 2 
#> mid = 150  count = 0 
#> mid = 170  count = 1

Created on 2020-08-28 by the reprex package (v0.3.0.9001)

Session info
sessioninfo::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 4.0.2 (2020-06-22)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       America/New_York            
#>  date     2020-08-28                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package      * version    date       lib source                              
#>  assertthat     0.2.1      2019-03-21 [1] CRAN (R 4.0.2)                      
#>  backports      1.1.7      2020-05-13 [1] CRAN (R 4.0.0)                      
#>  BrailleR     * 0.31.0     2020-06-26 [1] Github (ajrgodfrey/BrailleR@59d0949)
#>  callr          3.4.3      2020-03-28 [1] CRAN (R 4.0.2)                      
#>  cli            2.0.2      2020-02-28 [1] CRAN (R 4.0.2)                      
#>  colorspace     1.4-1      2019-03-18 [1] CRAN (R 4.0.2)                      
#>  crayon         1.3.4      2017-09-16 [1] CRAN (R 4.0.2)                      
#>  curl           4.3        2019-12-02 [1] CRAN (R 4.0.2)                      
#>  desc           1.2.0      2018-05-01 [1] CRAN (R 4.0.2)                      
#>  devtools       2.3.1      2020-07-21 [1] CRAN (R 4.0.2)                      
#>  digest         0.6.25     2020-02-23 [1] CRAN (R 4.0.2)                      
#>  dplyr          1.0.2      2020-08-18 [1] CRAN (R 4.0.2)                      
#>  ellipsis       0.3.1      2020-05-15 [1] CRAN (R 4.0.2)                      
#>  evaluate       0.14       2019-05-28 [1] CRAN (R 4.0.2)                      
#>  extrafont      0.17       2014-12-08 [1] CRAN (R 4.0.0)                      
#>  extrafontdb    1.0        2012-06-11 [1] CRAN (R 4.0.0)                      
#>  fansi          0.4.1      2020-01-08 [1] CRAN (R 4.0.2)                      
#>  fs             1.5.0      2020-07-31 [1] CRAN (R 4.0.2)                      
#>  generics       0.0.2      2018-11-29 [1] CRAN (R 4.0.2)                      
#>  ggplot2        3.3.2      2020-06-19 [1] CRAN (R 4.0.2)                      
#>  glue           1.4.1      2020-05-13 [1] CRAN (R 4.0.2)                      
#>  gridGraphics   0.5-0      2020-02-25 [1] CRAN (R 4.0.2)                      
#>  gridSVG        1.7-2      2020-04-28 [1] CRAN (R 4.0.2)                      
#>  gtable         0.3.0      2019-03-25 [1] CRAN (R 4.0.2)                      
#>  highr          0.8        2019-03-20 [1] CRAN (R 4.0.2)                      
#>  htmltools      0.5.0.9000 2020-08-21 [1] Github (rstudio/htmltools@e35c3fa)  
#>  httr           1.4.2      2020-07-20 [1] CRAN (R 4.0.2)                      
#>  hunspell       3.0        2018-12-15 [1] CRAN (R 4.0.2)                      
#>  jsonlite       1.7.0      2020-06-25 [1] CRAN (R 4.0.2)                      
#>  knitr          1.29.4     2020-08-27 [1] Github (yihui/knitr@1465255)        
#>  lattice        0.20-41    2020-04-02 [1] CRAN (R 4.0.2)                      
#>  lifecycle      0.2.0      2020-03-06 [1] CRAN (R 4.0.2)                      
#>  magrittr       1.5        2014-11-22 [1] CRAN (R 4.0.2)                      
#>  Matrix         1.2-18     2019-11-27 [1] CRAN (R 4.0.2)                      
#>  memoise        1.1.0      2017-04-21 [1] CRAN (R 4.0.2)                      
#>  mime           0.9        2020-02-04 [1] CRAN (R 4.0.0)                      
#>  moments        0.14       2015-01-05 [1] CRAN (R 4.0.0)                      
#>  munsell        0.5.0      2018-06-12 [1] CRAN (R 4.0.2)                      
#>  nortest        1.0-4      2015-07-30 [1] CRAN (R 4.0.0)                      
#>  pillar         1.4.6      2020-07-10 [1] CRAN (R 4.0.2)                      
#>  pkgbuild       1.1.0      2020-07-13 [1] CRAN (R 4.0.2)                      
#>  pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.0.2)                      
#>  pkgload        1.1.0      2020-05-29 [1] CRAN (R 4.0.2)                      
#>  prettyunits    1.1.1      2020-01-24 [1] CRAN (R 4.0.2)                      
#>  processx       3.4.3      2020-07-05 [1] CRAN (R 4.0.2)                      
#>  ps             1.3.4      2020-08-11 [1] CRAN (R 4.0.2)                      
#>  purrr          0.3.4      2020-04-17 [1] CRAN (R 4.0.2)                      
#>  R6             2.4.1      2019-11-12 [1] CRAN (R 4.0.2)                      
#>  Rcpp           1.0.5      2020-07-06 [1] CRAN (R 4.0.2)                      
#>  remotes        2.2.0      2020-07-21 [1] CRAN (R 4.0.2)                      
#>  reprex         0.3.0.9001 2020-08-22 [1] Github (tidyverse/reprex@d3fc4b8)   
#>  reticulate     1.16-9000  2020-07-31 [1] Github (rstudio/reticulate@e811aec) 
#>  rlang          0.4.7      2020-07-09 [1] CRAN (R 4.0.2)                      
#>  rmarkdown      2.3.3      2020-07-28 [1] Github (rstudio/rmarkdown@204aa41)  
#>  roloc          0.1-1      2018-07-30 [1] CRAN (R 4.0.2)                      
#>  rolocISCCNBS   0.1        2018-08-02 [1] CRAN (R 4.0.2)                      
#>  rprojroot      1.3-2      2018-01-03 [1] CRAN (R 4.0.2)                      
#>  Rttf2pt1       1.3.8      2020-01-10 [1] CRAN (R 4.0.0)                      
#>  scales         1.1.1      2020-05-11 [1] CRAN (R 4.0.2)                      
#>  sessioninfo    1.1.1      2018-11-05 [1] CRAN (R 4.0.2)                      
#>  stringi        1.4.6      2020-02-17 [1] CRAN (R 4.0.0)                      
#>  stringr        1.4.0      2019-02-10 [1] CRAN (R 4.0.2)                      
#>  styler         1.3.2      2020-02-23 [1] CRAN (R 4.0.2)                      
#>  testthat       2.3.2      2020-03-02 [1] CRAN (R 4.0.2)                      
#>  tibble         3.0.3      2020-07-10 [1] CRAN (R 4.0.2)                      
#>  tidyselect     1.1.0      2020-05-11 [1] CRAN (R 4.0.2)                      
#>  usethis        1.6.1.9001 2020-08-03 [1] Github (r-lib/usethis@00e0600)      
#>  vctrs          0.3.2      2020-07-15 [1] CRAN (R 4.0.2)                      
#>  whisker        0.4        2019-08-28 [1] CRAN (R 4.0.2)                      
#>  withr          2.2.0      2020-04-20 [1] CRAN (R 4.0.2)                      
#>  xfun           0.16.1     2020-07-28 [1] Github (yihui/xfun@0f9e1ae)         
#>  XML            3.99-0.5   2020-07-23 [1] CRAN (R 4.0.2)                      
#>  xml2           1.3.2      2020-04-23 [1] CRAN (R 4.0.2)                      
#>  xtable         1.8-4      2019-04-21 [1] CRAN (R 4.0.2)                      
#>  yaml           2.2.1      2020-02-01 [1] CRAN (R 4.0.0)                      
#> 
#> [1] C:/Program Files/R/R-4.0.2/library
@boringNectarine0
Copy link
Contributor

Looks like the "main" (title) is being extracted from "x[extraArgs[main]]" rather than x[main]. A change in this should solve the issue.

@ajrgodfrey
Copy link
Owner

ajrgodfrey commented Feb 17, 2021 via email

@boringNectarine0
Copy link
Contributor

boringNectarine0 commented Feb 17, 2021 via email

1jamesthompson1 added a commit to 1jamesthompson1/BrailleR that referenced this issue Nov 28, 2022
Fixing issues with base r plots with VI not picking up on the correct title.
1jamesthompson1 added a commit to 1jamesthompson1/BrailleR that referenced this issue Nov 28, 2022
Fixing base r plot titles so that they reflect correctly what is seen.
ajrgodfrey added a commit that referenced this issue Dec 6, 2022
…r-plot-titles

resolves #24 fix base r plot titles in VI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants