I wrote a R script that will grep a file and parse it for me for a particular phrase. It will then save the file in a specific location.
Here is the R script:
con <- file("C:/test/VeriSeqNIPT_Method__Trace.trc")
request_method = grep("Clean up instrument", file, value = T)
writeLines(request_method, con = "C:/test1/analysis-output.txt")
I am trying to run this script from the command line to copy a few files as well. Here is the script I am running in command line. This script backup the trace file and then deleting the original
xcopy %source% %destination% /y
cd C:\Program Files\R\R-3.2.3\bin
What is happening that the R script and cmd script (without calling the R script both work fine
When I run them all together like shown above, I get the error:
"Error in as.character(x): cannot coerce type 'closure' to vector of type 'character'
Calls:grep -> structure