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

2025-04-24 Thread Luigi Marongiu
"SD = ", S, "Fluo = ", q, "\n") if(q wrote: > > 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

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

2025-04-23 Thread Luigi Marongiu
nitial parameter estimates >mod2 Error in qr.qty(QR.rhs, .swts * ddot(attr(rhs, "gradient"), lin)) : NA/NaN/Inf in foreign function call (arg 5) ``` How can I properly set this regression model? Thank you On Wed, Apr 16, 2025 at 7:08 AM Luigi Marongiu wrote: > > Thank you. This

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

[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
the formula isn't convenient, you can approximate the > answer using the R function uniroot(). > > Duncan Murdoch > > On 2025-04-11 11:53 a.m., Luigi Marongiu wrote: > > I am trying to predict the intersection value between a curve and a line. > > I can fit a logistic

[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
ig = 3) ``` However, this level is too low; the Cq would probably be way higher on the y-axis, and there are instances where I would like to use a pre-fixed threshold value. How can I determine a Cq with R? Thank you -- Best regards, Luigi __ R-help@r-proje

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 g

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 f

[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 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 

[R] How to tweak genomic plot with genoPlotR?

2024-04-02 Thread Luigi Marongiu
-12 annotations in gff3 and genebank formats, but how do I load them in the system so that I plot it here? - Is it possible to zoom in? - Is it possible to change the color scheme? Thank you -- Best regards, Luigi __ R-help@r-project.org mailing list -

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)) &

[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] Fast way to draw mean values and 95% confidence intervals of groups with ggplot2

2023-11-16 Thread Luigi Marongiu
Thank you for your answer. I will implement it, but still I reckon ggplot2 cannot do the whole thing on its own terms: I need to prep the data beforehand. Cheers Luigi On Thu, Nov 16, 2023 at 1:39 PM Rui Barradas wrote: > > Às 11:59 de 16/11/2023, Luigi Marongiu escreveu: > > Hello

[R] Fast way to draw mean values and 95% confidence intervals of groups with ggplot2

2023-11-16 Thread Luigi Marongiu
Hello, I have triplicate (column A) readings (column D) of samples exposed to different concentrations (column C) over time (column B). Is it possible to draw a line plot of the mean values for each concentration (C)? At the moment, I get a single line. Also, is there a simple way to draw the 95% C

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

2023-10-24 Thread Luigi Marongiu
1 BACT2 88.3 > > 31 BACT3 18.0 > > > > Or using a different form, that might be more straightforward to you: > > > >> aggregate(df[, c("OD", "ODnorm")], by = df[, c("Time", "Target", "

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

2023-10-24 Thread Luigi Marongiu
uot;, "Target", "Conc")], > > data = df, FUN = "mean") > Time Target Conc OD ODnorm > 11 BACT1 765. 108.3 > 21 BACT2 745. 88.3 > 31 BACT3 675. 18.0 > > Sarah > > On Tue, Oct 2

[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 draw plot marks without label?

2023-09-05 Thread Luigi Marongiu
Thank you that is exactly it. I know these are basic questions but I can't find the solution on either manuals or online... Best regards Luigi On Tue, Sep 5, 2023 at 11:33 PM Bert Gunter wrote: > > Luigi: > > For base R graphics, you should always consult ?par for o

[R] How to draw plot marks without label?

2023-09-05 Thread Luigi Marongiu
I would like to draw a graph where the y-lables are missing but the marks still present. In this example, I get marks from 2 to 140 000 with increments of 20 000. I could use `plot(... yaxt="n"...)` combined with `axis(2, at..., label="")` but this needs to know exactly the sequence of marks pr

Re: [R] How to add error bars to a line plot with ggplot2?

2023-07-14 Thread Luigi Marongiu
Thank you, the problem was indeed about factors. Case solved On Fri, Jul 14, 2023 at 7:05 PM Rui Barradas wrote: > > Às 17:33 de 14/07/2023, Luigi Marongiu escreveu: > > Hello, > > I am measuring a certain variable at given time intervals and > > different concentratio

[R] How to add error bars to a line plot with ggplot2?

2023-07-14 Thread Luigi Marongiu
Hello, I am measuring a certain variable at given time intervals and different concentrations of a reagent. I would like to make a scatter plot of the values, joined by a line to highlight the temporal measure. I can plot this all right. Now, since I have more than one replicate, I would like to ad

Re: [R] How to plot both lines and points by group on ggplot2

2023-07-01 Thread Luigi Marongiu
Thank you that is exactly it! The problem was to connect each point of the series 'Conc' with a line. Best regards Luigi On Sat, Jul 1, 2023 at 8:33 PM Chris Evans wrote: > > > On 01/07/2023 19:20, Luigi Marongiu wrote: > > Hello, > > I have a dataframe with

[R] How to plot both lines and points by group on ggplot2

2023-07-01 Thread Luigi Marongiu
observation. Do you need to adjust the group aesthetic? ``` and no lines are drawn. Where am I going wrong? Thank you Luigi ``` df = data.frame(Conc = c(rep(1, 3), rep(2, 3), rep(5, 3)), Time = rep(1:3, 3), Value = c(0.91, 0.67, 0.71, 0.91, 0.65, 0.74, 0.95, 0.67, 0.67

Re: [R] How to test the difference between paired correlations?

2023-03-23 Thread Luigi Marongiu
as large or larger than the observed. > This is your p-value. > > Tim > > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Wednesday, March 22, 2023 5:12 PM > To: r-help > Subject: [R] How to test the difference between paired correla

[R] How to test the difference between paired correlations?

2023-03-22 Thread Luigi Marongiu
1 - xz)) : NaNs produced ``` What is the right way to run this test? Shall I apply also yz? Thank you -- Best regards, Luigi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] How to draw chemical structures with R?

2022-12-05 Thread Luigi Marongiu
Thanks, I will. On Tue, Dec 6, 2022 at 7:21 AM Jeff Newmiller wrote: > > I have never seen this package mentioned on this list. You should contact the > package maintainer. > > On December 5, 2022 9:59:34 PM PST, Luigi Marongiu > wrote: > >Thanks for the tip! I think

Re: [R] How to draw chemical structures with R?

2022-12-05 Thread Luigi Marongiu
lished as it gets. > > I would look for an example of what you are trying and see if you can get the > example to work. > > LMH > > > Luigi Marongiu wrote: > > Hello,' > > I have seen from this link > > https://cran.r-project.org/web/packages/rcdk/vigne

[R] How to draw chemical structures with R?

2022-12-05 Thread Luigi Marongiu
Hello,' I have seen from this link https://cran.r-project.org/web/packages/rcdk/vignettes/using-rcdk.html that there is a way to draw chemical structures using R via rcdk package. I tried to draw a simple structure but I got an error. What is it missing? What is the correct syntax? Thanks ``` libr

Re: [R] Select dataframe row containing a digit

2022-12-01 Thread Luigi Marongiu
Thank you, those are all viable solutions. Regards Luigi On Wed, Nov 30, 2022 at 8:59 PM Rolf Turner wrote: > > > On Wed, 30 Nov 2022 13:40:50 +0100 > Luigi Marongiu wrote: > > > Hello, > > I have a data frame where some lines containing strings including > > d

Re: [R] Select dataframe row containing a digit

2022-11-30 Thread Luigi Marongiu
Thank you, I have been trying with [:digit:] but did not work. It worked with `df$val[grepl('[0-9]', df$val)] = "NUM"` On Wed, Nov 30, 2022 at 2:02 PM Ivan Krylov wrote: > > В Wed, 30 Nov 2022 13:40:50 +0100 > Luigi Marongiu пишет: > > > I am formatti

[R] Select dataframe row containing a digit

2022-11-30 Thread Luigi Marongiu
G", but values entered as number should get the value "NUM". How do I change such values? -- Best regards, Luigi ``` df = data.frame(id = runif(10, 1, 100), val = c("", "POs", "Pos", "P", "Y", &

Re: [R] Replace values based on neither condition

2022-10-28 Thread Luigi Marongiu
Perfect, thank you! On Fri, Oct 28, 2022 at 11:53 AM Rui Barradas wrote: > > Às 10:43 de 28/10/2022, Luigi Marongiu escreveu: > > Hello, > > I have a data frame with a string column. All data that are neither > > "POS" nor "NEG" should've repl

[R] Replace values based on neither condition

2022-10-28 Thread Luigi Marongiu
uot;, "31.35", "POS", "20.61", "NEG"), stringsAsFactors = F) df$b[!(df$b == "POS") & (df$b == "NEG")] = NA df$b[(df$b == "POS") | (df$b == "NEG")] = NA ``` -- Best regards, Luigi

Re: [R] Interpreting fa.diagram from package psych

2022-09-12 Thread Luigi Marongiu
insemius > Sent: Sunday, September 11, 2022 11:50 PM > To: Ebert,Timothy Aaron ; Luigi Marongiu > > Cc: r-help > Subject: Re: [R] Interpreting fa.diagram from package psych > > [External Email] > > On 9/11/22 07:17, Ebert,Timothy Aaron wrote: > > It is a bad grap

Re: [R] Interpreting fa.diagram from package psych

2022-09-11 Thread Luigi Marongiu
they represent? Is there a way to show an auto-legend? Thank you On Sat, Sep 10, 2022 at 11:33 PM David Winsemius wrote: > > > On 9/10/22 14:08, Luigi Marongiu wrote: > > Hello, > > I have plotted data from exploratory factor analysis, and I got a > > graph similar to

[R] how to add comma to string vector?

2022-06-10 Thread Luigi Marongiu
Hello, I need to convert an R vector to a python array. Essentially, I got a vector of strings where each element must be enclosed in single quotes. The problem is that each closing single quote should contain a comma. What is the regex trick to do that? I tried with: ``` > (raws = c("field_1", "fi

Re: [R] Error in forest.meta : argument 3 matches multiple formal arguments

2022-05-26 Thread Luigi Marongiu
Thank you On Thu, May 26, 2022 at 12:38 PM Ivan Krylov wrote: > > В Thu, 26 May 2022 12:30:12 +0200 > Luigi Marongiu пишет: > > > > Error in forest.meta(m10, sortvar = TE, predict = TRUE, print.tau2 > > > = TRUE, : > > argument 3 matches multiple formal ar

[R] Error in forest.meta : argument 3 matches multiple formal arguments

2022-05-26 Thread Luigi Marongiu
predict = TRUE, print.tau2 = TRUE, : argument 3 matches multiple formal arguments ``` What am I getting wrong? How can I solve it? -- Best regards, Luigi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/l

Re: [R] How to set colors, axis gap, and free scale in ggplot?

2022-02-22 Thread Luigi Marongiu
xt = element_text(size = 10,face = 'bold')) > ``` > > Ron. > > > On 22/02/2022 14:25, Luigi Marongiu wrote: > > I am trying instead to increase the size with `theme(strip.text.x = > > element_text(size = 10))` (evem from 1 onwards) or `theme(strip.text.x &

Re: [R] How to set colors, axis gap, and free scale in ggplot?

2022-02-22 Thread Luigi Marongiu
Removed 24 rows containing missing values (geom_point). On Tue, Feb 22, 2022 at 12:41 PM Ron Crump wrote: > > Hi Luigi, > > > # FROM HERE IT DOES NOT WORK > > facet_grid(. ~ Species, scales="free_y") + # THE SCALE IS FIXED FOR ALL > > PANELS > > I don

Re: [R] How to set colors, axis gap, and free scale in ggplot?

2022-02-22 Thread Luigi Marongiu
No wonder it was not working: I was using the wrong functions (so far of manuals) This is great, thank you! All tips worked fine, including the free axis scale. On Tue, Feb 22, 2022 at 12:41 PM Ron Crump wrote: > > Hi Luigi, > > > # FROM HERE IT DOES NOT WORK > > f

[R] How to set colors, axis gap, and free scale in ggplot?

2022-02-22 Thread Luigi Marongiu
Hello, I have a dataframe with 3 columns: the actual measurement (Concentration), and two groups (Vitamin and Group). I would like to plot a barplot with superimposed a jitterplot, with error bars. I am using facet_grid. All that I can do, but the customization does not work. The customization is a

[R] How to superimpose jitter and barplot in ggplot2?

2022-02-21 Thread Luigi Marongiu
(data = df.summary, fill = NA, color = "black") + + geom_errorbar(aes(ymin = len, ymax = len+sd), + data = df.summary, width = 0.2) + + geom_jitter(position = position_jitter(0.2), color = "black&q

Re: [R] how to plot numeric variable against several categories with lattice bwplot?

2022-01-17 Thread Luigi Marongiu
Mon, Jan 17, 2022 at 4:22 AM Rolf Turner wrote: > > > On Thu, 13 Jan 2022 20:38:04 +0100 > Luigi Marongiu wrote: > > > Hello, > > I have a numerical variable (x) and a series of categories. I would > > like to make a box plot of x against each of the categories.

[R] how to plot numeric variable against several categories with lattice bwplot?

2022-01-13 Thread Luigi Marongiu
Hello, I have a numerical variable (x) and a series of categories. I would like to make a box plot of x against each of the categories. How can I arrange the data so that I can accomplish it with lattice? At the moment I got this: ``` df = data.frame(x = c(rep(1,5), rep(2,5), rep(3,5)), y = rnorm(1

[R] Error in using multiple correspondence analysis in R's FactoMineR

2022-01-09 Thread Luigi Marongiu
df, quanti.sup=2, quali.sup=c(11:33)) Error in dimnames(res) <- list(attributes(tab)$row.names, listModa) : length of 'dimnames' [2] not equal to array extent > nrow(df[10]) [1] 27 > nrow(df[11:33]) [1] 27 ``` What would be the problem? Thank you -- Best regards, Luigi __

Re: [R] how to run r biotools boxM terst on multiple groups?

2022-01-04 Thread Luigi Marongiu
$int<- interaction(iris$bin, iris$Species) > boxM(iris[,1:4], iris[,7]) > > Cheers > Petr > > > -Original Message- > > From: R-help On Behalf Of Luigi Marongiu > > Sent: Tuesday, January 4, 2022 11:56 AM > > To: r-help > > Subject: [R] how to r

[R] how to run r biotools boxM terst on multiple groups?

2022-01-04 Thread Luigi Marongiu
I have a data frame containing a half dozen continuous measurements and over a dozen ordinal variables (such as, death, fever, symptoms etc). I would like to run a box matrix test and I am using biotools' boxM, but it allows to run only one ordinal group at the time. For instance: ``` >data(iris) >

Re: [R] Format dates issues with R

2021-12-14 Thread Luigi Marongiu
Got it, thanks! On Tue, Dec 14, 2021 at 11:59 AM Ivan Krylov wrote: > > On Tue, 14 Dec 2021 11:54:08 +0100 > Luigi Marongiu wrote: > > > "9/29/2021" > > > format = "%d/%m/%y" > > > Why the conversion did not work? > > The according

[R] Format dates issues with R

2021-12-14 Thread Luigi Marongiu
Hello, I have these kind of dates: ``` > ori[[n[3]]] [1] "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" [7] "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/21/2021" "9/21/2021" [13] "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" [19] "9/21/2021"

Re: [R] R lattice contourplot: select only specific values

2021-11-17 Thread Luigi Marongiu
Awesome, thanks! On Wed, Nov 17, 2021 at 7:50 PM Bill Dunlap wrote: > > Try using at=c(1.8, 2.8) to specify the contour levels you want (and omit the > cuts= argument). > > -Bill > > On Wed, Nov 17, 2021 at 5:41 AM Luigi Marongiu > wrote: >> >> I have a d

Re: [R] lattice contourplot: how to change line width?

2021-11-17 Thread Luigi Marongiu
icking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Wed, Nov 17, 2021 at 1:42 AM Luigi Marongiu > wrote: >> >> sorry, it was easier than expected: just add `lwd` to the main cal. >> sorry I coul

[R] R lattice contourplot: select only specific values

2021-11-17 Thread Luigi Marongiu
I have a dataframe of three variables: x, y, z. The value of z are: ``` > unique(df$z) [1] 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.6 3.0 2.4 2.8 ``` I would like to plot the contour where the data get integer values (1.0, 2.0, 3.0) but also highlight where the 1.8 and 2.8 values occurred. Thus, I am plotting

[R] vectorization of loops in R

2021-11-17 Thread Luigi Marongiu
Hello, I have a dataframe with 3 variables. I want to loop through it to get the mean value of the variable `z`, as follows: ``` df = data.frame(x = c(rep(1,5), rep(2,5), rep(3,5)), y = rep(letters[1:5],3), z = rnorm(15), stringsAsFactors = FALSE) m = vector() for (i in unique(df$y)) { s = df[df$y

Re: [R] lattice contourplot: how to change line width?

2021-11-17 Thread Luigi Marongiu
sorry, it was easier than expected: just add `lwd` to the main cal. sorry I could not stop the message before checking... On Wed, Nov 17, 2021 at 10:31 AM Luigi Marongiu wrote: > > Hello, > I have generated a contourplot with lattice. How do I set the line > width? I tried with: >

[R] lattice contourplot: how to change line width?

2021-11-17 Thread Luigi Marongiu
Hello, I have generated a contourplot with lattice. How do I set the line width? I tried with: ``` library(lattice) contourplot(Z ~ X*Y, data = df, cuts = 3, panel=function(x,y,...){ panel.contourplot(lty=1, lwd = 3) }) ``` but did not work... Thank you

[R] How to use contour plot?

2021-11-16 Thread Luigi Marongiu
Hello, I have a dataframe with 3 values and that I would like to plot with contour: ``` > head(df) Y X Z 1 0.0008094667 50 1 2 0.0012360955 50 1 3 0.0016627243 50 1 4 0.0020893531 50 1 5 0.0025159819 50 1 6 0.0029426108 50 1 > contour(df$X

[R] How to run prop.test on 3-level factors?

2021-11-16 Thread Luigi Marongiu
Hello, I have a large database with a column containing a factor: ``` > str(df) 'data.frame': 500 obs. of 4 variables: $ MR : num 0.000809 0.001236 0.001663 0.002089 0.002516 ... $ FCN : num 2 2 2 2 2 2 2 2 2 2 ... $ Class: Factor w/ 3 levels "negative","positive",..: 1 1 1 1 1 1 1 1 1 1

Re: [R] how to connect libreoffice base odb using R package odbc?

2021-11-10 Thread Luigi Marongiu
Awesome, thanks! On Wed, Nov 10, 2021 at 10:33 PM Rasmus Liland wrote: > > Dear Luigi, > > Yes, from the named list of dataframes, > you access the demographic table like > that. > > You can remove dput() now, I used it > only to print the output; read ?dput, > it&

Re: [R] how to connect libreoffice base odb using R package odbc?

2021-11-10 Thread Luigi Marongiu
nt: chr "2020-11-01" "2022-01-01" $ EnrolTime : chr "13:24:00" "14:25:00" ``` Still, I thought it might have been easier to run `odb.read`. But it works, thank you again! On Wed, Nov 10, 2021 at 7:03 PM Rasmus Liland wrote: > > On 2021-11-10 18

Re: [R] how to connect libreoffice base odb using R package odbc?

2021-11-10 Thread Luigi Marongiu
I can run the query? R -- Best regards, Luigi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pro

Re: [R] how to connect libreoffice base odb using R package odbc?

2021-11-10 Thread Luigi Marongiu
able not found in statement [SELECT * FROM demographic] Statement: SELECT * FROM demographic" ``` the database contains a table `demographic` but I can't select it. Would you know what is the correct syntax? On Wed, Nov 10, 2021 at 3:43 PM Rasmus Liland wrote: > > Dear Luigi, > >

[R] how to connect libreoffice base odb using R package odbc?

2021-11-10 Thread Luigi Marongiu
/lib/psqlodbcw.so' : file not found > con <- dbConnect(odbc::odbc(), + driver = "/usr/local/lib/libsqlite3odbc.dylib", + database = "proof.odb", + uid = "", + pwd = "", + host = "localhost", + port = 5432) Erro

[R] How to select single table with ODB package

2021-11-05 Thread Luigi Marongiu
Hello, I am connecting R to a libreoffice-generated database (.odb) using the ODB package. I would like to link a dataframe to a specific table, but I cannot manage to extract a given table: ``` > db = odb.open(".../LOdatabase.odb", jarFile = NULL) > odb.tables(db) $demographic field.name field.ty

Re: [R] generate average frame from different data frames

2021-10-24 Thread Luigi Marongiu
Thanks for the tip! I'll check it out. On Sun, Oct 24, 2021 at 8:07 AM Jim Lemon wrote: > > Hi Luigi, > In that case you will want a binomial confidence interval. > > Jim > > On Sun, Oct 24, 2021 at 4:39 PM Luigi Marongiu > wrote: > > > > Thank you. So

Re: [R] create mean ksvm model

2021-10-23 Thread Luigi Marongiu
nto it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Sat, Oct 23, 2021 at 1:19 PM Luigi Marongiu > wrote: >> >> Hello, >> I am using the ksvm function from the library kernlab to generate an >> SVM classification

Re: [R] generate average frame from different data frames

2021-10-23 Thread Luigi Marongiu
ot numbers. On Sun, Oct 24, 2021 at 12:08 AM Jim Lemon wrote: > > Hi Luigi, > I may be missing the point, but: > > matrix((z1+z2+z3)/3,ncol=10) > > gives you the mean rating for each item, and depending upon what > distribution you choose, the confidence intervals could be

[R] create mean ksvm model

2021-10-23 Thread Luigi Marongiu
Hello, I am using the ksvm function from the library kernlab to generate an SVM classification. I am running the model with k-mean cross-validation, thus obtaining different accuracy. Is it possible to merge the different models obtained with the separate data set to generate a kind of median model

[R] generate average frame from different data frames

2021-10-23 Thread Luigi Marongiu
Hello, I have a series of classifications of the same data. I saved this classification in a single dataframe (but it could be a list). X and Y are the variable and Z is the classification by three raters. `I` is the individual identifier of each entry: ``` z1 = c(0,0,0,0,0,1,0,0,0,2, 0,1,1,1,0,0,0

[R] machine learning to define contours in R

2021-10-22 Thread Luigi Marongiu
Hello, I have run some support vector machine analysis. If I draw a grid of 10*10 points in a space, the model I built will assign the points to a given group. Lets' say: ``` results1 = data.frame(row_1 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), row_2 = c(0, 0, 0, 1, 0, 0

Re: [R] Split plot panel into rows with different columns

2021-10-21 Thread Luigi Marongiu
hings into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Oct 21, 2021 at 2:00 PM Luigi Marongiu > wrote: >> >> Hello, >> I would like to draw 5 figures in the same plot. The layout is: >> first row: 1

[R] Split plot panel into rows with different columns

2021-10-21 Thread Luigi Marongiu
Hello, I would like to draw 5 figures in the same plot. The layout is: first row: 1 column second row: 2 columns third row: 2 columns I have used split.screen: ``` > split.screen(c(3, 1)) # split display into 3 screens [1] 1 2 3 > split.screen(c(1, 2), screen = 2) # split second screen

Re: [R] How to find local minimum between distributions using mixtools?

2021-10-14 Thread Luigi Marongiu
), to=max(x1,x2), length=399) > p <- a*dnorm(x, x1, s1) + (1-a)*dnorm(x, x2, s2) > m <- min(p) > x[x == m] > > On Wed, 13 Oct 2021 at 22:12, Luigi Marongiu wrote: > > > > Hello, > > I have two peaks distributions (and some noise values in between), and > &g

Re: [R] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Luigi Marongiu
Got it, thanks! On Thu, Oct 14, 2021 at 9:59 AM Eric Berger wrote: > > df[(df$Y>0.2) & (df$X<10),][2,] > > On Thu, Oct 14, 2021 at 10:52 AM Luigi Marongiu > wrote: >> >> Hello, >> I have selected a subset of a dataframe with the vector syntax (if >

[R] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Luigi Marongiu
Hello, I have selected a subset of a dataframe with the vector syntax (if this is the name): ``` > df[(df$Y>0.2) & (df$X<10),] YX 10 0.2200642 1.591589 13 0.2941828 1.485951 ``` How can I select only the second row? I only managed to get the whole of whole columns: ``` > df[(df

Re: [R] How to rotate only one panel by 90 degrees in R plot?

2021-10-13 Thread Luigi Marongiu
Thank you! On Wed, Oct 13, 2021 at 12:00 PM Deepayan Sarkar wrote: > > On Wed, Oct 13, 2021 at 12:13 PM Luigi Marongiu > wrote: > > > > I have seen that the only package that easily rotate the plot is > > ggplot, so I ran: > > ``` > > library(ggplot2)

[R] How to find local minimum between distributions using mixtools?

2021-10-13 Thread Luigi Marongiu
;]~df$X[df$GROUP=="positive"], pch=16, cex=1.5) points(df$Y[df$GROUP=="uncertain"]~df$X[df$GROUP=="uncertain"], pch=16, cex=1.5, col="grey") abline(h=Cut_off, col="blue", lwd=2) abline(h=Cut_offE, col="blue", lwd=2, lty=2) ``` -- Best r

Re: [R] How to rotate only one panel by 90 degrees in R plot?

2021-10-12 Thread Luigi Marongiu
SE, ## this is the print.trellis method > panel.width = list(1,"npc"), > panel.height = list(1, "npc") > ) > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." >

[R] How to rotate only one panel by 90 degrees in R plot?

2021-10-12 Thread Luigi Marongiu
I tried to assign the second plot to an object p and then call grid.draw(p), or to assign g to the second plot, but they did not work... Thanks -- Best regards, Luigi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] How to convert line plot to lattice xtplot?

2021-10-12 Thread Luigi Marongiu
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 Tue, Oct 12, 2021 at 6:49 AM Luigi Marongiu > wrote: >> >> Hello, >>

[R] How to convert line plot to lattice xtplot?

2021-10-12 Thread Luigi Marongiu
(lattice) xyplot(Value ~ Concentration, group = Substance, data = df, pch = 16, cex = 1.2, type = "b", xlab=expression(bold(paste("Concentration (", mu, "M)"))), ylab=expression(bold("Infection rate")), col=COLS, scales = list(x = list(log = 10, at=c(unique(df$Concentra

Re: [R] How to add error bars to lattice xyplot

2021-10-11 Thread Luigi Marongiu
> "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 Mon, Oct 11, 2021 at 12:24 PM Luigi Marongiu > wrote: >> >&

Re: [R] How to add error bars to lattice xyplot

2021-10-11 Thread Luigi Marongiu
function (x,y) { panel.segments(x0 = log10(df$Concentration), x1 = log10(df$Concentration), y0 = df$Value - dfsd$Value, y1 = df$Value + dfsd$Value, col = COLS) } ) ``` I will check xYplot out, I think it is the tool for the job. On Mon, Oct 11, 2021 at 3:56 PM Deepayan Sarkar wrote: > > O

Re: [R] [External] Missing text in lattice key legend

2021-10-11 Thread Luigi Marongiu
Outlook for iOS > > From: R-help on behalf of Luigi Marongiu > > Sent: Monday, October 11, 2021 7:46:36 AM > To: r-help > Subject: [External] [R] Missing text in lattice key legend > > Hello, > I am drawing some data with lattice using: > ``` > library(lattice) &

Re: [R] Missing text in lattice key legend

2021-10-11 Thread Luigi Marongiu
Awesome, thanks! On Mon, Oct 11, 2021 at 2:19 PM Deepayan Sarkar wrote: > > On Mon, Oct 11, 2021 at 5:17 PM Luigi Marongiu > wrote: > > > > Hello, > > I am drawing some data with lattice using: > > ``` > > library(lattice) > > COLS = c(&qu

[R] How to add error bars to lattice xyplot

2021-10-11 Thread Luigi Marongiu
), panel = function (x,y,) { panel.segments(x0 = df$Concentration, x1 = df$Concentration, y0 = df$Value - dfsd$Value, y1 = df$Value + dfsd$Value, col = COLS) } ) ``` but the bars are plotted outside the

[R] Missing text in lattice key legend

2021-10-11 Thread Luigi Marongiu
) ) ), panel = function(x,y) { panel.xyplot(x,y) errbar() } ) ``` It all works but the legend only shows the colored dots, there is no text. Is it something missing from the syntax? Thank

Re: [R] how to predict X given Y using logit regresion in R?

2021-10-02 Thread Luigi Marongiu
on, data = newdata, type="l") text(lod+0.2, 0.87, labels = round(lod, 2), cex = 0.9) ``` Case closed On Sat, Oct 2, 2021 at 4:33 PM Luigi Marongiu wrote: > > I tried with: > ``` > library(chemCal) > inverse.predict(model, 0.95) > > inverse.predict(model, 0.95) >

Re: [R] how to predict X given Y using logit regresion in R?

2021-10-02 Thread Luigi Marongiu
Hello, I also tried with ``` library(MASS) > dose.p(model,p=.95) Dose SE p = 0.95: 1.70912 96.26511 ``` which is closer to the expected 1.72 but with a very large error (I expected 1.10-2.34). Is this regression correct? On Sat, Oct 2, 2021 at 10:14 AM Luigi Marongiu wr

Re: [R] how to predict X given Y using logit regresion in R?

2021-10-02 Thread Luigi Marongiu
out 1.7. Could it be that model is based on glm whereas inverse.predict uses linear regression? On Sat, Oct 2, 2021 at 10:14 AM Luigi Marongiu wrote: > > Hello, > I have set a glm model using probit. I would like to use it to predict > X given Y. I have followed this example: > ``` &g

[R] how to predict X given Y using logit regresion in R?

2021-10-02 Thread Luigi Marongiu
for f4 but not e4? How do I get X given Y? Do I need to find the inverse function of logit (which one?) and apply this to the regression or is there a simpler method? Also, is it possible to plot the model to get a smooter line than `plot(positivity ~ concentration,

[R] How to get a given cut-off in logit regression?

2021-10-01 Thread Luigi Marongiu
ce: 4.6727e-01 on 4 degrees of freedom Residual deviance: 1.9445e-07 on 3 degrees of freedom AIC: 4.3016 Number of Fisher Scoring iterations: 25 ``` How can I now find the concentration that gives 95% positivity? Thanks -- Best regards, Luigi __ R

Re: [R] how to combine logic test on vectors in R?

2021-09-30 Thread Luigi Marongiu
all(z == "") >> [1] TRUE >> > z <- c("a","") >> > all(z == "") >> [1] FALSE >> >> If this isn't it, just ignore without reply. >> >> Bert Gunter >> >> "The trouble with h

Re: [R] how to combine logic test on vectors in R?

2021-09-30 Thread Luigi Marongiu
ly want an AND operator, & or &&, which will only > return TRUE if all elements are TRUE, > > More on logical operators: > https://stat.ethz.ch/R-manual/R-devel/library/base/html/Logic.html > > Sarah > > On Thu, Sep 30, 2021 at 9:07 AM Luigi Marongiu >

[R] how to combine logic test on vectors in R?

2021-09-30 Thread Luigi Marongiu
Hello, I have two data frames, each with three rows: ``` df_a <- data.frame(a = letters[1:3], b = LETTERS[1:3], q = c("", "", ""), stringsAsFactors = FALSE) df_b <- data.frame(a = letters[4:6], b = LETTERS[4:6], q = c("", "", "1.5"), stringsAsFactors = FALSE) ``` I need to test whether the datafram

Re: [R] How to install package meta on Linux Ubuntu 21?

2021-09-29 Thread Luigi Marongiu
do not know the package names. > > > > > >> On Sep 29, 2021, at 9:46 AM, Luigi Marongiu > >> wrote: > >> > >> Hello > >> I have R version 4.1.1 (2021-08-10) -- "Kick Things", on an Ubuntu 21 > >> machine. I am trying t

[R] How to install package meta on Linux Ubuntu 21?

2021-09-29 Thread Luigi Marongiu
Eigen’ had non-zero exit status ``` and lme4 requires RcppEigen. I launched `$ sudo apt-get install r-cran-rcppeigen` installation successful but I got the same error in installing RcppEigen. What could be the error? -- Best regards, Luigi __ R-help@r-p

Re: [R] alternative to subset(dataframe, select = - column) in R

2021-09-24 Thread Luigi Marongiu
ep 24, 2021 at 7:33 PM Rui Barradas wrote: > > Hello, > > Like this? > > > mtcars[names(mtcars) != "mpg"] > > > Hope this helps, > > Rui Barradas > > Às 15:09 de 24/09/21, Luigi Marongiu escreveu: > > Hello, > > this is a very

  1   2   3   4   >