> "ycw" == ying chen wang
> on Mon, 26 Jul 2010 17:10:24 -0400 writes:
ycw> Yes, thanks. Just found out the solution. Thanks for the help.
ycw> Just started R. Not familiar with its environment.
ycw> G
ycw> On Mon, Jul 26, 2010 at 5:08 PM, jim holtman
wrote:
>
Yes, thanks. Just found out the solution. Thanks for the help.
Just started R. Not familiar with its environment.
G
On Mon, Jul 26, 2010 at 5:08 PM, jim holtman wrote:
> Is this what you want:
>
> > equated<-c(111.0,112.06, 112.9, 113.8, 115.0, 116.2, 117.0, 118.0, 120.5,
> + 120.5, 120.5)
> >
Thanks, it works. I found out the solution a moment ago. The 2nd one works.
But, the weird thing is that if I use 'x', it works. If I use 'equated', it
didn't work. Not sure why.
Thanks again.
G
On Mon, Jul 26, 2010 at 5:04 PM, Joshua Wiley wrote:
> What about these two options?
>
> #One way
>
What about these two options?
#One way
ifelse(equated > 120, 120, equated)
#Another way
equated[equated > 120] <- 120
HTH,
Josh
On Mon, Jul 26, 2010 at 10:26 AM, ying_chen wang
wrote:
> I am new to R. Used to use FORTRAN. R is so different from FORTRAN. The
> following codes would work in FOT
On Mon, Jul 26, 2010 at 2:06 PM, ying_chen wang
wrote:
> Thanks, it works. I found out the solution a moment ago. The 2nd one works.
>
> But, the weird thing is that if I use 'x', it works. If I use 'equated', it
> didn't work. Not sure why.
What is 'x' ?
>
> Thanks again.
>
> G
>
> On Mon, Jul
Is this what you want:
> equated<-c(111.0,112.06, 112.9, 113.8, 115.0, 116.2, 117.0, 118.0, 120.5,
+ 120.5, 120.5)
> equated[equated > 120] <- 120
> equated
[1] 111.00 112.06 112.90 113.80 115.00 116.20 117.00 118.00 120.00
120.00 120.00
>
You should read up on 'indexing' in the R Intro paper.
6 matches
Mail list logo