You need to store the values of each iteration in a vector, and then display
the vector after you the loop terminates. I made a few updates to your code,
and it seems to do what you want now.
And thanks for including the code. That made is easy to know how to help.
spectrum = c()
for(f in seq
Instead of a for loop, why not use the vectorization inherent in R?
sigmasqaured <- 1
i <- complex(real = 0, imaginary =1)
f <- seq(0,0.5,0.1)
spectrum
<-
(sigmasqaured)/(abs(1-2.7607*exp(2*pi*i*f)+3.8106*exp(4*pi*i*f)-2.6535*exp(6*pi*i*f)+0.9258*exp(8*pi*i*f))^2)
> spectrum
[1] 9.632720e+00 1.4
I have mad a for loop to try and output values which i have named spectrum.
However, I cannot seem to get the answers to come out as a vector which is what
i need. They come out as separate values which I am then unable to join
together. Thank you
for(f in seq(0,0.5,0.1)) {
sigmasqaure
conferences or
workshops for these datasets and their predictions, but they are not
available open source.
Can someone please help me with a link, or guide me where to look?
Thanks,
Hafsa
--
View this message in context:
http://r.789695.n4.nabble.com/R-help-need-help-in-obtaining-training-data-and
Thank you, Ista. It helps.
Best Regards
Umesh R
_
From: istaz...@gmail.com [mailto:istaz...@gmail.com] On Behalf Of Ista Zahn
Sent: Tuesday, March 22, 2011 8:58 AM
To: Umesh Rosyara
Cc: R mailing list
Subject: Re: [R] help need on working in subset within a dataframe
Hi
Hi Umesh,
I use the plyr package for this sort of thing:
library(plyr)
daply(dataframe, .(ped), myfun)
Best,
Ista
On Tue, Mar 22, 2011 at 3:48 AM, Umesh Rosyara wrote:
> Dear R-experts
>
> Execuse me for an easy question, but I need help, sorry for that.
>
> >From days I have been working with a
Dear R-experts
Execuse me for an easy question, but I need help, sorry for that.
>From days I have been working with a large dataset, where operations are
needed within a component of dataset. Here is my question:
I have big dataset where x1:.x1000 or so. What I need to do is to work
on 4
On 02/01/2011 07:31 AM, Megh Dal wrote:
> I need some help in defining a "print" method for my new S4 class
> definition. So fer I have worked like this:
>
> setClass("MyClass", sealed=F, representation(slot1 = "list",#create a
> new class
> slot2= "vector",
> s
I need some help in defining a "print" method for my new S4 class
definition. So fer I have worked like this:
setClass("MyClass", sealed=F, representation(slot1 = "list",#create a
new class
slot2= "vector",
slot3 = "vector",
slot4 = "vector"))
9 matches
Mail list logo