From Torsten.Hothorn at rzmail.uni-erlangen.de  Mon Mar 24 17:35:33 2003
From: Torsten.Hothorn at rzmail.uni-erlangen.de (Torsten.Hothorn@rzmail.uni-erlangen.de)
Date: Mon Mar 24 17:35:48 2003
Subject: [Rd] brackets in prompt.data.frame (PR#2676)
Message-ID: <200303241635.h2OGZXn9010891@pubhealth.ku.dk>


prompt.data.frame produces Rd-code with unbalanced brackets:

data(iris)
prompt(iris, filename=NA)

gives

...

$format
 [1] "\\format{"
 [2] "  A data frame with 150 observations on the following 5 variables."
 [3] "  \\describe{"
 [4] "    \\item{Sepal.Length}{a numeric vector}"
 [5] "    \\item{Sepal.Width}{a numeric vector}"
 [6] "    \\item{Petal.Length}{a numeric vector}"
 [7] "    \\item{Petal.Width}{a numeric vector}"
 [8] "    \\item{Species}{a factor with levels}"
 [9] "    \\item{Species}{\\code{setosa} }"
[10] "    \\item{Species}{\\code{versicolor} }"
[11] "    \\item{Species}{\\code{virginica} }"
[12] "}"

where the closing bracket to "describe" is missing. The fix seems simply
changing

        fmt <- c(fmt, "}")

to

        fmt <- c(fmt, "  } \n } ")

in line 208 of "prompt.R".

Torsten


[Rd] brackets in prompt.data.frame (PR#2676)
Torsten.Hothorn@rzmail.uni-erlangen.de