Hi, I know this must be a stupid question, and sorry in advance for being such a noob. But, is there way to get R to display only certain variables when running a script. I know if you want to see the value of a variable when using the interface, you just type it in and hit enter, but is there a command that I can use in a script file that will show the value at a certain point? Thanks, -Nina
?print ?cat On Thu, Jul 17, 2008 at 1:47 PM, <naw3 at duke.edu> wrote:> Hi, > > I know this must be a stupid question, and sorry in advance for being such a > noob. But, is there way to get R to display only certain variables when running > a script. I know if you want to see the value of a variable when using the > interface, you just type it in and hit enter, but is there a command that I can > use in a script file that will show the value at a certain point? > > Thanks, > -Nina > > ______________________________________________ > 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 you are trying to solve?
?print ?cat HTH Stephan naw3 at duke.edu schrieb:> Hi, > > I know this must be a stupid question, and sorry in advance for being such a > noob. But, is there way to get R to display only certain variables when running > a script. I know if you want to see the value of a variable when using the > interface, you just type it in and hit enter, but is there a command that I can > use in a script file that will show the value at a certain point? > > Thanks, > -Nina > > ______________________________________________ > 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. >
Depending on your motivation here, you may want to search for 'debugging in R' or something to that effect to look at the various options available. I like the debug package available on CRAN. Also see ?browser and ?trace if you want to debug a function. naw3 at duke.edu wrote:> Hi, > > I know this must be a stupid question, and sorry in advance for being such a > noob. But, is there way to get R to display only certain variables when running > a script. I know if you want to see the value of a variable when using the > interface, you just type it in and hit enter, but is there a command that I can > use in a script file that will show the value at a certain point? > > Thanks, > -Nina > > ______________________________________________ > 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.