chmod 777 on the destination folder fixed the sink() issue. Still don't know why library() was causing the script to stop though. 

----- Original Message -----

From: "Yoni Teitelbaum" <yoni.teitelbaum@escapemg.com> 
To: r-help@r-project.org 
Sent: Friday, June 17, 2011 5:41:33 AM 
Subject: [R] sink() and library() calls cause script to stop when called from php 

Hello all, 


I have a php script that makes a call 


system(PATH_PROJECT_ROOT . '/sh/combineDays.sh ' . $dateString . " " . PATH_PROJECT_ROOT); 


and within combineDays.sh I run an R script: 


R --slave --vanilla --args $testDates $BASEDIR $defaultSearchVersion < $BASEDIR"R/combineDays.R" 


At the end of this R script, I try to write results to a file, but the script seems to stop executing after I call sink(results.file) in the R script. I previously observed similar behavior when trying to call library() from within the same R script. 


When I run combineDays.sh from the shell, everything works fine. 


Any ideas? 


Thanks. 
[[alternative HTML version deleted]] 

______________________________________________ 
R-help@r-project.org mailing list 
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]]

