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

head(a_tibble) fails if NAs present in column names #363

Closed
nathancday opened this issue Jan 14, 2018 · 3 comments
Closed

head(a_tibble) fails if NAs present in column names #363

nathancday opened this issue Jan 14, 2018 · 3 comments

Comments

@nathancday
Copy link

nathancday commented Jan 14, 2018

Not sure if this is expected behavior or not. However it was not the behavior in version 1.3.4, it would run without error and return the escaped NA.

library(tibble)

data(iris)
tib <- as.tibble(iris)
head(tib)

# A tibble: 6 x 5
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
         <dbl>       <dbl>        <dbl>       <dbl> <fctr> 
1         5.10        3.50         1.40       0.200 setosa 
2         4.90        3.00         1.40       0.200 setosa 
3         4.70        3.20         1.30       0.200 setosa 
4         4.60        3.10         1.50       0.200 setosa 
5         5.00        3.60         1.40       0.200 setosa 
6         5.40        3.90         1.70       0.400 setosa 


# with NAs
names(tib) <- gsub("Species", NA, names(iris))
head(tib)

Error in data.frame(id = seq_along(x), max_widths = map_int(map(x, get_widths),  : 
  row names contain missing values


devtools::session_info()
Session info --------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.1 (2017-06-30)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.1.383)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            
 date     2018-01-14                  

Packages ------------------------------------------------------------------------------------------------------------------------------
 package   * version    date       source                          
 base      * 3.4.1      2017-07-07 local                           
 compiler    3.4.1      2017-07-07 local                           
 datasets  * 3.4.1      2017-07-07 local                           
 devtools    1.13.3     2017-08-02 CRAN (R 3.4.1)                  
 digest      0.6.13     2017-12-14 cran (@0.6.13)                  
 graphics  * 3.4.1      2017-07-07 local                           
 grDevices * 3.4.1      2017-07-07 local                           
 memoise     1.1.0      2017-04-21 CRAN (R 3.4.0)                  
 methods   * 3.4.1      2017-07-07 local                           
 pillar      1.0.1      2017-11-27 CRAN (R 3.4.3)                  
 rlang       0.1.6.9002 2018-01-11 Github (tidyverse/rlang@8414033)
 stats     * 3.4.1      2017-07-07 local                           
 tibble    * 1.4.1      2017-12-25 CRAN (R 3.4.1)                  
 tools       3.4.1      2017-07-07 local                           
 utils     * 3.4.1      2017-07-07 local                           
 withr       2.1.1.9000 2017-12-27 Github (jimhester/withr@df18523)
 yaml        2.1.14     2016-11-12 CRAN (R 3.4.0)
@krlmlr
Copy link
Member

krlmlr commented Jan 14, 2018

Thanks for reporting!

@nathancday
Copy link
Author

Thanks for writing awesome packages and fixing issues like Batman. Jinkies that was fast :)

@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants