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
Warning messages: Unknown column 'XYZ' #2396
Comments
Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you! If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down the page. |
Hi Hadley, I tried reproducing with iris, it's hard to know if I was able to reproduce the bug with it, because I'm still getting warning messages relating to the original dataset I used and not to the new one. data(iris) Maybe this will do the trick to reproduce the bug. No guarantees though... I think it's related to the following thread in stackoverflow (which is also unresolved): |
@adisarid Thanks for you assist, I hadn't had time to figure out a reprex, unfortunately. Your guys are great, thanks so much, also Hadley! |
I don't see the warning, unfortunately. |
@hadley Did you check the stackoverflow thread? |
@adisarid none of those are a standalone reprex, but I did try and couldn't see the problem. |
This issue has been dealt at tidyverse/tibble#199. I suffered this warning but I don't get it anymore. Probably it has been addressed by the development tibble version. In any case the suggested approach is to initialize the column: data(iris)
iris.tibble <- as_data_frame(iris)
iris.tibble$Sepal.Length.str <- NA # Add this line
iris.tibble$Sepal.Length.str[iris.tibble$Sepal.Length >= 5] <- "Above 5"
iris.tibble$Sepal.Length.str[iris.tibble$Sepal.Length < 5] <- "Under 5" |
@adisarid @codingbutstillalive If you still get these warnings try to add # !diagnostics off as the first line in the source code file. Save the file. And try to see if it appears again. There seems to be a bug in Rstudio code diagnostics. I just reported it. https://support.rstudio.com/hc/en-us/community/posts/115001180488-Diagnostics-and-tibble-warning Now we can guess that @hadley codes without all the RStudio diagnostics enabled and not being able to reproduce the bug. But if anyone can code without diagnostics is him. 😝 |
Thanks @zeehio ! |
@adisarid, as you may have seen here (stackoverflow) this issue has been addressed today at rstudio/rstudio@bcad791 so it won't affect you in RStudio v1.1.103 or newer (as far as I know that version is not yet published at the RStudio Preview page). |
I had the problem with the unknown column as well. |
I once used add_column to add a new column to my data frame, something along the line of:
Since then, every now and then I get warning messages "Unknown column 'QUARTAL'". Those appear arbitrarily upon invoking commands, not only when issuing the add_column command. I have no clue why.
I already cleared up the whole environment and tried to reset the cache of latest warnings like this:
assign("last.warning", NULL, envir = baseenv())
Nothing helps.
The text was updated successfully, but these errors were encountered: