Re: [R] creating list with 200 identical objects

2009-06-02 Thread Rainer M Krug
Thanks a lot Wacek for this clear description of the problem - I was not aware, that it is that complex. I definitely did not consider the initialize() function in writing my code. But as I only want to allocate the space for the objects, it does not matter here. But when I write a simulation and

Re: [R] variance does not equal serial covariance of lag zero?

2009-06-02 Thread Liviu Andronic
On Tue, Jun 2, 2009 at 3:34 PM, Thomas Lumley tlum...@u.washington.edu wrote: The answers differ by a factor of 19/20, ie, (n-1)/n, so it is presumably the choice of denominator for the variance that differs. Same issue is present in ccf(): cov() != ccf(lag.max=0, type=covariance). Liviu

[R] Problem downloading webpages using batchfiles and RCurl from command line in Vista Basic - couldn't connect to host

2009-06-02 Thread Tony Breyal
Dear all, I am having a problem downloading webpages through R when i run it in the DOS window under Windows Vista Basic. I have downloaded the batchfiles from http://code.google.com/p/batchfiles/ and have successfully set the PATH. I open up 'Command Prompt' in Vista and type (after the C:\...

[R] Correlation structure in AR(2) and ARMA(p,q)

2009-06-02 Thread FMH
Hi, Let theta be the coefficient in AR(1) model, the components of the correlation structure is equal to 1 for times s = t, and theta^|t-s| for t s. Could someone do me a favour to give some ideas on the correlation structure in AR(2) model and correlation structure of ARMA(p,q), as well?

[R] Plot with different x axis

2009-06-02 Thread Irina Foss
dear, I am trying to plot a standard plot, but I want the x axis to be 1,2,4,8,16 with equal intervals between them on plot. I will appreciate some help. Thank you, Irina Irina Foss Environmental Research Institute North Highland College UHI Millennium Institute Castle Street Thurso,

Re: [R] Problem downloading webpages using batchfiles and RCurl from command line in Vista Basic - couldn't connect to host

2009-06-02 Thread Tony Breyal
Hi Gabor, Thank you kindly for your response. Re: Don't need to set PATH -- When I read the batchfiles page, the opening paragraph says just place any or all of them anywhere in your Windows path and you will be able to access them in any Windows console session. My interpretation of this was

[R] Conducting data modelling on weighted data using R

2009-06-02 Thread Harding, Peter
Hello, I am starting to use R for various analyses, for example I use the ca package to do Correspondence Analysis. I am also looking to use packages such as: pls Partial Least Squares plspmPartial Least Squares Path Modelling However, although I can use packages such as these on

Re: [R] How to convert blanks to NA

2009-06-02 Thread John Kane
Does this do what you want x - data.frame(1, , 5) x[x==] - NA x where x is substituted for your 'data'? - Original Message From: Mark Na mtb...@gmail.com To: r-help@r-project.org Sent: Tuesday, June 2, 2009 3:14:00 PM Subject: [R] How to convert blanks to NA Hi R-helpers, I have

Re: [R] how to checking whether elements of a vector changed or not.

2009-06-02 Thread David Winsemius
Gabor; Did you perhaps get an undesired doubling of !? x1 -c(A, A, B, B, B, A) x1[2:length(x1)] == x1[1:(length(x1)-1)] [1] TRUE FALSE TRUE TRUE FALSE !!diff(c(factor(x1))) [1] FALSE TRUE FALSE FALSE TRUE (Your trick of computing differences of the underlying factor representation

[R] all.equal(0,0i)

2009-06-02 Thread Stavros Macrakis
all.equal(0,0i) [1] Modes: numeric, complex [2] target is numeric, current is complex all.equal(1,1+0i) [1] Modes: numeric, complex [2] target is numeric, current is complex Is this the intended behavior? In general, all.equal is strict about argument mode, thus TRUE/1 and 1/'1' do not

Re: [R] Error:non-numeric argument in my function

2009-06-02 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: I agree that it's inconsistent that 1:'2' -- 1:2 # this doesn't seem to be documented in ? seq 1+ '2' -- error 1+factor(2) -- NA (with a warning) 1 : factor(4) -- 1 (uses as.numeric/unclass of factor) ...i'd expect ...a successful

Re: [R] Still can't find missing data - How do I get NA in xtabs with factors?

2009-06-02 Thread Farley, Robert
The problem here is Table doesn't seem to have a way to weigh the data. ToyData Data1 Data2 Data3 Weight 101 Sam Red Banana1.1 102 Sam Green Banana2.1 103 Sam Blue Orange2.1 104 Fred Red Orange2.1 105 Fred Green Guava2.1 106 Fred Blue Guava2.1 107

[R] Return variable assignments from a function

2009-06-02 Thread Scott Hyde
I'd like to perform return variable assignments like matlab. For example, the following function would return A, B, and c to the script that called it. = function [A,B,c] = simple(m,n) A=[ 3 2; 3 3] B=m c=1:n = I'd like to do