This is actually a better answer than the one I gave. (I was reposting my reply to the more specific query at https://groups.google.com/forum/#!topic/plink2-users/zbr6cW3LeyU .)
Hi,
I'm encountering issues with reading .meta files into R. I am assuming the file needs to be reformatted to a .csv or a .txt. Does anyone have any idea of how to convert the PLINK output for meta-analysis (plink.meta) to a file format readable by R?
Thanks!
2 answers
See the comments on converting spaces to tabs under https://www.cog-genomics.org/plink/1.9/other#tabspace .
Please post the code you are using to read the meta file and R is failing, also add error/warning messages. Plink output is Fixed Width Format, which should be easily read using below commands:
read.table("meta.txt", header = TRUE)
Or using data.table, for faster reading:
data.table::fread("meta.txt")
If above fails, then maybe try to use read as fixed width file using read.fwf function, see below StackOverflow post for more info:
Log in to answer this question.
I suggest you provide some more details: Is the .meta file a text file? Pasting the first few lines of the .meta file might increase your chances of getting an answer.
its the default output of plink meta-analysis which is plink.meta (text file). When I try to import it into R it can't differentiate the columns.
Thanks
I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below: