Re: [R] Seeking implementation of my algorithm 'spdspds' - a novel algorithm for solving Linear Programming Problems with O(L^1.5) computational complexity

2020-06-11 Thread Abby Spurdle
> solving Linear Programming Problems with O(L^1.5) > computational complexity I'm not an expert on this topic. However, a quick glance at the topic suggests that these sorts of algorithms are usually exponential in "n", here the number of variables/dimensions. Apparently, "L" is the number of

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread Ana Marija
Thank you so much it is getting better (see attach) when I do: ggplot( data = tmp.tidy) +geom_point( aes(y = -log10(value),x = CHR,color=key) ,position = "jitter", size=0.5 ) is there is a way to have separation between every chromosome shown better and also every number of chromosome shown on

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread Ana Marija
I tried it, ggplot( data = tmp.tidy) +geom_point( aes(y = BP,x = CHR,color=key) ,position = "jitter" ) I got the attached On Thu, Jun 11, 2020 at 4:18 PM wrote: > > Try adding > position = "jitter" to the geom_point(... > > > > On 11 Jun 2020 21:41, Ana Marija wrote: > > Hello, > > I tried your

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread Ana Marija
Hello, I tried your code and this is what I got I really need two groups side by side shown per chromosome as it is here: https://imgur.com/a/pj40c on the image there are 4 groups I do have only two On Thu, Jun 11, 2020 at 11:52 AM wrote: > > On 2020-06-11 15:59, Ana Marija wrote: > > yes all

Re: [R-es] sir

2020-06-11 Thread Jose Betancourt B.
Estimados La pregunta es como agregar una line de cas os reales a la de prevalencia simulada? saludos Dr. Betancourt 2020-06-11 14:36 GMT-04:00, Jose Betancourt B. : > script completo y adjunto función > > > rm(list = ls(all = TRUE)) > require("sfsmisc") > source("sir_func.R") > npop = 4400 >

[R-es] sir

2020-06-11 Thread Jose Betancourt B.
script completo y adjunto función rm(list = ls(all = TRUE)) require("sfsmisc") source("sir_func.R") npop = 4400 I_0 = 1 R_0 = 0 S_0 = npop-I_0-R_0 tbegin = 0 tend = 300 vt = seq(tbegin,tend,1) gamma = 1/5 R0= 1.20 beta = R0*gamma vparameters = c(gamma=gamma,beta=beta) inits =

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread cpolwart
On 2020-06-11 15:59, Ana Marija wrote: yes all in one plot. So I want key (and therefore color)to be "Pold" and "Pnew" as those I am comparing per CHR so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) On the end x-axis would have two strikes of Pold and Pnew (different

Re: [R-es] excel

2020-06-11 Thread Carlos Ortega
Hola José, Tienes que incluir esa ruta donde quieres dejar el fichero en la línea de "saveWorkbook("... Así: #-- library(openxlsx) wb <- createWorkbook(creator = Sys.getenv("USERNAME")) addWorksheet(wb, "Data") pt$writeToExcelWorksheet(wb=wb, wsName="Data",

Re: [R] sqldf and number of records affected

2020-06-11 Thread Ravi Jeyaraman
You're correct. It does work. I was looking at some other result printed. My bad. Looks like we can also get the same result using 'SELECT changes()'. Approach 1: con <- data.frame(V1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) sqldf() suppressWarnings(sqldf(c(" update con set V1 = 0 where V1

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread Ana Marija
yes all in one plot. So I want key (and therefore color)to be "Pold" and "Pnew" as those I am comparing per CHR so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) On the end x-axis would have two strikes of Pold and Pnew (different colors) per one chromosome, and CHR would go

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Rasmus Liland
On 2020-06-10 10:20 +0200, Luigi Marongiu wrote: > I have been trying to convert European > short dates formatted as dd/mm/yy into the > ISO 8601 but the function as.Dates > interprets them as American ones > (mm/dd/yy) Dear Luigi, ?strptime says: ‘%D’ Date format such as

Re: [R] sqldf and number of records affected

2020-06-11 Thread Gabor Grothendieck
There is no real difference between your example and the example I provided. Both use a data.frame in R and both work for me under R 3.5 with RSQLite 2.2.0 See log below. Note that there is a bug in R 4.0 related to tcltk that could possibly affect sqldf as it uses tcltk. A fix has been

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Martin Maechler
> Rich Shepard > on Thu, 11 Jun 2020 06:29:13 -0700 writes: > On Thu, 11 Jun 2020, Martin Maechler wrote: >> > Look at Hadley Wickham's 'tidyverse' collection as > >> described in R for Data Science. There are date, >> datetime, > and time functions that will do just

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread cpolwart
On 2020-06-11 14:54, Ana Marija wrote: Hello, I expected it to look like this: https://imgur.com/a/pj40c Ah - so all on the one plot? - so you don't want a facet. It puts two plots side by side (or 22) where x-axis would be CHR, there is 22 of them unique(tmp.tidy$CHR) [1] 1 2 3 4

Re: [R] How to stack two Stack manhattan plots?

2020-06-11 Thread Ana Marija
Hello, I expected it to look like this: https://imgur.com/a/pj40c where x-axis would be CHR, there is 22 of them > unique(tmp.tidy$CHR) [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 I also have two phenotypes (keys) which I would like to compare > unique(tmp.tidy$key)

Re: [R] sqldf and number of records affected

2020-06-11 Thread Ravi Jeyaraman
Thanks for the response Gabor. Looks like the below example will work when using SQLite, but in my case I'm just creating a dataframe in R and trying to update it using sqldf as below and it doesn't seem to work ... con <- data.frame(V1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) sqldf()

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Rich Shepard
On Thu, 11 Jun 2020, Martin Maechler wrote: > Look at Hadley Wickham's 'tidyverse' collection as > described in R for Data Science. There are date, datetime, > and time functions that will do just what you want. I strongly disagree that automatic guessing of date format is a good

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Rich Shepard
On Thu, 11 Jun 2020, Richard O'Keefe wrote: I would add to this that in an important data set I was working with, most of the dates were dd/mm/yy but some of them were mm/dd/yy and that led to the realisation that I couldn't *tell* for about 40% of the dates which they were. If they were all

Re: [R] sqldf and number of records affected

2020-06-11 Thread Gabor Grothendieck
Here is an example. Ignore the warning or use the workaround discussed here https://github.com/ggrothendieck/sqldf/issues/40 to avoid the warning. library(sqldf) sqldf() # use same connection until next sqldf() sqldf(c("pragma count_changes = 1", "update BOD set demand = 99 where Time >

[R] sqldf and number of records affected

2020-06-11 Thread Ravi Jeyaraman
Hello all, When I execute a SQL using SQLDF, how do I get the number of records affected? I mean, if I run an UPDATE on a data frame, it doesn't tell me if and how many records got updated. I've read through the documentation and there don't seem to be a way to get this info unless it's done on

[R-es] excel

2020-06-11 Thread Jose Betancourt B.
Estimados NO ENCUENTRO EL FORMATO ADECUADO PARA SALVAR LA TABLA EXCEL EN OTRO LUGAR, por ejemplo, en escritorio library(pivottabler) pt <- PivotTable$new() pt$addData(bhmtrains) pt$addColumnDataGroups("TrainCategory") pt$addColumnDataGroups("PowerType") pt$addRowDataGroups("TOC")

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Richard O'Keefe
I would add to this that in an important data set I was working with, most of the dates were dd/mm/yy but some of them were mm/dd/yy and that led to the realisation that I couldn't *tell* for about 40% of the dates which they were. If they were all one or the other, no worries, but when you have

Re: [R] Seeking implementation of my algorithm 'spdspds' - a novel algorithm for solving Linear Programming Problems with O(L^1.5) computational complexity

2020-06-11 Thread jacob bogers
" not having any access to the resources " You have internet (as is proven by sending this email) you even have R cli these days on mobile (I do anyway). Learn R , code, let me know how it turns out On Wed, Jun 10, 2020 at 8:46 PM Keshava PRASADa Halemane < k.prasa...@gmail.com> wrote: >

Re: [R] How to convert European short dates to ISO format?

2020-06-11 Thread Martin Maechler
> Rich Shepard > on Wed, 10 Jun 2020 07:44:49 -0700 writes: > On Wed, 10 Jun 2020, Jeff Newmiller wrote: >> Fix your format specification? ?strptime >>> I have been trying to convert European short dates >>> formatted as dd/mm/yy into the ISO 8601 but the function

Re: [R] Seeking implementation of my algorithm 'spdspds' - a novel algorithm for solving Linear Programming Problems with O(L^1.5) computational complexity

2020-06-11 Thread Chris Evans
- Original Message - > From: "J C Nash" > To: "Keshava PRASADa Halemane" , r-help@r-project.org > Sent: Thursday, 11 June, 2020 01:00:29 > Subject: Re: [R] Seeking implementation of my algorithm 'spdspds' - a novel > algorithm for solving Linear Programming > Problems with O(L^1.5)