Reactable Columns - Error: Not in data

Hello - I have a basic question about the reactable package. I just pasted the code from the Reactable github to rename my columns and I am getting the error message that the column doesn't exist in my data. It definitely does.

Here's the initial code chunk:

reactable(iris[1:5, ], columns = list(
  Sepal.Length = colDef(name = "Sepal Length"),
  Sepal.Width = colDef(name = "Sepal Width"),
  Species = colDef(align = "center")

Here's my modification (I was using this week's tidy tuesday):

reactable(raw_bechdel[1:5, ], columns = list(
year = colDef(name = "Year"),
Species = colDef(align = "center")

Error message:
Error in reactable(raw_bechdel[1:5, ], columns = list(year = colDef(name = "Year"), :
columns names must exist in data.

I have no idea what I am doing wrong - any thoughts much appreciated!


names(raw_bechdel[1:5, ])

[1] "year" "id" "imdb_id" "title" "rating"

so column name Species doesnt appear in data ?

Ah... thank you!!! I was focused on year because that is what appeared in the error message. Many many thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.