Hi Mike and Gabor - thx for the help.
It seams I have made a mistake in my original question. While Mike's
solutions worked on the example data I provided, I now see my actual data is
> is(df100_lang$gray)
[1] "character" "vector" "data.frameRowLabels"
and the solution do
Try storing them as character strings rather than factors:
black_gray <- data.frame(black, gray, stringsAsFactors = FALSE)
Try this to view what you've got:
str(black_gray)
On Sun, May 24, 2009 at 7:15 AM, Andreas Christoffersen
wrote:
> Hi,
>
> In the example dataset below - how can I cahnge
This should work:
levels(black_gray$gray)[levels(black_gray$gray)=='gray20'] = 'blue'
On Sun, May 24, 2009 at 8:15 AM, Andreas Christoffersen
wrote:
> Hi,
>
> In the example dataset below - how can I cahnge "gray20", to "blue"
>
> # data
> black <- rep(c("black","red"),10)
> gray <- rep(c("gray1
Hi,
In the example dataset below - how can I cahnge "gray20", to "blue"
# data
black <- rep(c("black","red"),10)
gray <- rep(c("gray10","gray20"),10)
black_gray <- data.frame(black,gray)
# none of this desperate things works
# replace(black_gray$gray, gray=="gray20","red")
# if(black_gray$gray==
4 matches
Mail list logo