Creating a single column vector from a list column in RTest if a vector contains a given elementHow to sort a dataframe by multiple column(s)Counting the number of elements with the values of x in a vectorChopping a string into a vector of fixed width character elementsConvert data.frame columns from factors to charactersHow to replace and count frequency of a word or word sequence?Convert a list to a data frameDrop data frame columns by nameHow to rename a single column in a data.frame?Extracting specific columns from a data frame
Island of Knights, Knaves, Spies
Trek Madone SLR Di2
Why are seats at the rear of a plane sometimes unavailable even though many other seats are available in the plane?
Will the size of Bitcoin core full-node be too big to run on a normal computer?
If the music alphabet had more than 7 letters would octaves still sound like the same note?
How to protect my Wi-Fi password from being displayed by Android phones when sharing it with QR code?
Legality of creating a SE replica using SE's content
Why is it popular to teach modulus via the example of mod 12 and analogue clocks?
How should I tell a professor the answer to something he doesn't know?
How can a "proper" function have a vertical slope?
Why "come" instead of "go"?
How can a company compel a W2 employee to sign a non-compete agreement?
How can demon technology be prevented from surpassing humans?
Planet that goes through its entire history in a matter of Earth days
How safe is using non-RoHS parts?
SSD or HDD for server
String Operation to Split on Punctuation
Is a light year a different distance if measured from a moving object?
Shortest way to get an EOF Error
Why does 1.1.1.1 not resolve archive.is?
Why are Starfleet vessels designed with nacelles so far away from the hull?
Dynamics m, r, s, and z. What do they mean?
Hieroglyphs numerals
Did smallpox emerge in 1580?
Creating a single column vector from a list column in R
Test if a vector contains a given elementHow to sort a dataframe by multiple column(s)Counting the number of elements with the values of x in a vectorChopping a string into a vector of fixed width character elementsConvert data.frame columns from factors to charactersHow to replace and count frequency of a word or word sequence?Convert a list to a data frameDrop data frame columns by nameHow to rename a single column in a data.frame?Extracting specific columns from a data frame
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm currently trying to divide up a dataset of text documents (coded in UTF-8) by paragraph in R, but I'm having trouble getting them into the format I want for tidytext, which is a single column of the different paragraphs.
My data so far looks something like this:
list <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
df <- as.data.frame(list)
df_spl <- str_split(df$list, "n", n = Inf)
df_spl
Basically it's a large list of different vectors that have different paragraphs in them from each original row.
What I ultimately want is a single column vector with all the list items, like this:
vector <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti." "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
I've already tried commands like cbind(), stack(), and unnest(), but none of them have gotten me that single column :(
Any help would be greatly, greatly appreciated! Thanks!!
r nlp strsplit
add a comment
|
I'm currently trying to divide up a dataset of text documents (coded in UTF-8) by paragraph in R, but I'm having trouble getting them into the format I want for tidytext, which is a single column of the different paragraphs.
My data so far looks something like this:
list <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
df <- as.data.frame(list)
df_spl <- str_split(df$list, "n", n = Inf)
df_spl
Basically it's a large list of different vectors that have different paragraphs in them from each original row.
What I ultimately want is a single column vector with all the list items, like this:
vector <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti." "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
I've already tried commands like cbind(), stack(), and unnest(), but none of them have gotten me that single column :(
Any help would be greatly, greatly appreciated! Thanks!!
r nlp strsplit
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38
add a comment
|
I'm currently trying to divide up a dataset of text documents (coded in UTF-8) by paragraph in R, but I'm having trouble getting them into the format I want for tidytext, which is a single column of the different paragraphs.
My data so far looks something like this:
list <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
df <- as.data.frame(list)
df_spl <- str_split(df$list, "n", n = Inf)
df_spl
Basically it's a large list of different vectors that have different paragraphs in them from each original row.
What I ultimately want is a single column vector with all the list items, like this:
vector <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti." "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
I've already tried commands like cbind(), stack(), and unnest(), but none of them have gotten me that single column :(
Any help would be greatly, greatly appreciated! Thanks!!
r nlp strsplit
I'm currently trying to divide up a dataset of text documents (coded in UTF-8) by paragraph in R, but I'm having trouble getting them into the format I want for tidytext, which is a single column of the different paragraphs.
My data so far looks something like this:
list <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.",
"Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.
Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.
Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
df <- as.data.frame(list)
df_spl <- str_split(df$list, "n", n = Inf)
df_spl
Basically it's a large list of different vectors that have different paragraphs in them from each original row.
What I ultimately want is a single column vector with all the list items, like this:
vector <- c("Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti." "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.", "Lorem ipsum dolor sit amet, movet omittantur ut vel, vim an offendit prodesset. Sumo summo intellegam vel ei, dicunt persecuti vim ne. Lorem noluisse at est. Per ex postulant philosophia, ut vel amet affert tantas, pro ne consetetur scriptorem. Id mel aeque deleniti.", "Nam ut erat eligendi, pro eu minim molestie persequeris. Civibus interesset te nec, cu aeque fabellas luptatum has. Ad usu nominati tractatos. Eu voluptatum disputationi vis, alienum delicatissimi pri eu. Et molestie copiosae nam, ex vix ignota dignissim. Dico suas illum at mea, no case modus antiopam sea.", "Ius te copiosae lobortis contentiones. Est ceteros dissentiet ne, qui malis iuvaret tacimates an. Vivendo erroribus nec no. No quo corpora indoctum iracundia, mel ad mollis accusam praesent. Sit at admodum sensibus mediocrem, no pri decore nemore.")
I've already tried commands like cbind(), stack(), and unnest(), but none of them have gotten me that single column :(
Any help would be greatly, greatly appreciated! Thanks!!
r nlp strsplit
r nlp strsplit
asked Mar 28 at 21:24
brendanielbrendaniel
102 bronze badges
102 bronze badges
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38
add a comment
|
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38
add a comment
|
2 Answers
2
active
oldest
votes
To turn a list into a vector you can use:
unlist(df_spl)
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
add a comment
|
We can unlist
the list element into a
vectorand
paste` if we need a single string
out <- paste(unlist(df_spl), collapse=" ")
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407057%2fcreating-a-single-column-vector-from-a-list-column-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
To turn a list into a vector you can use:
unlist(df_spl)
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
add a comment
|
To turn a list into a vector you can use:
unlist(df_spl)
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
add a comment
|
To turn a list into a vector you can use:
unlist(df_spl)
To turn a list into a vector you can use:
unlist(df_spl)
answered Mar 28 at 21:29
Leo BrueggemanLeo Brueggeman
3531 silver badge4 bronze badges
3531 silver badge4 bronze badges
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
add a comment
|
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
Thanks! After I did this I just used as.data.frame() and got what I was looking for!
– brendaniel
Mar 28 at 21:41
add a comment
|
We can unlist
the list element into a
vectorand
paste` if we need a single string
out <- paste(unlist(df_spl), collapse=" ")
add a comment
|
We can unlist
the list element into a
vectorand
paste` if we need a single string
out <- paste(unlist(df_spl), collapse=" ")
add a comment
|
We can unlist
the list element into a
vectorand
paste` if we need a single string
out <- paste(unlist(df_spl), collapse=" ")
We can unlist
the list element into a
vectorand
paste` if we need a single string
out <- paste(unlist(df_spl), collapse=" ")
answered Mar 28 at 21:25
akrunakrun
474k15 gold badges263 silver badges344 bronze badges
474k15 gold badges263 silver badges344 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407057%2fcreating-a-single-column-vector-from-a-list-column-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hi, try and show us a minimal working example which does not contain multiple lines of strings.
– Cettt
Mar 28 at 21:38