Convert elements into vector without creating a file

Hello, how can I do to convert into a vector a list of elements that someone give me through mail or whatsapp without the need to create a file outside of R (for example .txt or .csv).

For example, someone sends me this list by mail:

car
bike
motorcycle
boat
airplane

And I would like to have it like this:
c(car, bike, motorcycle, boat, airplane)

How can I do it? I clarify that this is a small example, but I think it for situations where the list has 200 elements.

You can use datapasta

datapasta::vector_paste("car
bike
motorcycle
boat
airplane")
#> c("car", "bike", "motorcycle", "boat", "airplane")

Created on 2022-10-03 with reprex v2.0.2

1 Like

This topic was automatically closed 7 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.