I am currently trying to import a txt dataset which only has numbers in it. When I am importing it I use;
k2= read.delim("dummy.txt", stringsAsFactors = F, header = F, sep="",colClasses = "character")
but unfortunately it seems that this gives the columns combined with only one column like this. And it didn't separate "by nothing". Read table gives the same result.
I am trying to separate the column into multiple columns where every single number will be in a separate column (there are 297 numbers and all will be separate). I tried these with tidyr;
1- k2 %>% separate(as.character(k2$V1), 1:297, "")
2- apply(k2,2,k2 %>% separate(as.character(k2$V1), 1:297, sep= ""))
But get this message in both: Must extract column with a single valid subscript. x Subscript var
has size 555514 but must be size 1.
I would like to either import my dataset with everything splitted or split them with a code.
I am not well with the apply family and good tutorial suggestions are also heartfully welcome.