printing - R force print before function is run -


i have small bit of code want print console before runs user know

if(save_data == "y"){     print("please select file folder information populated")     file = choose.dir()     file.dir=dirname(file) }  

is there way code print in console before choose.dir() run?

you need explicitly flush console if want message reliably appear prior dialog box

flushdemo<-function()  {   cat("please select file folder information populated\n")   flush.console()   file <- choose.dir()   return(file) }  flushdemo() 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -