lstset(taglist, LineLength = getOption("width"), startS = "\\lstset{")
lstsetR(Rset = NULL, LineLength = getOption("width"), add = getSweaveListingOption("addRset"), startS = "\\lstset{", append = TRUE, withRstyle = FALSE)
lstsetRd(Rdset = NULL, LineLength = getOption("width"), add = getSweaveListingOption("addRdset"), startS = "\\lstset{", append = TRUE)
lstsetRin(Rinset = NULL, LineLength = getOption("width"), add = getSweaveListingOption("addRinset"), startS = "\\lstdefinestyle{Rinstyle}{", append = TRUE)
lstsetRout(Routset = NULL, LineLength = getOption("width"), add = getSweaveListingOption("addRoutset"), startS = "\\lstdefinestyle{Routstyle}{", append = TRUE)
lstsetRcode(Rcodeset = NULL, LineLength = getOption("width"), add = getSweaveListingOption("addRcodeset"), startS = "\\lstdefinestyle{Rcodestyle}{", append = TRUE)
lstsetRall(Rallset = NULL, LineLength = getOption("width"), add = c("in" = getSweaveListingOption("addRinset"), "out" = getSweaveListingOption("addRoutset"), "code" = getSweaveListingOption("addRcodeset")), startS = c("in" = "\\lstdefinestyle{Rinstyle}{", "out" = "\\lstdefinestyle{Routstyle}{", "code" = "\\lstdefinestyle{Rcodestyle}{"), append = c("in" = TRUE, "out" = TRUE, "code" = TRUE), withOptionsDefAppend = TRUE)
lstdefRstyle(Rset = NULL, LineLength = getOption("width"), add = TRUE)numeric number of characters per line for lstset and friends;
  defaults to getOption("width")taglist; arguments for
                \lstset of TeX package listings.taglist or named list of 
            characters; the listings settings for R-code
            (for \lstset); defaults to NULL.taglist or named list of
            characters; the listings settings for R-code in
            environment Sinput; defaults to NULL.taglist or named list of
            characters; the listings settings for R-code in
            environment Soutput; defaults to NULL.taglist or named list of
            characters; the listings settings for R-code in
            environment Scode; defaults to NULL.taglist or named list of
            characters; the listings settings for R-code in
            environments Sinput, Soutput, Scode,
            simultaneously; defaults to NULL.taglist or named list of
             characters;
             the listings settings for Rd-code
            (for \lstset); defaults to NULL.TRUE; if TRUE, argument list 
           Rset resp. Rdset will be appended to default value 
           lists getSweaveListingOption("Rset") resp.  
           getSweaveListingOption("Rdset") (see below),
           overwriting respective entries of the default value lists;
           in case of lstsetRall may be named vector of length 3
           with names c("in","out","code")."\\lstset\{"; what to do
              by default we use \lstset; an alternative is
              to use \lstdefinestyle which amounts to
              "\\lstdefinestyle\{";
              in case of lstsetRall may be named vector of length 3
              with names c("in","out","code").TRUE (default) the new settings are appended
to the old ones; otherwise they are prepended; in case of lstsetRall
may be named vector of length 3 with names c("in","out","code").TRUE "style = Rstyle," is prepended.SweaveListingoptions) be included?invisible()
lstset writes out to stdout a call to TeX command 
\lstset{arg1 = val1, arg2 = val2, .....}
and doing so respects a maximal number of characters per line and does not
break arg=val tags.lstsetR and lstsetRd expect either
objects of S3 class taglist, or lists of named characters as
first arguments, which in the latter case are then converted to taglist;
both lstsetR and lstsetRd use particular default values to
define R resp. Rd output format. More
specifically for R code, it uses 
getSweaveListingOption("Rset"),
and for Rd code, it 
getSweaveListingOption("Rdset");
lstsetRin, lstsetRout, and lstsetRcode
are corresponding specialized commands for 'listings' environments
Sinput, Soutput, and Scode, respectively.
lstsetRall simultaneously sets/modifies settings for
'listings' environments
Sinput, Soutput, and Scode.
lstsetdefRstyle redefines listings style
definition for Rstyle.
The output to stdout can be captured in an .Rnw file as
<< lstsetR, results=tex, echo=FALSE>>= lstsetR() @to insert the corresponding
\lstset command to the produced
TeX file.
lstset(taglist(A="H", b=2, 3),30)
lstset(taglist(A="H", b=2, 3),30, startS = "\\lstdefinestyle{Rstyle}{")
lstsetR()
lstsetRd()
Run the code above in your browser using DataLab