; q1q2q3q4
> 1 . . check .
> 2 . 33.33 check35
> 3 33.33 check25 100
> 4 check . 100 check
> >
>
> Bill Venables.
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
&g
-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of David Winsemius
Sent: Tuesday, 15 March 2011 6:29 AM
To: andrija djurovic
Cc: r-help@r-project.org
Subject: Re: [R] data.frame transformation
On Mar 14, 2011, at 3:51 PM, andrija djurovic wrote:
> I would like t
David,
thank you very much. I changed little bit my code and now it works. The
magic word was stringsASfactor=FALSE and i didn't realize at the first
time.
Andrija
On Mon, Mar 14, 2011 at 9:28 PM, David Winsemius wrote:
>
> On Mar 14, 2011, at 3:51 PM, andrija djurovic wrote:
>
> I would like
On Mar 14, 2011, at 3:51 PM, andrija djurovic wrote:
I would like to hide cells with values less the 10%, so "." or just
"" doesn't make me any difference. Also I used apply combined with
as.character:
apply(df, 2, function(x) ifelse(as.character(x) < 10,".",x))
This is, probably not a goo
I would like to hide cells with values less the 10%, so "." or just ""
doesn't make me any difference. Also I used apply combined with
as.character:
apply(df, 2, function(x) ifelse(as.character(x) < 10,".",x))
This is, probably not a good solution, but it works except that I lose row
names and
On Mar 14, 2011, at 2:52 PM, andrija djurovic wrote:
Hi R users,
I have following data frame
df<-data.frame(q1=c(0,0,33.33,"check"),q2=c(0,33.33,"check",9.156),
q3=c("check","check",25,100),q4=c(7.123,35,100,"check"))
and i would like to replace every element that is less then 10
with . (d
Dear Andrija,
You could convert the factors to numeric class in order to test, get an index
of cells and then replace those. I wonder though if it wouldn't be easier to
do this at some step *before* the numbers are combined with strings?
At any rate, take a look at ?which ?factor ?as.numeric ?
Hi R users,
I have following data frame
df<-data.frame(q1=c(0,0,33.33,"check"),q2=c(0,33.33,"check",9.156),
q3=c("check","check",25,100),q4=c(7.123,35,100,"check"))
and i would like to replace every element that is less then 10 with . (dot)
in order to obtain this:
q1q2q3q4
1
hits=-2.6 tests=BAYES_00
X-USF-Spam-Flag: NO
Hi Christian,
Use the fact that 0 * lat[i] == 0 and 1 * lat[i] == lat[i], where lat[i]
is one of your lat values. Also use the fact that R is vectorized.
So we have:
grid.id<-c(1:4)
lat<-c(10,12,13,15)
species1<-c(0,0,0,1)
species2<-c(1,1,0,0)
specie
Christian
Try:
data.frame(data[,1:2], data[,3:5]*data[,2])
Peter Alspach
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Christian Hof
> Sent: Thursday, 31 January 2008 7:48 a.m.
> To: r-help@r-project.org
> Subje
Dear all,
maybe somebody can provide some help for this problem:
Example:
I've got the following dataframe "data":
grid.id<-c(1:4)
lat<-c(10,12,13,15)
species1<-c(0,0,0,1)
species2<-c(1,1,0,0)
species3<-c(1,1,1,1)
data<-data.frame(cbind(grid.id,lat,species1,species2,species3))
How can I, out of
11 matches
Mail list logo