[R] Combining text files

Eric Berger er|cjberger @end|ng |rom gm@||@com
Wed Dec 4 10:23:05 CET 2019


Continuing with Jeff's point: do you know for certain that the serial
number in row 5 of one file corresponds to the 'work order number' in row 5
of a different file?
Ideally this could be verified based on some sort of identifier that
appears as a column in both files and you could match up corresponding rows
in the two files by matching this identifier (or possibly multiple
identifiers.)
This type of matching is called a join and joins are supported in the dplyr
package (which also provides the bind_cols() function you referred to.)
Check out
?dplyr::join

HTH,
Eric



On Wed, Dec 4, 2019 at 7:55 AM Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
wrote:

> Do you know for certain that the rows are in the same order? then yes...
> cbind or bind_cols would do it. I would be surprised to find such files...
> but it is possible.
>
> On December 3, 2019 9:37:34 PM PST, Thomas Subia via R-help <
> r-help using r-project.org> wrote:
> >Colleagues,
> >I've got several text files which contain data for each metric I need
> >to report on.One text file contains the serial number data. Another has
> >customer and work order number. Another has test data. All text files
> >have the same number of rows but all have different numbers of columns.
> >
> >I was thinking about using bind_cols() to do this.
> >
> >Am I on the right track here?
> >All the best,
> >Thomas SubiaStatistician / Sr. Quality EngineerIMG Precision Inc.
> >
> >       [[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list