Here is how my object displays:
> object
[1] "string1"
[2] "string2"
[3] "string3"
What is that object type called? How do I change it to a vector like this (without manually typing the whole thing out):
> c("string1","string2","string3")
[1] "string1" "string2" "string3"
All the methods I tried just gave me back the same object.
> as.vector(object)
> unlist(object)
Edit: Thanks for your help. I think it was a vector to begin with.
It is unlikely to be a list of 3 elements which would typically appear like this in the console:
If you can, do
str(object)orclass(object)as recommended above to find out more. Once you see if there is an internal structure you may be able to do something likeobject$substructureto get at this. Could you let us know whatstr()gives you? It will help answer.