Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-14 Thread Luigi Marongiu
Thank you! On Fri, Jun 13, 2025 at 1:14 PM Rui Barradas wrote: > > Às 07:41 de 13/06/2025, Luigi Marongiu escreveu: > > Thank you, facets are good but I was looking for something that could > > merge everything in a single plot. I found that I could create an > > additional column, say M (merge),

Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-13 Thread Rui Barradas
Às 07:41 de 13/06/2025, Luigi Marongiu escreveu: Thank you, facets are good but I was looking for something that could merge everything in a single plot. I found that I could create an additional column, say M (merge), that accommodates two parameters into one, for instance, `a + A`, `a + B` etc.

Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-12 Thread Luigi Marongiu
Thank you, facets are good but I was looking for something that could merge everything in a single plot. I found that I could create an additional column, say M (merge), that accommodates two parameters into one, for instance, `a + A`, `a + B` etc. By grouping for M, I can kind of stratify the data

Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-08 Thread Rui Barradas
Às 07:21 de 08/06/2025, Luigi Marongiu escreveu: I would like to plot multivariate data with ggplot2. I have multiple groups that I need to account for: I have the `x` and `y` values, but the data must be stratified also by `w` and `z`. I can group by either `w` or `z`, but how can I group for bo

Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-08 Thread Jeff Newmiller via R-help
You can use group=interaction(w,z)... but in my experience that gets confusing for the poor person trying to make sense of the plot. It is better to use color=w, linetype=z or use facets for one of the grouping variables. On June 7, 2025 11:21:32 PM PDT, Luigi Marongiu wrote: >I would like to

[R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-07 Thread Luigi Marongiu
I would like to plot multivariate data with ggplot2. I have multiple groups that I need to account for: I have the `x` and `y` values, but the data must be stratified also by `w` and `z`. I can group by either `w` or `z`, but how can I group for both simultaneously? In essence, in the example below

Re: [R] how to read a PSB file in R?

2025-05-27 Thread Duncan Murdoch
On 2025-05-26 11:49 a.m., Ranjan Maitra via R-help wrote: I wanted to mention that after posting on the ImageMagick discussion board on github, I learnt that the restriction does not hold for converting to PNG (but for JPG) so I was able to convert it. However, I am not able to read the file

Re: [R] how to read a PSB file in R?

2025-05-27 Thread Ranjan Maitra via R-help
On Tue May20'25 12:15:41AM, Ranjan Maitra via R-help wrote: > From: Ranjan Maitra via R-help > Date: Tue, 20 May 2025 00:15:41 -0500 > To: r-help@r-project.org > Reply-To: Ranjan Maitra > Subject: Re: [R] how to read a PSB file in R? > > On Tue May20'25 05:56:59A

Re: [R] how to read a PSB file in R?

2025-05-26 Thread Ranjan Maitra via R-help
On Tue May20'25 12:15:41AM, Ranjan Maitra via R-help wrote: > From: Ranjan Maitra via R-help > Date: Tue, 20 May 2025 00:15:41 -0500 > To: r-help@r-project.org > Reply-To: Ranjan Maitra > Subject: Re: [R] how to read a PSB file in R? > > On Tue May20'25 05:56:59A

Re: [R] how to read a PSB file in R?

2025-05-19 Thread Ranjan Maitra via R-help
On Tue May20'25 05:56:59AM, Rui Barradas wrote: > From: Rui Barradas > Date: Tue, 20 May 2025 05:56:59 +0100 > To: Ranjan Maitra , r-help@r-project.org > Subject: Re: [R] how to read a PSB file in R? > > Às 03:17 de 20/05/2025, Ranjan Maitra via R-help escreveu: > >

Re: [R] how to read a PSB file in R?

2025-05-19 Thread Rui Barradas
Às 03:17 de 20/05/2025, Ranjan Maitra via R-help escreveu: I have come across this file (warning, massive, 4.3 GB) https://esahubble.org/media/archives/images/original/heic1502a.psb and it appears to be a filetype I was not aware of previously. Is it possible to read the file in R using any t

Re: [R] how to read a PSB file in R?

2025-05-19 Thread Thomas Adams
Please look here: https://www.lifewire.com/psb-file-2622193 On Mon, May 19, 2025 at 10:18 PM Ranjan Maitra via R-help < r-help@r-project.org> wrote: > I have come across this file (warning, massive, 4.3 GB) > https://esahubble.org/media/archives/images/original/heic1502a.psb and it > appears to b

[R] how to read a PSB file in R?

2025-05-19 Thread Ranjan Maitra via R-help
I have come across this file (warning, massive, 4.3 GB) https://esahubble.org/media/archives/images/original/heic1502a.psb and it appears to be a filetype I was not aware of previously. Is it possible to read the file in R using any tool? It is an image and I am looking for the RGB of the file

Re: [R] How to get the same result for GA optimization?

2025-05-07 Thread Daniel Lobo
Hi, Before calling the second ga, I am just altering the columns of dat except the first column Dat = Dat[, c(1, 1 + sample(1:30, 30, replace = F))] With that, I expect the positions of the elements of x will be changed, but objective function should return the same value, same for ga. Below is

Re: [R] How to get the same result for GA optimization?

2025-05-07 Thread Michael Dewey
Dear Daniel As far as I can see you have re-generated the data before calling ga() so the data is not just a permutation of the first set. Michael On 07/05/2025 15:36, Daniel Lobo wrote: I am using *Genetic Algorithm* to maximize some function which use data. I use GA package in R for this

[R] How to get the same result for GA optimization?

2025-05-07 Thread Daniel Lobo
I am using *Genetic Algorithm* to maximize some function which use data. I use GA package in R for this ( https://cran.r-project.org/web/packages/GA/index.html) Below is my code library(GA) set.seed(1) Dat = data.frame(rnorm(1000), matrix(rnorm(1000 * 30), nc = 30)) Fitness_Fn = function(x) {

Re: [R] How to find inverse of glm model?

2025-04-24 Thread Gregg Powell via R-help
Luigi, Your diagnostic steps for estimating Min, Max, and HalfFluoCycle look spot-on. You correctly identified that your linear model gave an unreasonably large slope (SLP = 57,724), which likely caused the nls() convergence failure in mod1. Makes sense that fixing the slope at 2 gave you a sta

Re: [R] How to find inverse of glm model?

2025-04-24 Thread Luigi Marongiu
Thank you. Following your tips I tried to guess the starting values using an approached that determined (1) the background level (the fluorescence before the take over signal), (2) the slope between this point and the maximum: ``` df <- data.frame(Cycle=1:35, Fluo=c(15908.54, 16246.9

Re: [R] How to find inverse of glm model?

2025-04-23 Thread Gregg Powell via R-help
Hello Luigi, Great follow-up — Looks like you’re on the right track using nls() for nonlinear regression. You're fitting a logistic-like sigmoidal model (as in Rutledge’s paper), I think both errors you’re encountering are signs of bad starting values or a maybe model formulation issue. Breakd

Re: [R] How to find inverse of glm model?

2025-04-23 Thread Luigi Marongiu
Further on this, I have found a formula from a paper from Rutledge (DOI: 10.1093/nar/gnh177), which I rendered as ``` MaxFluo / (1+ exp(-(Cycle-(HalfFluoCycle/Slope + backgroundSignal ``` I then see that one can use `nls` to fit non-linear regression, so I tried: ```df <- data.frame(Cycle=1:35,

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Luigi Marongiu
Thank you. This topic is more complicated than anticipated. Best regards, Luigi On Tue, Apr 15, 2025 at 11:09 PM Andrew Robinson wrote: > > A statistical (off-topic!) point to consider: when the GLM was fitted, you > conditioned on x and let y be the random variable. Therefore the model > suppo

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Andrew Robinson via R-help
A statistical (off-topic!) point to consider: when the GLM was fitted, you conditioned on x and let y be the random variable. Therefore the model supports predictions of y conditional on x. You’re now seeking to make predictions of x conditional on y. That’s not the same thing, even in OLS. It

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Gregg Powell via R-help
Take a look at this Luigi... ># The model is: logit(p) = β₀ + β₁*Cycles ># Where p is the probability (or normalized value in your case) > ># The inverse function would be: Cycles = (logit⁻¹(p) - β₀)/β₁ ># Where logit⁻¹ is the inverse logit function (also called the expit >function) > ># Extract

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Ben Bolker
If you mean the *link function*, which translates from the data scale to the linear predictor scale, you can get it via b_model$family$linkfun If you want the cycles at which the signal is equal to 0.5, eta <- b_model$family$linkfun(0.5) with(as.list(coef(b_model)), (eta-`(Intercept)`)/Cycle

[R] How to find inverse of glm model?

2025-04-15 Thread Luigi Marongiu
I have fitted a glm model to some data; how can I find the inverse function of this model? Since I don't know the y=f(x) implemented by glm (this works under the hood), I can't define a f⁻¹(y). Is there an R function that can find the inverse of a glm model? Thank you. The working example is: ```

Re: [R] How to predict intersection value between regression and line in R?

2025-04-12 Thread Luigi Marongiu
Thank you. Sorry for the cyc variable, I simplified in 35 in the first call but not in the second. The actual value would be ``` df = data.frame(Cycles = 1:35, Values = val[1:35) ``` I'll try your suggestion. Best regards On Fri, Apr 11, 2025 at 8:05 PM Duncan Murdoch wrote: > > Your example does

Re: [R] How to predict intersection value between regression and line in R?

2025-04-11 Thread Duncan Murdoch
Your example doesn't run because it uses a variable `cyc` which you didn't include. But in general, I think you are mixing up two separate problems here. The first problem is creating a function of x (which is Cycles in your dataset). You used the predictions from a glm() to do this. That's

[R] How to predict intersection value between regression and line in R?

2025-04-11 Thread Luigi Marongiu
I am trying to predict the intersection value between a curve and a line. I can fit a logistic model to the data by converting the data to the range 0-1. How can I determine the intersection with a line? Also, is there a way to do the same without converting the data? Here is an example: ``` val =

[R] How to find quantitative cycle PCR with R?

2025-04-08 Thread Luigi Marongiu
Hello, I would like to analyze quantitative PCR (qPCR) data using R rather than proprietary softwares. I can see there are several packages out there, but mostly they perform relative quantification, while none provide a quantitative cycle (Cq), or crossing over cycle. Is there a package that can p

Re: [R] how to create model matrix of second order terms

2025-04-05 Thread Ben Bolker
I'm still not entirely clear what you want, in particular what you want to with factor variables ('squaring' them doesn't really seem to make sense). Some combination of sprintf/paste/reformulate might do what you want: ## get all second-order terms (doesn't square numeric values) quad_terms

Re: [R] how to create model matrix of second order terms

2025-04-05 Thread Ebert,Timothy Aaron
mula(paste("y ~", paste(result, collapse = " + "))) model <- lda(formula, data = mydata) Tim -Original Message- From: R-help On Behalf Of Stephen Bond via R-help Sent: Monday, March 24, 2025 11:29 AM To: Bert Gunter Cc: r-help@r-project.org Subject: Re: [R] how to create

Re: [R] how to create model matrix of second order terms

2025-03-25 Thread Stephen Bond via R-help
@ Rui that is the idea, but how do I apply this to a matrix with 200 columns? I cannot write out the expression.  The colnames seem very messy, but they would be messy even under my scheme with as little as 100 vars. On Tue, 2025-03-25 at 06:15 +, Rui Barradas wrote: > Às 15:28 de 24/03/2025,

Re: [R] how to create model matrix of second order terms

2025-03-25 Thread Rui Barradas
Hello, Sorry, much simpler: poly(as.matrix(X), degree = 2L) Hope this helps, Rui Barradas Às 13:58 de 25/03/2025, Rui Barradas escreveu: Hello, This seems to work and is independent of the number of columns. 'p' is the output in my previous post. f <- function(x, data = X) with(data,

Re: [R] how to create model matrix of second order terms

2025-03-25 Thread Rui Barradas
Hello, This seems to work and is independent of the number of columns. 'p' is the output in my previous post. f <- function(x, data = X) with(data, eval(parse(text = x))) p2 <- poly(sapply(names(X), f), degree = 2L) identical(p, p2) # [1] TRUE Hope this helps, Rui Barradas Às 13:42 de 2

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Rui Barradas
Às 15:28 de 24/03/2025, Stephen Bond via R-help escreveu: Folks, I appreciate your effort, but maybe I was not explicit enough, so let me try again. The current setup for formulas does not allow for I(x^2) terms as explained in the MASS book at the end of Section 6.2 the x:x interaction is trea

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
Folks, I appreciate your effort, but maybe I was not explicit enough, so let me try again. The current setup for formulas does not allow for I(x^2) terms as explained in the MASS book at the end of Section 6.2 the x:x interaction is treated as x. So I need to write my own code, which is clumsy u

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Bert Gunter
Full disclosure: I did not attempt to decipher your code. But ~(A+B +C)^2 - (A + B + C) gives all 2nd order interactions whether the terms are factors or numeric. ~I(A^2) + I(B^2) gives quadratics in A and B, which must be numeric, not factors, of course You can combine these as necessary to get

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Daniel Nordlund
Depending on what your ultimate goal is, you could use something like want <- model.matrix(  ~ (a + b + c + d)^2 , data=your_data) This will create a matrix with the appropriate main effects and first order interactions.  If you just want to run a simple regression, you could do it directly

[R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
I am sending to this forum as stackoverflow has devolved into sth pretty bad. Below code shows how to get what I want in a clumsy way. cols <- letters[1:4] a1 <- outer(cols,cols,paste0) b1 <- a1[!lower.tri(a1)] X <- matrix(rnorm(80),ncol=4) colnames(X) <- cols X <- as.data.frame(X) XX <- matrix(0

Re: [R] How to customize legend labels in ggplot2?

2025-03-13 Thread Luigi Marongiu
Thank you, that is exactly was I was looking for. On Thu, Mar 13, 2025 at 8:16 AM Rui Barradas wrote: > > Hello, > > Inline. > > Às 05:19 de 13/03/2025, Luigi Marongiu escreveu: > > Thank you, but then I will have long labels also on the axis, > > > I am not getting the same legend labels and axi

Re: [R] How to customize legend labels in ggplot2?

2025-03-12 Thread Luigi Marongiu
Thank you, but then I will have long labels also on the axis, making the plot too crowded. I would like instead to force the long labels only on the legend... On Wed, 12 Mar 2025, 12:47 Rui Barradas, wrote: > Às 10:35 de 12/03/2025, Luigi Marongiu escreveu: > > I have a data frame with measureme

Re: [R] How to customize legend labels in ggplot2?

2025-03-12 Thread Rui Barradas
Às 10:35 de 12/03/2025, Luigi Marongiu escreveu: I have a data frame with measurements in different conditions. I set the conditions as a factor using a notation for ease of use. I now want to plot the data and assign meaningful labels to the factors. I am using ggplot2; for the x axis I would li

Re: [R] How to customize legend labels in ggplot2?

2025-03-12 Thread Thierry Onkelinx
Dear Luigi, ggplot2 will use the factor levels as default values for the legend labels. Setting the factor labels of your target values fixes your problem. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDE

[R] How to customize legend labels in ggplot2?

2025-03-12 Thread Luigi Marongiu
I have a data frame with measurements in different conditions. I set the conditions as a factor using a notation for ease of use. I now want to plot the data and assign meaningful labels to the factors. I am using ggplot2; for the x axis I would like to keep the factors but in the legend I would li

Re: [R] How to specify a quadratic term in the contrast function

2025-02-18 Thread Kevin Thorpe
I don’t know if this will make a difference, but I believe it is generally preferred to use the poly() function (for lm()/glm()) or the pol() function (for rms functions) to include the quadratic (and higher order terms). Kevin > On Feb 18, 2025, at 12:23 PM, Ben Bolker wrote: > > Looking a

Re: [R] How to specify a quadratic term in the contrast function

2025-02-18 Thread Ben Bolker
Looking at the 'contrasts' function, it seems to be imported from 'rms' and to take only 'rms'-type fits (which are different from base-R [g]lm() fits) as input. I'm not sure exactly what contrasts you're trying to generate, but I would probably use the emmeans package for the task, since

[R] How to specify a quadratic term in the contrast function

2025-02-18 Thread Sorkin, John
I am using the contrast package to produce contrasts from a glm model that contains a quadratic term: fit0 <- glm(y ~ x + I(x*x),data=mydata) I would like to know how to specify the quadratic term, I(x*x), in the contrast function. When I try to use contrast(fit0,list(x=4)) I receive an error me

Re: [R] How to install rgeoda in R

2024-11-11 Thread Roger Bivand
The rgeoda package, version 0.0.10-4, is, as mentioned in this thread, available from https://geodacenter.r-universe.dev/rgeoda, pending the release of an updated version of the BH package with corrected Boost C++ headers that do not fail on forthcoming clang++ 19, see https://github.com/GeoDaC

Re: [R] How to install rgeoda in R

2024-11-10 Thread Roy Mendelssohn - NOAA Federal via R-help
https://geodacenter.r-universe.dev/rgeoda HTH, -Roy > On Nov 10, 2024, at 8:49 AM, Jeff Newmiller via R-help > wrote: > > The rgeoda maintainer seems to be having difficulty keeping up with required > changes to be supported on CRAN. This may get corrected soon or never. There > are instr

Re: [R] How to install rgeoda in R

2024-11-10 Thread Jeff Newmiller via R-help
The rgeoda maintainer seems to be having difficulty keeping up with required changes to be supported on CRAN. This may get corrected soon or never. There are instructions for compiling it yourself at https://geodacenter.github.io/rgeoda/ or you can contact the maintainer about their plans for

[R] How to install rgeoda in R

2024-11-10 Thread D
When trying to install rgeoda in R, I received an error message: Warning in install.packages : package ‘rgeoda’ is not available for this version of R A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-

Re: [R] How to install this package

2024-10-03 Thread David Winsemius via R-help
I’m Sent from my iPhone > On Oct 2, 2024, at 7:43 AM, roslinazairimah zakaria > wrote: > > Hi Enrico, yes it works. I can also plot the graph. > Next question, how do I delete the date from 16 December until 31 December > 2014? > > > Thank you very much. > >> dt$time <- as.POSIXct(dt$time)

Re: [R] How to install this package

2024-10-02 Thread roslinazairimah zakaria
Hi Enrico, yes it works. I can also plot the graph. Next question, how do I delete the date from 16 December until 31 December 2014? Thank you very much. > dt$time <- as.POSIXct(dt$time)> > dt_ts <- xts(dt$count, dt$time)> > str(dt_ts)An xts object on 2014-01-01 / 2014-12-31 23:59:00 containing

Re: [R] How to install this package

2024-10-01 Thread Enrico Schumann
On Wed, 25 Sep 2024, Christofer Bogaso writes: > Hi, > > I would like to install an R library from > https://cran.r-project.org/src/contrib/Archive/termstrc/ > > I executed below code without success. > > Any help would be appreciated. > >> install.packages('/Users/termstrc_1.3.tar.gz', repos = NU

Re: [R] How to install this package

2024-09-25 Thread Ivan Krylov via R-help
В Wed, 25 Sep 2024 18:53:02 +0530 Christofer Bogaso пишет: > Error in dyn.load(dynlib <- getDynlib(dir)) : > > unable to load shared object > '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/rgl/libs/rgl.so': > > > dlopen(/Library/Frameworks/R.framework/Versions/4.4-ar

[R] How to install this package

2024-09-25 Thread Christofer Bogaso
Hi, I would like to install an R library from https://cran.r-project.org/src/contrib/Archive/termstrc/ I executed below code without success. Any help would be appreciated. > install.packages('/Users/termstrc_1.3.tar.gz', repos = NULL, type="source") * installing *source* package ‘termstrc’ ..

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-14 Thread Christopher W. Ryan
Thanks Deepayan. This is an excellent review. I found it very helpful. --Chris Ryan -- Agency Statistical Consulting, LLC Helping those in public service get the most from their data. www.agencystatistical.com Public GnuPG email encryption key at https://keys.openpgp.org 9E53101D261BEC070CFF1A

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-14 Thread Deepayan Sarkar
On Fri, 13 Sept 2024 at 23:36, Christopher W. Ryan wrote: > > For me, Bert's suggestion produces a plot with two black symbols above > the plotting region, a circle and a triangle, both filled, and no text. > > This, in which I specify several features of the symbols in the key, > > dd %>% dotplo

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Christopher W. Ryan
For me, Bert's suggestion produces a plot with two black symbols above the plotting region, a circle and a triangle, both filled, and no text. This, in which I specify several features of the symbols in the key, dd %>% dotplot( segment ~ transit_time, groups = impact, data = .,

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Bert Gunter
Oh, and for correct syntax with R's |> operator, "data = ." , should be "data = _" ; although the former seemed to work. -- Bert On Fri, Sep 13, 2024 at 10:45 AM Bert Gunter wrote: > > "Why does key = list(points = 16:17) not work? " > > Because, from the "key" section of ?xyplot > " The conten

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Bert Gunter
"Why does key = list(points = 16:17) not work? " Because, from the "key" section of ?xyplot " The contents of the key are determined by (possibly repeated) components named "rectangles", "lines", "points" or "text". Each of these must be **lists** with relevant graphical parameters (see later) co

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Christopher W. Ryan
dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., pch = 16:17, cex = 1.8, scales = list(cex = 1.4), key = list(points = 16:17) ) produces a graph with no discernible key, but with an asterisk at the top, above the plot

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Deepayan Sarkar
On Fri, 13 Sept 2024 at 12:49, Christopher W. Ryan wrote: > > I am making a dotplot with lattice, as follows: > > dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., >as.table = TRUE, > pch = 16:17, > cex = 1.8, > scal

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread CALUM POLWART
Add: key = list(points=16:17) Into the dotplot section possibly without the autokey On Fri, 13 Sep 2024, 08:19 Christopher W. Ryan, wrote: > I am making a dotplot with lattice, as follows: > > dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., >as.table = TRUE,

[R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Christopher W. Ryan
I am making a dotplot with lattice, as follows: dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., as.table = TRUE, pch = 16:17, cex = 1.8, scales = list(cex = 1.4), auto.key = TRUE) impact is a factor

Re: [R] How to set the correct libomp for R

2024-04-09 Thread Ivan Krylov via R-help
В Tue, 9 Apr 2024 09:55:06 +0200 gernop...@gmx.net пишет: > If I only move away /usr/local/lib/libomp.dylib, I can still install > it. So it seems that also here the internal libomp.dylib from R is > used. Just the bundled omp files at /usr/local/include (omp-tools.h, > omp.h, ompt.h) seem to be u

Re: [R] How to set the correct libomp for R

2024-04-09 Thread gernophil--- via R-help
by a mismatch of these file and the used libomp.dylib?     Gesendet: Dienstag, 09. April 2024 um 09:47 Uhr Von: gernop...@gmx.net An: "Ivan Krylov" , "gernophil--- via R-help" Cc: gernop...@gmx.net Betreff: Re: [R] How to set the correct libomp for R Sorry fort he late reply, y

Re: [R] How to set the correct libomp for R

2024-04-09 Thread gernophil--- via R-help
Sorry fort he late reply, your mail ended up in my spam and I've just seen it recently. > Does the behaviour change if you temporarily move away > /usr/local/lib/libomp.dylib? It does not change the behavior after loading (or attaching) data.table using "library(data.table)". It is still load

Re: [R] How to set the correct libomp for R

2024-04-08 Thread Ivan Krylov via R-help
В Mon, 8 Apr 2024 10:29:53 +0200 gernophil--- via R-help пишет: > I have some weird issue with using multithreaded data.table in macOS > and I am trying to figure out, if it’s connected to my libomp.dylib. > I started using libomp as stated here: > https://mac.r-project.org/openmp/ Does the beha

[R] How to set the correct libomp for R

2024-04-08 Thread gernophil--- via R-help
Hey everyone, I have some weird issue with using multithreaded data.table in macOS and I am trying to figure out, if it’s connected to my libomp.dylib. I started using libomp as stated here: https://mac.r-project.org/openmp/   Everything worked fine till beginning of this year, but all of a sudd

Re: [R] How to tweak genomic plot with genoPlotR?

2024-04-02 Thread Luigi Marongiu
Already did... On Tue, Apr 2, 2024 at 10:45 AM Eric Berger wrote: > > According to https://cran.r-project.org/web/packages/genoPlotR/index.html > the maintainer of genoPlotR is > > Lionel Guy > > Send your question also to him. > > On Tue, Apr 2, 2024 at 11:27 AM Luigi Marongiu > wrote: > > >

Re: [R] How to tweak genomic plot with genoPlotR?

2024-04-02 Thread Eric Berger
According to https://cran.r-project.org/web/packages/genoPlotR/index.html the maintainer of genoPlotR is Lionel Guy Send your question also to him. On Tue, Apr 2, 2024 at 11:27 AM Luigi Marongiu wrote: > > I would like to use your genoPlotR package > (doi:10.1093/bioinformatics/btq413) to comp

[R] How to tweak genomic plot with genoPlotR?

2024-04-02 Thread Luigi Marongiu
I would like to use your genoPlotR package (doi:10.1093/bioinformatics/btq413) to compare the genomes of two isolates of E. coli K-12 that I have. One is a K-12 that was in my lab's fridge; the other is a derivative of K-12 bought some time ago, HB101. I tried to use genoPlotR, but I could not unde

Re: [R] How to invert axis within defined range with ggplot2 scale_y_reverse?

2024-03-05 Thread Luigi Marongiu
Thank you. I though the values would have been reversed automatically. Case closed then On Tue, Mar 5, 2024 at 2:43 PM Duncan Murdoch wrote: > > On 05/03/2024 7:16 a.m., Luigi Marongiu wrote: > > A <- rep(c(0, 3, 6, 12, 24), 3) > > B <- c(rep(0,5), rep(1,5), rep(2,5)) > > V <- c(27.5,27.01,

Re: [R] How to invert axis within defined range with ggplot2 scale_y_reverse?

2024-03-05 Thread Duncan Murdoch
On 05/03/2024 7:16 a.m., Luigi Marongiu wrote: A <- rep(c(0, 3, 6, 12, 24), 3) B <- c(rep(0,5), rep(1,5), rep(2,5)) V <- c(27.5,27.01,27.75,27.98,27.4,25.69, 26.17,27.78,26.08, 24.97,23.18,21.78,22.49,21.85,22.2) df <- data.frame(Conc = A, T

[R] How to invert axis within defined range with ggplot2 scale_y_reverse?

2024-03-05 Thread Luigi Marongiu
Hello, I am drawing some data with ggplot2 and would like to reverse the order of the y axis and set a custom range for it. I can do the former but when I add the key `limits` to `scale_y_reverse` I get an error as shows below and, worse, no data shown in the plot. How can I properly set a reverse

Re: [R] how to specify uncorrelated random effects in nlme::lme()

2024-01-09 Thread Viechtbauer, Wolfgang (NP)
2:43 > To: R-help > Subject: [R] how to specify uncorrelated random effects in nlme::lme() > > Dear professor, > > I'm using package nlme, but I can't find a way to specify two uncorrelated > random effects. For example, a random intercept and a random slope. In pac

[R] how to specify uncorrelated random effects in nlme::lme()

2024-01-09 Thread 王震
Dear professor, I'm using package nlme, but I can't find a way to specify two uncorrelated random effects. For example, a random intercept and a random slope. In package lme4, we can specify x + (x ll g) to realize, but how in nlme? Thanks! Zhen Wang Gradua

[R] How to calculate relative risk from GAM model in mgcv package?

2023-12-06 Thread Eren Yalın
Hi R users,I am a beginner in the use of R. I need urgent help for my thesis study. I have daily air pollution parameters PM10, PM2.5 CO, NO2, SO2, and O3. I also have daily hospital admission numbers. Taking into account the effect of weeken

Re: [R] How to Reformat a dataframe

2023-10-28 Thread jim holtman
You can also use the pivot_longer to do it: library(tidyverse) input <- structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465, 28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933, 19.3120917, 113.12581575, 28.45843425, 114.400074, 143.925, 46.439634, 20.7845679, 50.82874575, 36

Re: [R] How to Reformat a dataframe

2023-10-28 Thread avi.e.gross
Paul, I have snipped away your long message and want to suggest another approach or way of thinking to consider. You have received other good suggestions and I likely would have used something like that, probably within the dplyr/tidyverse but consider something simpler. You seem to be viewing a

Re: [R] How to Reformat a dataframe

2023-10-28 Thread Rui Barradas
Às 04:13 de 28/10/2023, Paul Bernal escreveu: Dear friends, I have the following dataframe: dim(alajuela_df) [1] 126 12 dput(alajuela_df) structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465, 28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933, 19.3120917, 113.12581575, 28.4584

Re: [R] How to Reformat a dataframe

2023-10-28 Thread Chris Evans via R-help
The tidyverse idiom looks very different but does what you want and I have come to like it. What idiom of R one likes, for the mostly small datasets I handle, is largely a matter of preferenceds for "readability", itself very personal. Here's my tidyverse way of doing what you wanted: ### sta

Re: [R] How to Reformat a dataframe

2023-10-27 Thread Paul Bernal
Hi Iris, Thank you so much for your valuable feedback. I wonder why your code gives you 1512 rows, given that the original structure has 12 columns and 126 rows, so I would expect (125*12)+ 9=1,509 total rows. Cheers, Paul El El vie, 27 de oct. de 2023 a la(s) 10:40 p. m., Iris Simmons < ikwsi...

Re: [R] How to Reformat a dataframe

2023-10-27 Thread Iris Simmons
You are not getting the structure you want because the indexes are wrong. They should be something more like this: i <- 0 for (row in 1:nrow(alajuela_df)){ for (col in 1:ncol(alajuela_df)){ i <- i + 1 df[i,1]=alajuela_df[row,col] } } but I think what you are doing can be written much

[R] How to Reformat a dataframe

2023-10-27 Thread Paul Bernal
Dear friends, I have the following dataframe: dim(alajuela_df) [1] 126 12 dput(alajuela_df) structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465, 28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933, 19.3120917, 113.12581575, 28.45843425, 114.400074, 143.925, 46.439634, 20.784

Re: [R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread Gabor Grothendieck
A variation is to remove Well and then we can use dot to refer to the remaining columns. aggregate(cbind(OD, ODnorm) ~ . , subset(df, select = - Well), mean) On Tue, Oct 24, 2023 at 8:32 AM Luigi Marongiu wrote: > > Hello, > I have a data frame with different groups (Time, Target, Conc) and

Re: [R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread Luigi Marongiu
Thank you On Tue, Oct 24, 2023 at 3:01 PM peter dalgaard wrote: > > Also, > > > aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean") > Time Target Conc ODODnorm > 11 BACT1 765. 108.3 > 21 BACT2 745. 88.3 > 31 BACT3

Re: [R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread peter dalgaard
Also, > aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean") Time Target Conc ODODnorm 11 BACT1 765. 108.3 21 BACT2 745. 88.3 31 BACT3 675. 18.0 (You might wish for "cbind(OD,ODnorm) ~ . - Well", but aggre

Re: [R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread Luigi Marongiu
Thank you, the last is exactly what I was looking for. On Tue, Oct 24, 2023 at 2:41 PM Sarah Goslee wrote: > > Hi, > > I think you're misunderstanding which set of variables go on either > side of the formula. > > Is this what you're looking for? > > > aggregate(OD ~ Time + Target + Conc, data =

Re: [R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread Sarah Goslee
Hi, I think you're misunderstanding which set of variables go on either side of the formula. Is this what you're looking for? > aggregate(OD ~ Time + Target + Conc, data = df, FUN = "mean") Time Target Conc OD 11 BACT1 765. 21 BACT2 745. 31 BACT3 675

[R] How to Calculate the Mean by Multiple Groups in R

2023-10-24 Thread Luigi Marongiu
Hello, I have a data frame with different groups (Time, Target, Conc) and each entry has a triplicate value of the measurements OD and ODnorm. How can I merge the triplicates into a single mean value? I tried the following: ``` df = data.frame(Time=rep(1, 9), Well=paste("A", 1:9, sep=""),

Re: [R] How to fix this problem

2023-09-25 Thread CALUM POLWART
y, September 25, 2023 11:09 AM > To: avi.e.gr...@gmail.com; 'Parkhurst, David' ; > r-help@r-project.org > Subject: Re: [R] How to fix this problem > > [External Email] > > It looks here as though the E coli column has commas in it so will be > treated as character.

Re: [R] How to fix this problem

2023-09-25 Thread Ebert,Timothy Aaron
l Dewey Sent: Monday, September 25, 2023 11:09 AM To: avi.e.gr...@gmail.com; 'Parkhurst, David' ; r-help@r-project.org Subject: Re: [R] How to fix this problem [External Email] It looks here as though the E coli column has commas in it so will be treated as character. Michael On 25/09/202

Re: [R] How to fix this problem

2023-09-25 Thread Michael Dewey
-project.org Subject: [R] How to fix this problem I have a matrix, KD6, and I�m trying to get a correlation matrix from it. When I enter cor(KD6), I get the message �Error in cor(KD6) : 'x' must be numeric�. Here are some early lines from KD6: Flow E..coliTNSRP T

Re: [R] How to fix this problem

2023-09-25 Thread avi.e.gross
lie commas. -Original Message- From: R-help On Behalf Of Parkhurst, David Sent: Sunday, September 24, 2023 2:06 PM To: r-help@r-project.org Subject: [R] How to fix this problem I have a matrix, KD6, and I�m trying to get a correlation matrix from it. When I enter cor(KD6), I get the

Re: [R] How to fix this problem

2023-09-25 Thread Ivan Krylov
On Sun, 24 Sep 2023 18:05:43 + "Parkhurst, David" wrote: > I have a matrix, KD6, and I_m trying to get a correlation matrix from > it. When I enter cor(KD6), I get the message _Error in cor(KD6) : > 'x' must be numeric_. > Here are some early lines from KD6: >Flow E..coliTN

Re: [R] How to fix this problem

2023-09-25 Thread Ivan Calandra
Dear David, simply check str(KD6). My guess (because we don't have your dataset, only a print of it) is that KD6 is not a matrix but a data.frame. The problem seems to come from the column "E..coli" which contains commas instead of periods (so text and not number). There might be other issues

[R] How to fix this problem

2023-09-25 Thread Parkhurst, David
I have a matrix, KD6, and I�m trying to get a correlation matrix from it. When I enter cor(KD6), I get the message �Error in cor(KD6) : 'x' must be numeric�. Here are some early lines from KD6: Flow E..coliTNSRP TPTSS 1 38.82,4201.65300 0.0270 0.0630 66.

Re: [R] How to import an excel data file

2023-09-24 Thread Rainer Hurling
Dear David, Am 23.09.23 um 01:10 schrieb Parkhurst, David: I know I should save it as a .csv file, which I have done. I�m told I should use the read_excel() function from the readxl package. My question is, how do I express the location of the file. The file is named KurtzData.csv. Its locatio

  1   2   3   4   5   6   7   8   9   10   >