Hello,
The following strategy works with your data.
It uses the fact that most dates are in one of 3 formats, dmy, mdy, ymd.
It tries those formats one by one, after each try looks for NA's in the
new column.
# first round, format is dmy
DFX$dnew <- lubridate::dmy(DFX$ddate)
na <- is.na(DFX$d
Hi All,
I have a data frame where one column is a mixed date format,
a date in the form "%m-%d-%y" and "%m/%d/%Y", also some are not in date format.
Is there a way to delete the rows that contain non-dates and
standardize the dates in one date format like %m-%d-%Y?
Please see my sample data
As a follow-up to Michael's post, here is a link to some advice on how
create the example.
/http://adv-r.had.co.nz/Reproducibility.html "> How to write a
reproducible example
On Mon, 20 Jan 2020 at 08:49, Michael Dewey wrote:
> Your script and data were stripped so we are none the wiser I am a
Per the Posting Guide... stop sending HTML-formatted email to this mailing
list. The formatting gets stripped out anyway and introduces confusion. Gmail
_has_ this option, but you must specify it before you send the email.
Also, try to use Reply-all when discussing the same topic to keep related
Per the Posting Guide... stop sending HTML-formatted email to this mailing
list. The formatting gets stripped out anyway and introduces confusion. Gmail
_has_ this option, but you must specify it before you send the email.
Also, try to use Reply-all when discussing the same topic to keep related
Hello,
The function I included converts signed binary numbers into their
decimal representation. They are negative if a) they are multiples of 8
bits and b) the most significant bit is a "1". If not just convert to
integer.
As for a) above, I assume that you will have 8 bit numbers. And the
Dear Rui,
Based on the rules given in the link below, I want to transform the binary
numbers into latitude and longitude coordinates (in degrees and minutes),
so that is basically what I am trying to accomplish. The first integer
gives the sign (positive or negative) of the number, and the rest n-
Example of conversion to decimal of a signed binary number in two's
complement representation
Let's convert to decimal the following signed binary number: 10110010
10110010 = -1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 0×20 = -128 +
32 + 16 + 2 = -78.
that operation ilvoves base 2 raised to
Dear friend Rui,
Hope you are doing great, thanks for your kind feedback. The challenge I
currently have at hand is to decode AIS messages and obtain latitude and
longitude values from those.
So basically, I want to accomplish something like in the example below. I
want to convert this binary num
Dear James
Your question really boil down to whether you can estimate tau^2, the
between study variance of the effect sizes, if you only have p-values.
As far as I can see the answer has to be no.
Michael
On 16/01/2020 13:10, james poweraid wrote:
Hello,
I have a set of Z scores from an N=
Your script and data were stripped so we are none the wiser I am afraid.
You need to embed the script in your post and give a minimal data-set
which exhibits the problem using dput() and embed that in the post too.
Michael
On 19/01/2020 08:25, Atul Saini wrote:
Hello R,
I am att
Dear list users,
I need some guidelines to run a conditional logistic regression with
fixed effects.
Let me give you some background.
I have a survey where each respondent is asked the same question once
a year for three consecutive years. There is no apriori on the extent
to which choice at time
Hi
> On 17 Jan 2020, at 08:33, Sigbert Klinke wrote:
>
> Hi,
>
> I wrote a function like
>
> test <- function(FUN, args) {
> print(FUN)
> FUN(args)
> }
>
> When I call it lieke this
>
> test(mean, 1:10)
> test(NULL, 1:10)
>
> then the second call still uses mean, although I set FUN to NUL
Hello,
I have a set of Z scores from an N=2 studies and I need to run a
meta-analysis across the two Z scores for many N variables. I do not have
effect sizes and SEs. I realize there are many different meta analysis
packages in R, but I only have Z scores and it seems to me this is
limiting. I am
Hello R,
I am attaching the script and data please help me to solve the
problem of
"In sqrt(VS) : NaNs produced" with the p value of dumy$Mar
Regards,
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.c
Sorry, missunderstood the problem.
Here it goes:
fun <- function(x){
res <- sapply(x, function(y){
if(nchar(y) %% 8 != 0 || substr(y, 1, 1) == "0"){
strtoi(y, base = 2)
}else{
y <- unlist(strsplit(y, ""))
-sum((y != "1")*2^((length(y) - 1):0)) - 1
}
})
unname(r
Hello,
Is this what you want?
x <- "10110010"
strtoi(x, base = 2)
#[1] 178
Hope this helps,
Rui Barradas
Às 16:31 de 16/01/20, Paul Bernal escreveu:
Dear friends,
How can I convert the following binary number in two´s complement
representation in R?
10110010
Any help and/or guidance wil
> u <- list(a=1:5, b=letters[1:3])
> u
# $a
# [1] 1 2 3 4 5
#
# $b
# [1] "a" "b" "c"
> u[["a"]]
[1] 1 2 3 4 5
On Thu, Jan 16, 2020 at 1:04 PM Faheem Jan via R-help
wrote:
> Hi. How to extract a column from the list.. I will be thanks full..
>
> Sent from Yahoo Mail on Android
> [[alt
I have had success using the fromJSON() function in the rjson package.
On Thu, Jan 16, 2020 at 4:22 PM Ioanna Ioannou wrote:
> hello everyone,
>
> and happy new year!
>
> I have this problem: I want to save the name of the 'countries', the
> 'taxonomy_gem' and the 'minimum_im' and 'maximum_im' .
Dear friends,
How can I convert the following binary number in two´s complement
representation in R?
10110010
Any help and/or guidance will be greatly appreciated,
Best regards,
Paul
[[alternative HTML version deleted]]
__
R-help@r-project.
Hello,
my code used to work and now I am getting this error which does not
display my annotation
df <- data.frame("prop" = c(102.73,260.65), "Name" = c("All Genes \n
31385","Glucose Response Genes \n 103"))
p <- ggplot(data = df, aes(x = Name, y = prop, fill = Name)) +
geom_bar(stat = "ident
Hello,
I have a code like this:
p <- ggplot(data = df, aes(x = Name, y = prop, fill = Name)) +
geom_bar(stat = "identity") +
labs(x = "", y = "EQTL / gene") +
scale_fill_brewer(palette="Greens",name = "Number of cis EQTL") +
theme(legend.position = "none")
p
which produces the attached pl
Hi Ioanna,
Assuming your input file is named "ii.json" and contains the text in
your original post:
library(jsonlite)
a2<-fromJSON("ii.json",flatten=TRUE)
a2$fields$geo_applicability$fields$countries[,"fields.name"]
You can find this yourself by progressively checking names and
extracting until
I tried doing this but it didn't help
p <- ggplot(data = df, aes(x = Name, y = prop, fill = Name)) +
geom_bar(stat = "identity") +
labs(x = "", y = "EQTL / gene") +
scale_fill_brewer(palette="Greens",name = "Number of cis EQTL") +
theme_classic()+
theme(panel.grid.major.x = element_lin
Normally one uses match.fun to avoid such problems.
This will give the error shown even if FUN is defined in the global environment.
test <- function(FUN, args) {
FUN <- match.fun(FUN)
print(FUN)
FUN(args)
}
test(NULL, 1:10)
## Error in match.fun(FUN) : 'NULL' is not a fun
Trickier, but shorter:
> lapply(u,'[',1)
$a
[1] 1
$b
[1] "a"
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Jan 17, 2020 at 10:04 PM Eric Berger wrote:
In your example, these keys occur
1 countries
1 maximum_im
1 minimum_im
61 name
66 pk -- many of these pertain to countries, some do not
1 taxonomy_gem
It is not clear what you mean by 'the name of the countries'.
There appear to be 61 countries each with two 'names'
27 matches
Mail list logo