-
Notifications
You must be signed in to change notification settings - Fork 78
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 sect_title[[2]] : subscript out of bounds #12
Comments
Please check that you have version 0.8.1. There was an issue with 0.8.0, that might be it. If you have 0.8.1, please paste the call to dfSummary, with a brief description of your data. Thx |
I am also having this issue, in summarytools version 0.8.5. In my case, the issue seems to be that I am piping a dataframe through to I think this can be addressed by updating the Reprex: library(tidyverse)
library(summarytools)
data("iris")
summ1 = dfSummary(iris)
data_info1 = attr(summ1, "data_info")
data_info1
#> $Dataframe
#> [1] "iris"
#>
#> $N.obs
#> [1] 150
print(summ1)
#> Data Frame Summary
#> iris
#> N: 150
#> ------------------------------------------------------------------------------------------------------------------------
#> No Variable Stats / Values Freqs (% of Valid) Text Graph Valid Missing
#> ---- --------------- -------------------------- -------------------- -------------------------------- -------- ---------
#> 1 Sepal.Length mean (sd) : 5.84 (0.83) 35 distinct val. . . : : 150 0
#> [numeric] min < med < max : : : : : (100%) (0%)
#> 4.3 < 5.8 < 7.9 : : : : :
#> IQR (CV) : 1.3 (0.14) : : : : :
#> : : : : : : : :
#>
#> 2 Sepal.Width mean (sd) : 3.06 (0.44) 23 distinct val. : 150 0
#> [numeric] min < med < max : : (100%) (0%)
#> 2 < 3 < 4.4 . :
#> IQR (CV) : 0.5 (0.14) : : : :
#> . . : : : : : :
#>
#> 3 Petal.Length mean (sd) : 3.76 (1.77) 43 distinct val. : 150 0
#> [numeric] min < med < max : : . : (100%) (0%)
#> 1 < 4.35 < 6.9 : : : .
#> IQR (CV) : 3.5 (0.47) : : : : : .
#> : : . : : : : : .
#>
#> 4 Petal.Width mean (sd) : 1.2 (0.76) 22 distinct val. : 150 0
#> [numeric] min < med < max : : (100%) (0%)
#> 0.1 < 1.3 < 2.5 : . . :
#> IQR (CV) : 1.5 (0.64) : : : : .
#> : : : : : . : : :
#>
#> 5 Species 1. setosa 50 (33.3%) IIIIIIIIIIIIIIII 150 0
#> [factor] 2. versicolor 50 (33.3%) IIIIIIIIIIIIIIII (100%) (0%)
#> 3. virginica 50 (33.3%) IIIIIIIIIIIIIIII
#> ------------------------------------------------------------------------------------------------------------------------
summ2 = iris %>%
select(- Petal.Length) %>%
dfSummary()
data_info2 = attr(summ2, "data_info")
data_info2
#> $Dataframe
#> NULL
#>
#> $N.obs
#> [1] 150
print(summ2)
#> Error in sect_title[[2]]: subscript out of bounds |
Fixes issue dcomtois#12. If the dataframe used for dfSummary comes from a pipe, `data_info$Dataframe` is `NULL` and `sect_title` doesn't get populated properly. This can be fixed by checking for `NULL`.
I keep getting this error using dfSummary -- and it has happened for all of my data. All of the code worked before...
The text was updated successfully, but these errors were encountered: