It was David's answer, not mine. Please ask him (and R-Help).
On Wed, Jul 10, 2019 at 7:01 PM Ana Marija wrote:
>
> do I have to update maybe any of the libraries show in attach?
>
> On Wed, Jul 10, 2019 at 6:01 PM Ana Marija
> wrote:
>>
>> Hi Patrick,
>>
>> do you refer to this?
>> https://git
Hi Patrick,
do you refer to this?
https://github.com/kenhanscombe/ukbtools/issues/20
I did it:
> devtools::install_github("kenhanscombe/ukbtools", build_vignettes = TRUE,
dependencies = TRUE,force=TRUE)
but still the same error:
> library(ukbtools)
> my_ukb_data <- ukb_df("ukb31212")
> ukb_icd_
On Wed, Jul 10, 2019 at 4:52 PM David Winsemius wrote:
>
> Did you read the bug report from three weeks ago and the suggested fix
> documented on the webpage you cited?
>
> —
> David
>
>
> Sent from my iPhone
>
> > On Jul 10, 2019, at 1:09 PM, Patrick (Malone Quantitative)
> > wrote:
> >
> > Fi
Hi Patrick,
can you please send me link to David's previous answer? I don't see it in
this thread.
Thanks
Ana
On Wed, Jul 10, 2019 at 5:17 PM Patrick (Malone Quantitative) <
mal...@malonequantitative.com> wrote:
> See David's answer about this specific issue . Also, always reply to list.
>
> On
See David's answer about this specific issue . Also, always reply to list.
On Wed, Jul 10, 2019, 6:08 PM Ana Marija
wrote:
> Hi Patrick,
>
> thanks for getting back to me, I tried that:
>
> > ukb_icd_diagnosis(my_ukb_data, eid = "117", icd.version = 10)
> Error in ukb_icd_diagnosis(my_ukb_da
Did you read the bug report from three weeks ago and the suggested fix
documented on the webpage you cited?
—
David
Sent from my iPhone
> On Jul 10, 2019, at 1:09 PM, Patrick (Malone Quantitative)
> wrote:
>
> First response: The ID column in your data is labeled "eid" but your
> function
First response: The ID column in your data is labeled "eid" but your
function call refers to "id".
On Wed, Jul 10, 2019 at 1:38 PM Ana Marija wrote:
>
> Hello,
>
> I am trying to use this program:
> https://github.com/kenhanscombe/ukbtools
>
> > my_ukb_data[1:3,1:3]
> eid sex_f31_0_0 year_
Hello,
I am trying to use this program:
https://github.com/kenhanscombe/ukbtools
> my_ukb_data[1:3,1:3]
eid sex_f31_0_0 year_of_birth_f34_0_0
1 117 Female 1938
2 125 Female 1951
3 138Male 1961
> ukb_icd_diagno
On 10/07/2019 11:54 a.m., Richard O'Keefe wrote:
Expectation: ifelse will use the same "repeat vectors to match the longest"
rule that other vectorised functions do. So
a <- 1:5
b <- c(2,3)
ifelse(a < 3, 1, b)
=> ifelse(T T F F F <<5>>, 1 <<1>>, 2 3 <<2>>)
=> ifelse(T T F F F <<5>>, 1 1 1 1 1 <<
On 7/10/19 5:54 PM, Richard O'Keefe wrote:
Expectation: ifelse will use the same "repeat vectors to match the longest"
rule that other vectorised functions do. So
a <- 1:5
b <- c(2,3)
ifelse(a < 3, 1, b)
=> ifelse(T T F F F <<5>>, 1 <<1>>, 2 3 <<2>>)
=> ifelse(T T F F F <<5>>, 1 1 1 1 1 <<5>>
Sigh. I don't agree with this "avoid ifelse because you might not know the
shape of the arguments" advice. All R variables have shapes and sizes, and the
better advice is to _pay attention to shapes and sizes_, especially when using
vectorized functions like ifelse. An easy way to maintain shape
Of course the behavior of ifelse is predictable.
My point was that for newb's (I was one once) you can get burned if you
don't appreciate that ifelse is vectorized.
Especially if you have some "muscle memory" from using ifelse() in Excel.
On Wed, Jul 10, 2019 at 6:55 PM Richard O'Keefe wrote:
>
Expectation: ifelse will use the same "repeat vectors to match the longest"
rule that other vectorised functions do. So
a <- 1:5
b <- c(2,3)
ifelse(a < 3, 1, b)
=> ifelse(T T F F F <<5>>, 1 <<1>>, 2 3 <<2>>)
=> ifelse(T T F F F <<5>>, 1 1 1 1 1 <<5>>, 2 3 2 3 2 <<5>>)
=> 1 1 2 3 2
and that is inde
The answer here is that in "ifelse(a < 3, ..)" you ALWAYS expect "a" to
be
a vector because there would be no point in using ifelse if it weren't.
If you believe that "a" is or ought to be a single number, you write
x <- if (a < 3) 1 else 2
The whole point of ifelse is to vectorise.
On Thu,
Or even
> a <- 1:5
> [lots of other code]
> x <- ifelse( a < 3, 1, 2)
The point (in this example) is that you might have introduced a bug because
you forgot that 'a' is a vector.
Looking (in isolation) at the assignment to 'x' you believe it's going to
be a single number, either 1 or 2 (unless you
For example, can you predict what the following code will do?
> a <- 1:5
> b <- c(2,3)
> ifelse( a < 3, 1, b)
On Wed, Jul 10, 2019 at 4:34 PM José María Mateos
wrote:
> On Wed, Jul 10, 2019, at 04:39, Eric Berger wrote:
> > 1. The ifelse() command is a bit tricky in R. Avoiding it is often a go
On Wed, Jul 10, 2019, at 04:39, Eric Berger wrote:
> 1. The ifelse() command is a bit tricky in R. Avoiding it is often a good
> policy.
You piqued my curiosity, can you elaborate a bit more on this?
--
José María (Chema) Mateos || https://rinzewind.org
_
Well, for example
> "a" + 2
Error in "a" + 2 : non-numeric argument to binary operator
On Wed, Jul 10, 2019 at 2:36 PM Tolulope Adeagbo
wrote:
> Dear All,
>
> Please what could be the cause of this error, I created a GUI with shiny R
> and it throws this error.
> But running it alone in R, it
Dear All,
Please what could be the cause of this error, I created a GUI with shiny R
and it throws this error.
But running it alone in R, its fine.
I just need to know what are the possible causes for this error.
Thanks for your assistance.
[[alternative HTML version deleted]]
_
Since this has already been answered, I'll just mention one point that was
not addressed.
> d=c(1,2,3,"-","dnr","post",10)
This is rather odd.
> str(d)
chr [1:7] "1" "2" "3" "-" "dnr" "post" "10"
You can create a vector of logical values, or a vector of numbers, or a
vector of strings,
but if ther
Hello Eric,
Thank you, it worked. both approach.
On Wed, Jul 10, 2019 at 2:09 PM Eric Berger wrote:
> Change the definition of de to
>
> de <- data.frame(d,e,stringsAsFactors=FALSE)
>
> Then you should be ok.
>
> Some additional remarks:
>
> 1. The ifelse() command is a bit tricky in R. Avoiding
Change the definition of de to
de <- data.frame(d,e,stringsAsFactors=FALSE)
Then you should be ok.
Some additional remarks:
1. The ifelse() command is a bit tricky in R. Avoiding it is often a good
policy.
2. I find %in% very useful. You could replace the multiple conditions check
de$d=="-
Hello all,
I am trying to run if else condition to alter my data. I have created a
column F with reference to column d where I want to replace the value to
0 where ever it finds a string or character value like -,dnr, post and
keep the rest of the rows should have the original value of column d.
23 matches
Mail list logo