I have two text files that are measure the X and Y coordinates of cells. The command dim(file.txt) returns NULL for each of the files. One of the files contains lines of X coordinates (xline1.1, x line1.2, x line1.3) followed below by a second line of coordinates for a separate entity (x line2.1, x line2.2, x line2.3) the other contains corresponding Y coordinates and I'm trying to transform the files into separate the files to create a new file for each line such that the X and Y coordinates will line up side by side like so:
X1 Y1 AND X2 from line 2, Y2 from line 2
x1.1 y1.1 x2.1 y2.1
x1.2 y1.2 x2.2 y2.2
etc.
I am inexperienced but my plan so far, is to use the lapply function to apply create.file() and file.path() to each consecutive line of the X and Y files such that a new file will be created for each line. I plan to use merge() to merge all of the newly created X files with the corresponding Y files somehow.
Any critiques are welcome.
0 answers
No answers yet.
Log in to answer this question.
I'd suggest trying your code and when you run into problems, you can post some example files and the code you are using. I'm not at all clear what you are proposing to do without seeing the code.
I still doubt that this is bioinformatics. Also, your question is posed in a way it is impossible to comprehend, because you are mixing input and output in your example, further it is irrelevant that dim(file.txt) is NULL, because dim works on datastructures not on files. If you specify the conversion you should do it in a way where the same objects have the same names, in your example there is not a single symbol appearing twice.
Also, you shouldn't speculate on how to solve the problem, before it is defined properly.
Mike, I have already tried to answer his question in an almost exact same post. trying to put values of two dimensionless files side by side
Could you close this post as well? I think this question is irrelevant to Bioinformatics as well.
Hello chrisclarkson100!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
PS: In addition to this post having been asked (and answered) before, the relationship to bioinformatics is not clear.