[R] Readxl Question

Thomas Subia t@ub|@ @end|ng |rom |mgprec|@|on@com
Fri Dec 20 18:16:00 CET 2019


I am using readxl to extract a serial number and its associated data using the following code.

files <- list.files(pattern="*.xls", full.names = FALSE)
serials <- lapply(files, read_excel, sheet="Flow Data", range=("c6"))
flow.datum <- lapply(files, read_excel, sheet="Flow Data", range=("c22:c70"))
dates <- lapply(files, read_excel, sheet="Flow Data", range=("h14"))

Here each serial and date is associated with 49 data points in flow.datum.

Now I write the serials, flow data and dates into a text file using:

datesdf <- as.data.frame(dates)
mydates <- list(datesdf)

serialdf <- as.data.frame(serials)
myserials <- list(serialdf)

flowdf <-as.data.frame(flow.datum)
myflow <- list(flowdf)

The problem with the dates.txt and the serials.txt is that they need to associated with its 49 corresponding values in myflow.txt.

The objective is to create a text file having this format:

Serial	Date	Flow

I'm not sure how to do this. Any suggestions would be appreciated.

Thomas Subia 
Statistician / Senior Quality Engineer

IMG Companies 
225 Mountain Vista Parkway
Livermore, CA 94551
T. (925) 273-1106
F. (925) 273-1111
E. tsubia using imgprecision.com

Precision Manufacturing for Emerging Technologies

The contents of this message, together with any attachments, are intended only for the use of the individual or entity to which they are addressed and may contain information that is legally privileged, confidential and exempt from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender or IMG Companies, LLC at Tel: 925-273-1100 immediately by telephone or by return E-mail and delete this message, along with any attachments, from your computer. Thank you.

More information about the R-help mailing list