[R] Passing the parameter (file name) to png()

jim holtman jholtman at gmail.com
Sat Jun 26 13:43:33 CEST 2010


b <- paste("C:\\rphp\\",arg, sep='')

On Sat, Jun 26, 2010 at 12:55 AM, Maulik Shah <maulik.shah2020 at gmail.com> wrote:
> I am fitting 3 parameter model to my response matrix and want to generate
> item characterstic curve.
> I want to specify file name to save item characterstic curve by passing it
> as external parameter to the R batch script. The following is the code I
> have written for this.
>
> *R Script:*
>
> library(ltm)
> cmd_args = commandArgs();
> for (arg in cmd_args) cat("  ", arg, "\n", sep="")
> respmat <- read.table("C:\\rphp\\responsedata.txt")
> fit3pl <- tpm(respmat)
> cat("  ", arg, "\n", sep="")
> b <- c("C:\\rphp\\",arg)
> png(file=b, bg="transparent")
> plot(fit3pl,items=c,lwd=3)
> dev.off()
> rm(respmat,fit3pl,b)
> q()
>
> Could you please help me in doing so? I get an error message when R executes
> png().
>
> Thanks and Regards,
> Maulik
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list