Re: [Rd] segfault on write.dcf with gzfile connection
On Sun, 27 Nov 2005, Seth Falcon wrote: > On 27 Nov 2005, [EMAIL PROTECTED] wrote: > >> Unfortunately va_copy is an ISO C99 function, so not always >> available. >> >> Please do heed the posting guide and give us real details of your OS >> and compiler, as they do matter here (stdarg.h is often >> compiler-specific). > >> R.version > _ >platform x86_64-unknown-linux-gnu >arch x86_64 >os linux-gnu >system x86_64, linux-gnu >status Under development (unstable) >major2 >minor3.0 >year 2005 >month11 >day 23 >svn rev 36434 >language R > >gcc --version >gcc (GCC) 3.3.4 (pre 3.3.5 20040809) Thanks. The only one of my systems that seems to have any problem is FC3 x86_64 with gcc 3.4.3. The fixes I have put in (different on R-patched and R-devel) fix this example and the one now in reg-tests-1-R on that machine at least. > This page appears to have useful documentation: > http://www.unixpapa.com/incnote/variadic.html It's somewhat dated: (almost-)C99 compilers are much more common these days. > Thinking out loud: Does writecon need to be variadic? It is only > called once with a fixed format string "%s%s". It does not, but the print method for gzfile connections does. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] as.data.frame() : needs "..." ?!
[diverted from R-help to R-devel] > "Gabor" == Gabor Grothendieck <[EMAIL PROTECTED]> > on Sun, 27 Nov 2005 14:16:34 -0500 writes: <> Gabor> making use of as.data.frame.table we can shorten that Gabor> slightly to just: Gabor> as.data.frame.table(table(Species = iris$Species), Gabor> responseName = "Count") Gabor> Incidently, I just noticed that there is an Gabor> inconsistency between as.data.frame and Gabor> as.data.frame.table making it impossible to shorten Gabor> as.data.frame.table to as.data.frame in the above due Gabor> to the responseName= argument which is not referenced Gabor> in the generic. >> args(as.data.frame) Gabor> function (x, row.names = NULL, optional = FALSE) Gabor> NULL >> args(as.data.frame.table) Gabor> function (x, row.names = NULL, optional = FALSE, Gabor> responseName = "Freq") Gabor> NULL {If you used str() instead of args() , you wouldn't get the superfluous extra 'NULL' line } I think this is an example where we (R-core) haven't followed our own recommendations, namely, that generic functions (and methods) need to have a (trailing) "..." argument just so that new methods can have further arguments. I'm wondering a bit... or could there be a good reason in the present case, why this hasn't been done? Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] import of Namespaces
Dear R devels, let's say I have three packages "pkg1", "pkg2" and "pkg3" which all contain new S4 classes and methods. Where "pkg3" depends on "pkg2" and "pkg2" depends on "pkg1". Moreover, all three packages have namespaces. 1) I use ".onLoad <- function(lib, pkg) require(methods)". Do I also have to import the namespace of "methods" package? 2) If I use import("pkg1") in the namespace of "pkg2", does this also (correctly) import the S4 classes and methods of "pkg1"? Or do I explicitly have to use importClassesFrom resp. importMethodsFrom? 3) If I import the Namespace of "pkg2" in "pkg3", where the namespace of "pkg2" has import("pkg1") (or maybe importClassesFrom, importMethodsFrom) and I also want to use S4 classes and methods of "pkg1" in "pkg3". Is it sufficient to have import("pkg2") in the Namespace of "pkg3" or do I need import("pkg1") and import("pkg2")? Many thanks for your help and advice Matthias -- StaMatS - Statistik + Mathematik Service Dipl.Math.(Univ.) Matthias Kohl www.stamats.de __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] terms.object documentation bug? (PR#8353)
Full_Name: simon wood Version: 2.2.0 (and lower) OS: linux/windows Submission from: (NULL) (86.135.153.59) I think that the documentation for the `specials' attribute of a `terms.object' is not quite right: specials: If the 'specials' argument was given to 'terms.formula' there is a 'specials' attribute, a list of vectors indicating the terms that contain these special functions. should read something like: specials: If the 'specials' argument was given to 'terms.formula' there is a 'specials' attribute, a list of vectors indicating the variables that contain these special functions. Here is some example code illustrating the problem: tf <- terms.formula(y~x+x:z+s(x),specials="s") ## make a `terms' object attr(tf,"specials") ## documented to index `s' in list of terms ## but in lists of terms, `s' is in position 2, not 4 attr(tf,"term.labels") colnames(attr(tf,"factors")) ## in lists of variables `s' *is* in position 4... attr(tf,"variables") rownames(attr(tf,"factors")) best, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] No Rmath.h when making just standalone library
When making only the standalone math library, include/Rmath.h is not there, so compilation fails. A solution is to go to src/include/ and just say `make Rmath.h' there first. This is with R-2.2.0 on GNU/Linux on i686. The failing steps are: tar xzf ../R-2.2.0.tar.gz ./configure cd src/nmath/standalone make Would be nice if this worked, or if the issue were just mentioned in src/nmath/standalone/README. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] No Rmath.h when making just standalone library
On Mon, 28 Nov 2005, Jussi Piitulainen wrote: > When making only the standalone math library, include/Rmath.h > is not there, so compilation fails. A solution is to go to > src/include/ and just say `make Rmath.h' there first. > > This is with R-2.2.0 on GNU/Linux on i686. The failing steps > are: > > tar xzf ../R-2.2.0.tar.gz > ./configure > cd src/nmath/standalone > make > > Would be nice if this worked, or if the issue were just > mentioned in src/nmath/standalone/README. It used to work as documented, and now does again. Thank you for the report. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] terms.object documentation bug? (PR#8353)
On Mon, 28 Nov 2005 [EMAIL PROTECTED] wrote: > Full_Name: simon wood > Version: 2.2.0 (and lower) > OS: linux/windows > Submission from: (NULL) (86.135.153.59) > > > I think that the documentation for the `specials' attribute of a > `terms.object' > is not quite right: > > specials: If the 'specials' argument was given to 'terms.formula' there > is a 'specials' attribute, a list of vectors indicating the > terms that contain these special functions. This is wrong, but it does not say `in the list of terms'. > should read something like: > > specials: If the 'specials' argument was given to 'terms.formula' there > is a 'specials' attribute, a list of vectors indicating the > variables that contain these special functions. You are right it refers to the variables, but we need to make clear that the vectors are numeric indices, and into what (not the variables attribute). > Here is some example code illustrating the problem: > > tf <- terms.formula(y~x+x:z+s(x),specials="s") ## make a `terms' object > attr(tf,"specials") ## documented to index `s' in list of terms > ## but in lists of terms, `s' is in position 2, not 4 > attr(tf,"term.labels") > colnames(attr(tf,"factors")) > > ## in lists of variables `s' *is* in position 4... > attr(tf,"variables") > rownames(attr(tf,"factors")) Thanks, I have adapted that for the help page. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Proposed Patch for table.Rd
Hi all, Attached is both a patch file for and a patched version of table.Rd. The change is to add the following: \concept{counts} \concept{frequencies} \concept{occurrences} \concept{contingency table} to enable help.search() to locate table() using the aforementioned search terms. This came up again this weekend and going back to the archives, these seem to cover a significant proportion of the common search terms that have been mentioned in relevant posts where it was suggested by the responder to see ?table. HTH, Marc Schwartz --- table.Rd2005-10-06 07:50:32.0 -0500 +++ table-patched.Rd2005-11-28 14:47:53.0 -0600 @@ -7,6 +7,10 @@ \alias{as.table} \alias{as.table.default} \alias{is.table} +\concept{counts} +\concept{frequencies} +\concept{occurrences} +\concept{contingency table} \description{ \code{table} uses the cross-classifying factors to build a contingency table of the counts at each combination of factor levels. \name{table} \title{Cross Tabulation and Table Creation} \alias{table} \alias{summary.table} \alias{print.summary.table} \alias{as.data.frame.table} \alias{as.table} \alias{as.table.default} \alias{is.table} \concept{counts} \concept{frequencies} \concept{occurrences} \concept{contingency table} \description{ \code{table} uses the cross-classifying factors to build a contingency table of the counts at each combination of factor levels. } \usage{ table(\dots, exclude = c(NA, NaN), dnn = list.names(...), deparse.level = 1) as.table(x, \dots) is.table(x) as.data.frame.table(x, row.names = NULL, optional = FALSE, responseName = "Freq") } \arguments{ \item{\dots}{objects which can be interpreted as factors (including character strings), or a list (or data frame) whose components can be so interpreted. (For \code{as.table}, arguments passed to specific methods.)} \item{exclude}{values to use in the exclude argument of \code{\link{factor}} when interpreting non-factor objects; if specified, levels to remove from all factors in \code{\dots}.} \item{dnn}{the names to be given to the dimensions in the result (the \emph{dimnames names}).} \item{deparse.level}{controls how the default \code{dnn} is constructed. See details.} \item{x}{an arbitrary \R object, or an object inheriting from class \code{"table"} for the \code{as.data.frame} method.} \item{row.names}{a character vector giving the row names for the data frame.} \item{optional}{a logical controlling whether row names are set. Currently not used.} \item{responseName}{The name to be used for the column of table entries, usually counts.} } \value{ \code{table()} returns a \emph{contingency table}, an object of \code{\link[base]{class}} \code{"table"}, an array of integer values. There is a \code{summary} method for objects created by \code{table} or \code{\link{xtabs}}, which gives basic information and performs a chi-squared test for independence of factors (note that the function \code{\link{chisq.test}} currently only handles 2-d tables). \code{as.table} and \code{is.table} coerce to and test for contingency table, respectively. The \code{as.data.frame} method for objects inheriting from class \code{"table"} can be used to convert the array-based representation of a contingency table to a data frame containing the classifying factors and the corresponding entries (the latter as component named by \code{responseName}). This is the inverse of \code{\link{xtabs}}. } \details{ If the argument \code{dnn} is not supplied, the internal function \code{list.names} is called to compute the \sQuote{dimname names}. If the arguments in \code{\dots} are named, those names are used. For the remaining arguments, \code{deparse.level = 0} gives an empty name, \code{deparse.level = 1} uses the supplied argument if it is a symbol, and \code{deparse.level = 2} will deparse the argument. Only when \code{exclude} is specified (i.e., not by default), will \code{table} drop levels of factor arguments potentially. Note that \code{as.data.frame.table} is also the \code{"table"} method for \code{\link{as.data.frame}}, but the \code{responseName} argument can only be given if it is called explicitly. } \seealso{Use \code{\link{ftable}} for printing (and more) of multidimensional tables. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth \& Brooks/Cole. } \examples{ require(stats) # for rpois and xtabs ## Simple frequency distribution table(rpois(100,5)) attach(warpbreaks) ## Check the design: table(wool, tension) detach() table(state.division, state.region) # simple two-way contingency table with(airquality, table(cut(Temp, quantile(Temp)), Month)) a <- letters[1:3] table(a, sample(a))# dnn is c("a", "") table(a, sample(a), deparse.level = 0) # dnn is c("", "") table(a, sample(a), deparse.level
[Rd] buglet in ?StructTS
?StructTS has The basic structural model, type = "BSM", is a local trend model with an additional seasonal component. Thus the measurement equation is x[t] = m[t] + s[t] + eps[t], exp[t] ~ N(0, sigma^2_eps) I guess in the last line exp[t] ~ should be eps[t] ~ ... Kjetil __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Proposed Patch for table.Rd
Thanks, incorporated now. On Mon, 28 Nov 2005, Marc Schwartz (via MN) wrote: > Hi all, > > Attached is both a patch file for and a patched version of table.Rd. > > The change is to add the following: > > \concept{counts} > \concept{frequencies} > \concept{occurrences} > \concept{contingency table} > > to enable help.search() to locate table() using the aforementioned > search terms. > > This came up again this weekend and going back to the archives, these > seem to cover a significant proportion of the common search terms that > have been mentioned in relevant posts where it was suggested by the > responder to see ?table. > > HTH, > > Marc Schwartz > > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel