I am trying to convert text file data in R. The dataset looks like this
RXID- 3233
OWN - NLM
AU - HBGHB
AB - good boy.
RXID- 3234
OWN - NLM
AU - HBGJI
AB - bad boy.
I referred converting multiple lines of text into a data frame and i did this
x<-read.delim("Test.txt", header = FALSE, sep = "-", strip.white = TRUE) #this is working well
cols<-levels(x[,'V1']) #This is giving a null value
I am not able to find out why this is coming NULL
The final output should look like this
RXID OWN AU AB
3233 NLM HBGHB good boy
3234 NLM HBGJI bad boy