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

Error in *tmp*[[1]] : subscript out of bounds #604

Open
fowlerjk opened this issue May 21, 2024 · 0 comments
Open

Error in *tmp*[[1]] : subscript out of bounds #604

fowlerjk opened this issue May 21, 2024 · 0 comments

Comments

@fowlerjk
Copy link

fowlerjk commented May 21, 2024

I am looping through a table of color and fill instructions for a ggtexttable. It works up until I get to row 6. The printing that's expected output shows me that it's actually going through the table and assigning colors. This has worked in iterations past, but something has changed. My code has not.


Expected behavior

[1] "row is 2"
[1] "col is 3"
[1] "row is 3"
[1] "col is 3"
[1] "row is 4"
[1] "col is 3"
[1] "row is 5"
[1] "col is 3"
[1] "row is 6"
[1] "col is 1"
[1] "row is 7"
[1] "col is 1"
[1] "row is 8"
[1] "col is 3"
[1] "row is 9"
[1] "col is 4"
[1] "row is 10"
[1] "col is 3"
[1] "row is 11"
[1] "col is 3"

Actual behavior

[1] "row is 2"
[1] "col is 3"
[1] "2,3"
[1] "row is 3"
[1] "col is 3"
[1] "3,3"
[1] "row is 4"
[1] "col is 3"
[1] "4,3"
[1] "row is 5"
[1] "col is 3"
[1] "5,3"
[1] "row is 6"
[1] "col is 1"
Error in `*tmp*`[[1]] : subscript out of bounds

Steps to reproduce the problem

for(i in 1:nrow(maturity.table)){
  #print(paste("i is",i,sep=" "))
  row = i + 1
  print(paste("row is",row,sep=" "))
  column = maturity.table2$score[i]
  print(paste("col is",column,sep=" "))
  #mat <- cbind(seq_len(nrow(maturity.table)), maturity.table$score)
  ggtab <- table_cell_bg(
    ggtab, row = row, column = column,
    fill = maturity.table2$fill[i], color = maturity.table2$text[i]
  )
  print(paste(row,column, sep=","))
}

session_info()

Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16)
 os       macOS Monterey 12.6.8
 system   x86_64, darwin20
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2024-05-21
 rstudio  2023.06.2+561 Mountain Hydrangea (desktop)
 pandoc   NAPackages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package      * version date (UTC) lib source
 abind          1.4-5   2016-07-21 [1] CRAN (R 4.3.0)
 backports      1.4.1   2021-12-13 [1] CRAN (R 4.3.0)
 broom          1.0.5   2023-06-09 [1] CRAN (R 4.3.0)
 cachem         1.0.8   2023-05-01 [1] CRAN (R 4.3.0)
 car            3.1-2   2023-03-30 [1] CRAN (R 4.3.0)
 carData        3.0-5   2022-01-06 [1] CRAN (R 4.3.0)
 cli            3.6.1   2023-03-23 [1] CRAN (R 4.3.0)
 colorspace     2.1-0   2023-01-23 [1] CRAN (R 4.3.0)
 cowplot        1.1.3   2024-01-22 [1] CRAN (R 4.3.2)
 crayon         1.5.2   2022-09-29 [1] CRAN (R 4.3.0)
 data.table   * 1.15.4  2024-03-30 [1] CRAN (R 4.3.2)
 devtools     * 2.4.5   2022-10-11 [1] CRAN (R 4.3.0)
 digest         0.6.35  2024-03-11 [1] CRAN (R 4.3.2)
 dplyr        * 1.1.3   2023-09-03 [1] CRAN (R 4.3.0)
 ellipsis       0.3.2   2021-04-29 [1] CRAN (R 4.3.0)
 fansi          1.0.4   2023-01-22 [1] CRAN (R 4.3.0)
 farver         2.1.1   2022-07-06 [1] CRAN (R 4.3.0)
 fastmap        1.1.1   2023-02-24 [1] CRAN (R 4.3.0)
 forcats      * 1.0.0   2023-01-29 [1] CRAN (R 4.3.0)
 fs             1.6.4   2024-04-25 [1] CRAN (R 4.3.2)
 generics       0.1.3   2022-07-05 [1] CRAN (R 4.3.0)
 ggiraph      * 0.8.9   2024-02-24 [1] CRAN (R 4.3.2)
 ggiraphExtra * 0.3.0   2020-10-06 [1] CRAN (R 4.3.0)
 ggplot2      * 3.5.1   2024-04-23 [1] CRAN (R 4.3.2)
 ggpubr       * 0.6.0   2023-02-10 [1] CRAN (R 4.3.0)
 ggsignif       0.6.4   2022-10-13 [1] CRAN (R 4.3.0)
 glue           1.6.2   2022-02-24 [1] CRAN (R 4.3.0)
 gridExtra      2.3     2017-09-09 [1] CRAN (R 4.3.0)
 gtable         0.3.4   2023-08-21 [1] CRAN (R 4.3.0)
 hms            1.1.3   2023-03-21 [1] CRAN (R 4.3.0)
 htmltools      0.5.8.1 2024-04-04 [1] CRAN (R 4.3.2)
 htmlwidgets    1.6.4   2023-12-06 [1] CRAN (R 4.3.0)
 httpuv         1.6.15  2024-03-26 [1] CRAN (R 4.3.2)
 insight        0.19.10 2024-03-22 [1] CRAN (R 4.3.2)
 labeling       0.4.3   2023-08-29 [1] CRAN (R 4.3.0)
 later          1.3.2   2023-12-06 [1] CRAN (R 4.3.0)
 lattice        0.21-8  2023-04-05 [1] CRAN (R 4.3.1)
 lifecycle      1.0.3   2022-10-07 [1] CRAN (R 4.3.0)
 lubridate    * 1.9.3   2023-09-27 [1] CRAN (R 4.3.0)
 magrittr       2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
 MASS           7.3-60  2023-05-04 [1] CRAN (R 4.3.1)
 Matrix         1.5-4.1 2023-05-18 [1] CRAN (R 4.3.1)
 memoise        2.0.1   2021-11-26 [1] CRAN (R 4.3.0)
 mgcv           1.8-42  2023-03-02 [1] CRAN (R 4.3.1)
 mime           0.12    2021-09-28 [1] CRAN (R 4.3.0)
 miniUI         0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0)
 modeltools     0.2-23  2020-03-05 [1] CRAN (R 4.3.0)
 munsell        0.5.0   2018-06-12 [1] CRAN (R 4.3.0)
 mycor          0.1.1   2018-04-10 [1] CRAN (R 4.3.0)
 nlme           3.1-162 2023-01-31 [1] CRAN (R 4.3.1)
 NLP          * 0.2-1   2020-10-14 [1] CRAN (R 4.3.0)
 pillar         1.9.0   2023-03-22 [1] CRAN (R 4.3.0)
 pkgbuild       1.4.4   2024-03-17 [1] CRAN (R 4.3.2)
 pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.3.0)
 pkgload        1.3.4   2024-01-16 [1] CRAN (R 4.3.0)
 plyr           1.8.9   2023-10-02 [1] CRAN (R 4.3.0)
 ppcor          1.1     2015-12-03 [1] CRAN (R 4.3.0)
 profvis        0.3.8   2023-05-02 [1] CRAN (R 4.3.0)
 promises       1.3.0   2024-04-05 [1] CRAN (R 4.3.2)
 purrr        * 1.0.2   2023-08-10 [1] CRAN (R 4.3.0)
 qdapRegex      0.7.8   2023-10-17 [1] CRAN (R 4.3.0)
 R6             2.5.1   2021-08-19 [1] CRAN (R 4.3.0)
 ragg           1.3.1   2024-05-06 [1] CRAN (R 4.3.2)
 RColorBrewer * 1.1-3   2022-04-03 [1] CRAN (R 4.3.0)
 Rcpp           1.0.12  2024-01-09 [1] CRAN (R 4.3.0)
 readr        * 2.1.5   2024-01-10 [1] CRAN (R 4.3.0)
 remotes        2.5.0   2024-03-17 [1] CRAN (R 4.3.2)
 reshape      * 0.8.9   2022-04-12 [1] CRAN (R 4.3.0)
 reshape2       1.4.4   2020-04-09 [1] CRAN (R 4.3.0)
 rlang          1.1.1   2023-04-28 [1] CRAN (R 4.3.0)
 rstatix        0.7.2   2023-02-01 [1] CRAN (R 4.3.0)
 rstudioapi     0.16.0  2024-03-24 [1] CRAN (R 4.3.2)
 scales       * 1.3.0   2023-11-28 [1] CRAN (R 4.3.0)
 sessioninfo    1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
 shiny          1.8.1.1 2024-04-02 [1] CRAN (R 4.3.2)
 sjlabelled     1.2.0   2022-04-10 [1] CRAN (R 4.3.0)
 sjmisc         2.8.9   2021-12-03 [1] CRAN (R 4.3.0)
 slam           0.1-50  2022-01-08 [1] CRAN (R 4.3.0)
 stringi        1.8.4   2024-05-06 [1] CRAN (R 4.3.2)
 stringr      * 1.5.1   2023-11-14 [1] CRAN (R 4.3.0)
 systemfonts    1.0.6   2024-03-07 [1] CRAN (R 4.3.2)
 textclean    * 0.9.3   2018-07-23 [1] CRAN (R 4.3.0)
 textreg      * 0.1.5   2018-10-04 [1] CRAN (R 4.3.0)
 textshaping    0.3.7   2023-10-09 [1] CRAN (R 4.3.0)
 tibble       * 3.2.1   2023-03-20 [1] CRAN (R 4.3.0)
 tidyr        * 1.3.1   2024-01-24 [1] CRAN (R 4.3.2)
 tidyselect     1.2.1   2024-03-11 [1] CRAN (R 4.3.2)
 tidyverse    * 2.0.0   2023-02-22 [1] CRAN (R 4.3.0)
 timechange     0.3.0   2024-01-18 [1] CRAN (R 4.3.0)
 tm           * 0.7-13  2024-04-20 [1] CRAN (R 4.3.2)
 topicmodels  * 0.2-16  2024-01-09 [1] CRAN (R 4.3.0)
 tzdb           0.4.0   2023-05-12 [1] CRAN (R 4.3.0)
 urlchecker     1.0.1   2021-11-30 [1] CRAN (R 4.3.0)
 usethis      * 2.2.3   2024-02-19 [1] CRAN (R 4.3.2)
 utf8           1.2.3   2023-01-31 [1] CRAN (R 4.3.0)
 uuid           1.2-0   2024-01-14 [1] CRAN (R 4.3.0)
 vctrs          0.6.3   2023-06-14 [1] CRAN (R 4.3.0)
 withr          2.5.0   2022-03-03 [1] CRAN (R 4.3.0)
 wordcloud    * 2.6     2018-08-24 [1] CRAN (R 4.3.0)
 xml2           1.3.6   2023-12-04 [1] CRAN (R 4.3.0)
 xtable         1.8-4   2019-04-21 [1] CRAN (R 4.3.0)

 [1] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant