This has been happening recently, and I cannot understand how to resolve. N.B. I am using rStudio v0.99.893
I have created a character vector from a data.table
, which I then attempt to View, and receive the above error:
Error in View : 'names' attribute [4] must be the same length as the vector [1]
The original DT has ~10,000 observations of 12 variables, here is a subset capturing all classes:
> head(DT, 3)
HQ URL type ID1 ID2 completion date_first
1: imag image-welcome basic 444 24 0.1111111 2016-01-04 14:55:57
2: imag image-welcome basic 329 12 0.2222222 2016-03-15 11:37:21
3: imag image-confirm int 101 99 0.1111111 2016-01-06 20:55:07
as.character(sapply(DT, class))
[1] "character" "character" "character" "integer"
[5] "integer" "numeric" "c(\"POSIXct\", \"POSIXt\")"
From DT
I create a character vector of the unique values of URL
for a subset of interest (only 'imag' HQ):
URL.unique <- unique(DT[HQ == "imag", URL])
> class(URL.unique)
[1] "character"
> names(URL.unique)
NULL
> View(URL.unique)
Error in View : 'names' attribute [4] must be the same length as the vector [1]
> length(URL.unique)
[1] 262
Printing URL.unique
in the console works fine, as does exporting it via write.table()
but it is annoying that I cannot view it.
Unless there is something implicitly incorrect about the above, I am resorting to reinstalling rStudio. I've already tried quitting and relaunching, just in case there was some issue as I tend to leave multiple projects open on my computer over days.
Any help would be appreciated!