Hi Kai,
You seem to be asking the same question again and again. This does not
give us the warm feeling that you know what you want.
testdf<-data.frame(a=c("Negative","Positive","Neutral","Random","VUS"),
b=c("No","Yes","No","Maybe","Yes"),
c=c("Off","On","Off","Off","On"),
d=c("Bad","Good","Ba
Hello,
You don't need a loop, the R way is a vectorized solution and it's also
clearer.
Create a logical index (note only one &) and assign b, c, d where it's TRUE.
i <- try$a != "Positive" & try$a != "VUS"
try <- within(try, {
b[i] <- ''
c[i] <- ''
d[i] <- ''
})
Hope this helps,
Rui
Thanks. It seems that the differences I saw in some of my data points were
related to the number of digits and rounding.
Regards,
Mahmood
From: Bill Dunlap
Sent: Sunday, May 30, 2021 7:00:52 PM
To: Mahmood Naderan-Tahan
Cc: r-help@r-project.org
Subject: Re: [R]
Kai,
You have made a simple mistake. And now you cannot see it. I believe this is
not uncommon among programmers. It has happened to me more times than I want
to recall.
> On May 30, 2021, at 9:28 AM, Kai Yang via R-help wrote:
>
> Hello List,I have a data frame which having the character c
You didn't say how the values differed. If one in the plot is a rounded
version of the other then adding the ggpur::ggscatter() argument
cor.coeff.args=list(digits=7)
will fix things up.
-Bill
On Sun, May 30, 2021 at 9:18 AM Mahmood Naderan-Tahan <
mahmood.nade...@ugent.be> wrote:
> Hi
>
> M
Can you make R code that creates an actual sample data frame that looks like
you want the answer to look? say, just using the data.frame function and
literal strings. Oh, and read the Posting Guide... you need to send your email
using plain text format or it may get garbled when the list strips
Hello List,I have a data frame which having the character columns:
| a1 | b1 | c1 | d1 |
| a2 | b2 | c2 | d2 |
| a3 | b3 | c3 | d3 |
| a4 | b4 | c4 | d4 |
| a5 | b5 | c5 | d5 |
I need to do: if a1 not = "Positive" and not = "VUS" then values of b1, c1 and
d1 will be zero out. And do the same
Hi
Maybe this is not directly related to R, but I appreciate you can help me with
an idea. I use the following ggscatter function to plot a Pearson correlation
Coefficient and it works fine. In the chart I see both R-value and P-value.
ggscatter(mydata, x = "V1", y = "V2", add = "reg.line"
8 matches
Mail list logo