Re: [Rd] is.vector(as.vector(x)) is FALSE
On Sun, 17 Oct 2004 01:51:47 + (UTC) Gabor Grothendieck wrote: The following, which was recently discussions on the rcom-l list, is a situation where coercing x1mat to a vector using as.vector results in an object that is.vector says is not a vector: R x1mat-matrix(list(1,1.1,1+1i,a,NA,NaN), 3, 2) R is.vector(as.vector(x1mat)) [1] FALSE If you give it a particular mode, it produces a vector: R as.vector(x1mat, mode = character) [1] 11.1 1+1i aNA NaN R as.vector(x1mat, mode = numeric) [1] 1.0 1.1 1.0 NA NA NaN Warning messages: 1: imaginary parts discarded in coercion 2: out-of-range values treated as 0 in coercion to raw A somewhat similar and simpler example is: R x - data.frame(a = 1:5, b = 6:10) R is.vector(as.vector(x)) [1] FALSE because data.frames are also already vectors of mode list. The man page of as.vector provides a similar example with: R as.vector(x, mode = numeric) Error in as.vector(x, mode = numeric) : (list) object cannot be coerced to double I had discussed this with Kurt (and maybe R-devel, but I cannot find it in the archives) some time ago and the bottom line--if I recall correctly--was that is.vector() and as.vector() do not behave in the way that is.vector(as.vector(x)) always gives TRUE (or an error). Z __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] is.vector(as.vector(x)) is FALSE
Uwe Ligges [EMAIL PROTECTED] writes: ... I think I'd rather expect that as.vector(x1mat, mode = list) also removes the dim attributes. Just checked, Splus seems to satisfy is.vector(as.vector(x)) for list matrices and data frames. The R docs have 'as.vector', a generic, attempts to coerce its argument into a vector of mode 'mode' (the default is to coerce to whichever mode is most convenient). The attributes of 'x' are removed. so I think there is a case for deeming the current behaviour to be a bug... -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] convoluted namespace problem
I have a work around for this, but either I don't understand something (again) or it is a bug ... I have an S3 generic function periods defined in package tframe and exported from its namespace, and a method periods.TSdata defined in package dse1 and set as an S3method in its namespace. It uses another generic function periodsOutput defined in dse1 and exported from the dse1 namespace. From package dse2, which does not yet have a namespace, I call periods with a TSdata object and this fails couldn't find periods.TSdata. Is this user error or a bug? (Details below.) Thanks, Paul Gilbert R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.0 (2004-10-04), ISBN 3-900051-07-0 ... require(dse1) Loading required package: dse1 Loading required package: tframe Loading required package: setRNG [1] TRUE periods(TSdata(output=matrix(1:20,10,2))) Error in periods.TSdata(TSdata(output = matrix(1:20, 10, 2))) : couldn't find function periods.TSdata traceback() 2: periods.TSdata(TSdata(output = matrix(1:20, 10, 2))) 1: periods(TSdata(output = matrix(1:20, 10, 2))) periods function (x) UseMethod(periods) environment: namespace:tframe dse1:::periods.TSdata function (x, ...) UseMethod(periodsOutput) environment: namespace:dse1 dse1:::periodsOutput function (x) UseMethod(periodsOutput) environment: namespace:dse1 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] EMAIL BLOQUEADO
O e-mail abaixo indicado foi bloqueado por este servidor, pois contém um anexo executável. Arquivos executáveis são potencialmente perigosos por constituir meio de propagação de vírus e worms de e-mail. Se realmente o envio do arquivo for necessário, reenvie em formato ZIP. Mail headers: Date : Mon, 18 Oct 2004 18:50:03 -0200 Subject: :) From : [EMAIL PROTECTED] Return-Path: [EMAIL PROTECTED] Received : from fundeg.br (unknown [192.168.1.215]) To (system): maira To (header): [EMAIL PROTECTED] Cc : Bcc: Executables: AIDS!.doc.pif Mensagem automática Unifeg - Centro Universitário Fundação Educacional Guaxupé www.unifeg.edu.br __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] barchart fails when grouping variable has more than 7 levels (PR#7293)
Full_Name: Andreas Kiermeier Version: 2.0.0 OS: Windows XP Submission from: (NULL) (203.26.122.12) I've struck a problem drawing barcharts after installing R 2.0.0. Previously I've used the following command print(barchart(100*result ~ sample, groups=congener, data=dioxin.2003.fresh.ub.p, stack=TRUE, ylim=c(0,102))) to draw a stacked barchart of the precentage contribution of each type of dioxin congener. Now, however I get the following error. Error in grid.Call.graphics(L_rect, x$x, x$y, x$width, x$height, valid.just(x$just)) : invalid line type The graph that actually results on my trellis device has axes and for the first sample it manages to 7 of the 17 stacked bars. As a work-around I have used (I used reps of 50 as another graph has 46 congeners): my.tpar - trellis.par.get(superpose.fill) my.tpar$alpha - rep(1,50) my.tpar$border - rep(black, 50) my.tpar$lty - rep(1, 50) my.tpar$lwd - rep(1, 50) trellis.par.set(superpose.fill, my.tpar) The barchart conequently works. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] barchart fails when grouping variable has more than 7 levels (PR#7293)
On Monday 18 October 2004 21:47, [EMAIL PROTECTED] wrote: Full_Name: Andreas Kiermeier Version: 2.0.0 OS: Windows XP Submission from: (NULL) (203.26.122.12) I've struck a problem drawing barcharts after installing R 2.0.0. Previously I've used the following command print(barchart(100*result ~ sample, groups=congener, data=dioxin.2003.fresh.ub.p, stack=TRUE, ylim=c(0,102))) to draw a stacked barchart of the precentage contribution of each type of dioxin congener. Now, however I get the following error. Error in grid.Call.graphics(L_rect, x$x, x$y, x$width, x$height, valid.just(x$just)) : invalid line type The graph that actually results on my trellis device has axes and for the first sample it manages to 7 of the 17 stacked bars. Right, I had the color replicated to be as long as necessary, but missed the other things. Should be fixed in the next release. Thanks, Deepayan __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel