0

Currently, all the R commands I am issuing end with proc.time() as seen here:

                       avail_seat_km_per_week incidents_85_99 fatal_accidents_85_99

avail_seat_km_per_week              1.0000000       0.2795383             0.4682998

incidents_85_99                     0.2795383       1.0000000             0.8569911

fatal_accidents_85_99               0.4682998       0.8569911             1.0000000

> proc.time()

  user  system elapsed 

  0.115   0.021   0.124 

Is there a setting which will hide the proc.time() section?

I found the R help page for proc.time(), but I'm not seeing any thing related to my question.

EDIT

Here is the code I am using. It is the contents of my .R file.

options("width"=200)
warningFile <- file("operation-37625.warn", "w")
errorFile <- file("operation-37625.err", "w")
tryCatch({
  eval(parse(text = 'options(echo = FALSE);
  X <- read.table("/Users/Parag/Public/private/stat/datasets/admin/dataset-41414.csv", sep=",", header = TRUE);
  colNam <- colnames(X);
  X <- cbind(X[,2], X[,3], X[,4]);
  colnames(X) <- c(colNam[2], colNam[3], colNam[4]);
  cor(X)'))}, error = function(cond) { writeLines(toString(cond), con = errorFile)}, warning = function(cond) { writeLines(toString(cond), con = warningFile)}
 ) 

I hope I formatted it correctly. I am invoking the code via bash shell with:

/usr/local/bin/R CMD BATCH --vanilla --slave operation-37625.R

I don't think the contents of the file is important. It's just that I'm invoking the R via a command-line Batch statement.

pmagunia
  • 1,718
  • 1
  • 22
  • 33
  • Hide the code you're calling, or hide the results too? If the former, you could use RMarkdown if it's for presentation purposes. If the latter, just don't call `proc.time`. – alistaire Mar 29 '17 at 21:41
  • What commands are you using that all end with proc.time()? Maybe use ones that don't end with proc.time() if you don't want to call it? I'm very unclear about what's going on here. A [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) would help. YOu could redefine `proc.time()` to not print by default maybe: `proc.time<-function(...)invisible(base::proc.time(...))`? – MrFlick Mar 29 '17 at 21:41
  • @alistaire, @MrFlick thank you for those suggestions. I've edited my question to add additional information. I don't call `proc.time()` anywhere. I suppose I could overload the function definition but it doesn't seem to be an elegant solution. – pmagunia Mar 29 '17 at 23:37

0 Answers0