<br><font size=2 face="sans-serif">Speaking of spectrum, my face has now been red-shifted.</font>
<br>
<br><font size=2 face="sans-serif">I guess it's pretty dumb having a variable named 'pi' in a data frame that I've attached. This is obviously newbie sloppiness, but it raises the question about how R-guru's manage inadvertent clobbering of magic names. Constructive suggestions would be warmly received.</font>
<br>
<br><font size=2 face="sans-serif">Thanks.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br>
<br><font size=2 face="sans-serif">Mike</font>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Michael Nielsen/Syd/Synergy on 19/07/2001 11:22 AM -----</font>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Michael Nielsen</b></font>
<p><font size=1 face="sans-serif">19/07/2001 11:13 AM</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: r-help@stat.math.ethz.ch</font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: Strange behaviour of spectrum()?</font></table>
<br>
<br><font size=2 face="sans-serif">Dear r-help list:</font>
<br>
<br><font size=2 face="sans-serif">In the following R session, I seem to be somehow breaking the spectrum() function, but I'm not sure how. Could somebody please point out my mistake? My apologies if it's something that should be obvious.</font>
<br>
<br><font size=2 face="sans-serif">The mysterious bit is how spectrum(my.ts) at first works, but then later fails with an error message that I find difficult to interpret.</font>
<br>
<br><font size=2 face="sans-serif">I'm running R 1.3.0 that I compiled myself on what was once Caldera Linux (2.2.14), but I dare say I've deviated somewhat from the original Caldera distribution (added GNOME and generally updated software).</font>
<br>
<br><font size=2 face="sans-serif">Thanks in advance.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br>
<br><font size=2 face="sans-serif">Mike</font>
<br>
<br><font size=2 face="sans-serif">---- session transcript follows ----</font>
<br>
<br><font size=2 face="sans-serif">R : Copyright 2001, The R Development Core Team<br>
Version 1.3.0 (2001-06-22)</font>
<br>
<br><font size=2 face="sans-serif">R is free software and comes with ABSOLUTELY NO WARRANTY.<br>
You are welcome to redistribute it under certain conditions.<br>
Type `license()' or `licence()' for distribution details.</font>
<br>
<br><font size=2 face="sans-serif">R is a collaborative project with many contributors.<br>
Type `contributors()' for more information.</font>
<br>
<br><font size=2 face="sans-serif">Type `demo()' for some demos, `help()' for on-line help, or<br>
`help.start()' for a HTML browser interface to help.<br>
Type `q()' to quit R.</font>
<br>
<br><font size=2 face="sans-serif">> ls()<br>
character(0)<br>
> library(tseries)</font>
<br>
<br><font size=2 face="sans-serif"> `tseries' version: 0.7-4 <br>
<br>
`tseries' is a package for time series analysis with emphasis<br>
on non-linear modelling.<br>
See `library (help=tseries)' for details.</font>
<br>
<br><font size=2 face="sans-serif">> my.ts<-ts(rnorm(200))<br>
> spectrum(my.ts) # nice graphic display appears<br>
> plot(my.ts) # another nice graphic display appears<br>
> spectrum(my.ts) # As expected, yet another nice graphic display appears<br>
> perf<-read.delim('vmout3.txt')<br>
> attach(perf)<br>
> ls(perf)<br>
[1] "X" "avm" "b" "cs" "cy" "fr" "fre" "idl" "in" "pi" "po" "r" <br>
[13] "re" "sr" "sy" "sys" "t" "usr" "wai"<br>
> idl.ts<-ts(idl)</font>
<br>
<br><font size=2 face="sans-serif">> spectrum(idl.ts) # No graphic appears<br>
Error in "[<-"(*tmp*, , i, value = c(w, rep(1, nr - 2 * m), rev(w)) * : <br>
number of items to replace is not a multiple of replacement length<br>
In addition: Warning messages: <br>
1: longer object length<br>
is not a multiple of shorter object length in: pi * seq(1, 2 * m - 1, by = 2) <br>
2: longer object length<br>
is not a multiple of shorter object length in: c(w, rep(1, nr - 2 * m), rev(w)) * x[, i] </font>
<br>
<br>
<br><font size=2 face="sans-serif">> spectrum(my.ts) # I would have thought this would have worked<br>
Error in "[<-"(*tmp*, , i, value = c(w, rep(1, nr - 2 * m), rev(w)) * : <br>
number of items to replace is not a multiple of replacement length<br>
In addition: Warning messages: <br>
1: longer object length<br>
is not a multiple of shorter object length in: pi * seq(1, 2 * m - 1, by = 2) <br>
2: longer object length<br>
is not a multiple of shorter object length in: c(w, rep(1, nr - 2 * m), rev(w)) * x[, i] <br>
> </font>
<br>