Re: [R] Potential R bug in identical

2019-01-17 Thread Layik Hama
Ivan, Thank you for digging into the string. I can confirm that the `hexdump` shows extra characters on bash, too. The question would then be: Why would `identical(str, "Accident_Index", ignore.case = TRUE)` behave differently on Linux/MacOS vs Windows? Thanks --- Layik Hama Research

[R] Fwd: Custom legend in ggplot - stat_summary shape and geom_bar fill

2019-01-17 Thread James Dare
Hi Everyone, I am spending far to much time on this problem. Every post I read gets me closer to a solution, but I am still not quite there. I am trying to create a bar plot similar to the one below: My code is as follows: q92

Re: [R] Colors on box plots in ggplot

2019-01-17 Thread Jeff Newmiller
I see you creating a variable p, evaluating and printing a modified version of that variable, and then printing that variable (presumably overwriting the first plot). Are you executing your code one line at a time when troubleshooting? On January 17, 2019 2:32:51 PM PST, David Doyle wrote:

[R] Colors on box plots in ggplot

2019-01-17 Thread David Doyle
Hello, I'm trying to set different boxes to different colors the following page shows http://www.sthda.com/english/wiki/ggplot2-box-plot-quick-start-guide-r-software-and-data-visualization I've tried the code ToothGrowth$dose <- as.factor(ToothGrowth$dose) head(ToothGrowth) library(ggplot2) #

Re: [R] Potential R bug in identical

2019-01-17 Thread Ivan Krylov
On Thu, 17 Jan 2019 21:05:07 + Layik Hama wrote: > Why would `identical(str, "Accident_Index", ignore.case = TRUE)` > behave differently on Linux/MacOS vs Windows? Because str is different from "Accident_Index" on Windows: it was decoded from bytes to characters according to different rules

[R] Thanks! Re: Kaplan-Meier plot

2019-01-17 Thread Medic
Bert Gunter: "Have you consulted ?plot.survfit ? " Marc Schwartz "The 'mark.time' argument for plot.survfit() is FALSE by default." Great thanks, Bert, for explanation in which documentation to view information! Thank you very much, Marc! Yes, specification required: plot (km, mark.time=TRUE)

Re: [R] Potential R bug in identical

2019-01-17 Thread Ivan Krylov
On Thu, 17 Jan 2019 14:55:18 + Layik Hama wrote: > There seems to be some weird and unidentifiable (to me) characters in > front of the `Accidents_Index` column name there causing the length > to be 17 rather than 14 characters. Repeating the reproduction steps described at the linked pull

Re: [R] Kaplan-Meier plot

2019-01-17 Thread Marc Schwartz via R-help
Hi, Just to emphasize Bert's e-mail with a hint, the 'mark.time' argument for plot.survfit() is FALSE by default. Regards, Marc Schwartz > On Jan 17, 2019, at 2:45 PM, Bert Gunter wrote: > > Have you consulted ?plot.survfit ? There are examples for KM plots there. > > Also, obvious

[R] Potential R bug in identical

2019-01-17 Thread Layik Hama
Hi, My first email to r-help and as I am not sure about the issue, I wanted to ask for help first. The comments under this thread outline a particular string from a dataset which seems to be read by R on Windows differently to Linux and MacOS and

Re: [R] Kaplan-Meier plot

2019-01-17 Thread Bert Gunter
Have you consulted ?plot.survfit ? There are examples for KM plots there. Also, obvious question: Have you specfied the censoring properly in your data and fit? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka

[R] Kaplan-Meier plot

2019-01-17 Thread Medic
According to the guidelines (if I'm not mistaken), the code below is sufficient (without any specification) to give Kaplan-Meier curves with censored data markings on Kaplan-Meier curves. But in my case censored data don't appears on the curves?! library(survival) mydata<-read.csv

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread ProfJCNash
As one of the approximately 30 names on the 1985 IEEE 754 standard, I should be first to comment about representations. However, a quite large fraction of the computers I've owned or used were decimal beasts. This doesn't remove all the issues, of course, but some of these input-output conversions

Re: [R] R: estimating genotyping error rate

2019-01-17 Thread Jeff Newmiller
I would say that you may well be asking the wrong question in the right mailing list. Your discipline-specific jargon is impeding communication... you need to know what specific steps you want to take using R. A good reason to start your line of questioning on the Bioconductor forum is that

Re: [R] R: estimating genotyping error rate

2019-01-17 Thread Bert Gunter
"How can I proceed?" -- By doing your own homework about appropriate methodology and software instead of asking others to do it for you. -- and by posting as necessary on the appropriate website, which is most likely Bioconductor Help, not here. Bert Gunter "The trouble with having an open

[R] R: estimating genotyping error rate

2019-01-17 Thread N Meriam
Hello, I have SNP data from genotyping. I would like to estimate the error rate between replicated samples using R. How can I proceed? Thanks Meriam __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread peter dalgaard
> On 17 Jan 2019, at 15:56 , POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS > FOUNDATION TRUST) via R-help wrote: > > Well I get the issue with finite precision. As in SQRT(2) * SQRT(2) is not 2. As Jeff indicates, you also need to get that just like 3rds and 7ths cannot be represented

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread Jeff Newmiller
... then you still don't understand. Perhaps you might find [1] helpful. Also, adding a floating point representation of 0.001 to 1.4 for 400 times does not yield the same approximation of 1.8 that you get by directly converting the string "1.8" that you typed into your R interpreter. [1]

Re: [R] importing data error question

2019-01-17 Thread Fox, John
Dear Jihee, Your latest attempt has gotten farther than the previous one but has produced a different error. The command to read the data set was generated properly. You can see whether the data set was in fact read by typing prestige (the name you gave to the data set) at the > command prompt

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) via R-help
Well I get the issue with finite precision. As in SQRT(2) * SQRT(2) is not 2. What surprised me was that seq(1.4, 2.1, by=0.001) starts at 1.3999 and not 1.4! -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: 17 January 2019 14:30 To: POLWART, Calum

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread PIKAL Petr
Hi It is not seq problem, it is floating point numbers representation in finit precision problem. Ben pointed to it and you could learn about it from FAQ 7.31. Cheers Petr > -Original Message- > From: POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS > FOUNDATION TRUST) > Sent:

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) via R-help
Thanks guys. I've used Petr's method and its working for me. If the data had been from a calculation I'd have rounded it... just didn't expect seq to break it! C -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: 17 January 2019 13:53 To: Ben Tupper; POLWART,

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread PIKAL Petr
Hi Or you could use rounding. which(round(lut, 3)==1.8) [1] 401 Cheers Petr > -Original Message- > From: R-help On Behalf Of Ben Tupper > Sent: Thursday, January 17, 2019 2:43 PM > To: POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS > FOUNDATION TRUST) > Cc: r-help@r-project.org >

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread Ben Tupper
Hi, This looks like a floating point reality bump - see https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f You can use other methods to finding

[R] I can't get seq to behave how I think it should

2019-01-17 Thread POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) via R-help
I am using seq with the expression seq(1.4, 2.1, by=0.001) to create a sequence of references from 1.4 to 2.1 in 0.001 increments. They appear to be created correctly. They have a related pair of data which for the purposes of this we will call val. I'm interested in the content on the row

[R] RW: Banner using R (Alexandros Kouretsis)

2019-01-17 Thread Alexandros Kouretsis
This might be slightly tricky. You can use factor levels and table to take into account that B is missing from the third column. Just introducing dplyr library for piping. library(dplyr) Data <- data.frame(v1 = c('A', 'B' ,'B' ,'A', 'B'), v2 = c('A', 'B', 'A', 'A', 'B'), v3 = c('A', 'A', 'A',

Re: [R-es] optimizacion costos

2019-01-17 Thread Javier Marcuzzi
Estimados Encontré un ejemplo que se aproxima a mi pregunta, lo copio y pego para compartirlo. Lo primero como para comentar es la facilidad de R respecto a python y tensorflow, aunque estos podrían utilizar una cantidad de 1000 computadoras con GPU gratuitas para entrenamiento del modelo. Lo

Re: [R] create groups from data with duplicates, such that each group has a duplicate represented once

2019-01-17 Thread Kevin Wamae
Dear Petr, thank you for the guidance. A colleague managed to solve it I'll definitely use "dput" for future postings. Regards -- Kevin Wamae On 17/01/2019, 03:57, "PIKAL Petr" wrote: Hi Instead of attachment which is usually removed you should use dput

Re: [R] create groups from data with duplicates, such that each group has a duplicate represented once

2019-01-17 Thread PIKAL Petr
Hi Instead of attachment which is usually removed you should use dput Something like output from dput(head(yourdata,30)) To remove duplicate values see unique or duplicated Cheers Petr > -Original Message- > From: R-help On Behalf Of Kevin Wamae > Sent: Thursday, January 17, 2019