Re: [R] Mutate issue help needed

2024-12-17 Thread John Kane
; https://stat.ethz.ch/mailman/listinfo/r-help > >> PLEASE do read the posting guide > >> https://www.R-project.org/posting-guide.html > >> and provide commented, minimal, self-contained, reproducible code. > >> > > > > [[alt

Re: [R] Mutate issue help needed

2024-12-17 Thread John Kane
/2024-December/480371.html > > -- > Best regards, > Ivan > > __ > 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 > https

[R] Fortune Nomination

2024-12-13 Thread Sorkin, John
As Dante wrote, Abandon all hope ye who enter R. Written by ivo welch 12/13 2:43 PM John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread John Fox
Hello Duncan, On 2024-12-13 5:30 p.m., Duncan Murdoch wrote: Caution: External email. On 2024-12-13 5:11 p.m., John Fox wrote: Dear Daniel, On 2024-12-13 2:51 p.m., Daniel Lobo wrote: Caution: External email. Looks like the solution 1.576708   6.456606   6.195305 -19.007996 is the best

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread John Fox
. Not if I read the output correctly. As I showed, the result from pracma:fmincon() produces a larger value of the objective function than the result I obtained from nloptr(). John Nash (who is an expert on optimization -- I'm not) obtained an even lower value of the objective function

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread John Fox
raints:1 Optimal value of objective function: 1287.71725107671 Optimal value of controls: 1.576708 6.456606 6.195305 -19.008 -- snip -- That produces a solution closer to, and better than, the one that you suggested (which you obtained how?): > f(c(0.222, 6.999, 6.1

Re: [R] Fortune nomination.

2024-12-12 Thread John Kane
> 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 > https://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, repro

Re: [R] SQL and R

2024-12-11 Thread Sorkin, John
early needed, important, and well used; a commercial version of SQL, Oracle, made Larry Ellison more than a quarter billionaire. S, one of the progenitors of R, was developed later. In 1975 by John Chambers, Rick Becker, Trevor Hastie, and William Cleveland (all of whom, I believe worked at

[R] aggregate produces results in unexpected format

2024-12-11 Thread Sorkin, John
..- attr(*, "dimnames")=List of 2 .. .. ..$ : NULL .. .. ..$ : chr [1:4] "Mean" "min" "max" "Nobs" I want it to simply be a numeric dataframe: mean min max length 12 1015 4 22 2025 4 32 30 35

[R] ggplot2: Plot multiple lines using stacked data.

2024-12-05 Thread Sorkin, John
27, 89.57, 7.8, 0.98, 0.38, 0.5, 0.52, 0.25, 80.43, 13.33, 3.85, 0.76, 0.86, 0.28, 0.49)), class = "data.frame", row.names = c(NA, -28L)) # You can see that the data are stacked, one day on top of the next. # Each day requires seven lines. mydata # Load

Re: [R] Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows

2024-12-02 Thread Sorkin, John
me. Your collective help is invaluable, and I am in your collect debt. Many, many thanks, John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Educat

[R] Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows

2024-11-30 Thread Sorkin, John
# the first row set first to 0. mydoit <- function(df){ value <- ifelse (first(df[,"ID"]),1,0) cat("value=",value,"\n") df[,"first"] <- value } newdata <- aggregate(olddata,list(olddata[,"ID"]),mydoit) Thank you, John John

[R] Trying to get the prior value of a record from a data.frame . . . data.frame

2024-11-28 Thread Sorkin, John
t;num"],"\n") # Get previous value of x[i,"num"] zoop<-shift(x[i,"num"], n=1L, type="lag") cat("Previous value of x[,num]=",zoop,"\n") } ### # END Try to understand shift #

[R] R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments

2024-11-27 Thread Sorkin, John
suggestions on how to do this would be appreciated. . . I have worked on this for more than 12-hours, despite multiple we searches I have gotten nowhere. . . Thanks John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Bio

[R] Convert string to date time

2024-11-26 Thread Sorkin, John
problem is the _ between the date and time, but I don't know how to account for this character in the string. I hope someone can tell me how to read the string as a date time constant. John  John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of M

[R] DPLYR Multiple Mutate Statements On Same DataFrame

2024-10-17 Thread Sparks, John
to know if there is a way to execute this in a single step; so simply go from df0 to df1 while executing all the transformations. See example below. Guidance would be appreciated. --John J. Sparks, Ph.D. library(dplyr) df0<-structure(list(SeqNum = c(1L, 2L, 3L, 4L, 5L, 6L, 8L, 9L, 10L,

Re: [R] Is there a sexy way ...?

2024-09-27 Thread Sorkin, John
developed "sexy" but not easily understandable code. While I send kudos to all of you, remember that sometimes simpler, while not as sexy can be better in the long run. ;) John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Direc

Re: [R] (no subject)

2024-09-16 Thread John Kane
13 5 3 6 2 8 8 7 7 3 ... > > #> $ groupid: num 4 10 7 4 7 3 7 8 8 3 ... > > > > > > And here is the data in dput format. > > > > > > > > db10 <- > >structure(list( > > cp1 = c(1, 5, 3, 7, 10, 5, 2, 4, 8, 10, 9, 2, > >

Re: [R] Linear regression and stand deviation at the Linux command line

2024-08-22 Thread Sorkin, John
-regression-in-r/#:~:text=How%20to%20Perform%20Logistic%20Regression%20in%20R%20%28Step-by-Step%29,Predictions%20...%205%20Step%205%3A%20Model%20Diagnostics%20 Take the first steps, show that you are trying and the R help list will be very helpful. John John David Sorkin M.D., Ph.D. Professor of

Re: [R] Manually calculating values from aov() result

2024-08-07 Thread John Fox
ere are covariates. In my opinion, researchers are usually interested in the hypotheses for type-II tests. These matters are described in detail, for example, in my applied regression text <https://www.john-fox.ca/AppliedRegression/index.html>. I hope this helps, John -- John F

[R] Create matrix with variable number of columns AND CREATE NAMES FOR THE COLUMNS

2024-07-01 Thread Sorkin, John
("NSim",createValuelist(Grps))) DiffMeans # Thank you for your help! John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clinical

Re: [R] Regression performance when using summary() twice

2024-06-21 Thread John Fox
100 100 I hope this helps, Johm -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ -- On 2024-06-21 10:38 a.m., c.bu...@posteo.jp wrote: [You don't often get email from c.bu...@posteo.jp. Learn why this is important at

Re: [R] Column names of model.matrix's output with contrast.arg

2024-06-17 Thread John Fox
including myself). I didn't write a replacement for contr.poly() because the current coefficient labeling seemed reasonably transparent. Best, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ -- On 2024-06-17 4:29 p.m., B

[R] Can't compute row means of two columns of a dataframe.

2024-06-08 Thread Sorkin, John
ng, and how I can compute the row means? Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clinical Center;  PI Biostat

Re: [R] Listing folders on One Drive

2024-05-20 Thread John Fox
Dear Nick, See list.dirs(), which is documented in the same help file as list.files(). I hope this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ -- On 2024-05-20 9:36 a.m., Nick Wray wrote: [You don't often get

[R] Print date on y axis with month, day, and year

2024-05-09 Thread Sorkin, John
(jdate,format="%m-%d-%Y"),Sum)) +geom_point() Thank you John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clini

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-23 Thread John Fox
[3,] [4,] [5,] [6,] [7,] [8,] [9,] 123456789 10 > dim(v) [1] 10 > v[-1] [1] 1 3 4 5 6 7 8 9 10 > v[-0] [1] 1 Best, John On 2024-04-23 9:03 a.m., Peter Dalgaard via R-help wrote: Caution: External email. Doesn't sound like you got th

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread Sorkin, John
original poster suggests that there are strong assumptions, assumptions that typically would be made in a class-room example or exercise. John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics

Re: [R] Rtools and things dependent on it

2024-02-23 Thread Sorkin, John
u for the information about what I should read. I will look at the material again, and hopefully things the material you suggest I read will be more understandable. John P.S. This email should be in txt format, not html. I sent if from my desktop windows machine which provides more options than

Re: [R] Rtools and things dependent on it

2024-02-23 Thread Sorkin, John
R tools. John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410

Re: [R] ggarrange & legend

2024-02-05 Thread John Kane
Blast it hit send by accident. Anyway the code above is a WWE. I don't see any obvious way no move the legend On Mon, 5 Feb 2024 at 09:13, John Kane wrote: > I'm sorry but that is not a working example. > > A working example needs to create the plots being used. > > F

Re: [R] ggarrange & legend

2024-02-05 Thread John Kane
ange(plotlist=mylist, common.legend = TRUE, legend="top", labels = c("(A)", "(B)"), font.label = list(size = 18, color = "black"), ncol=2) fig1 #= On Mon, 5 Feb 2024 at 08:

Re: [R] ggarrange & legend

2024-02-05 Thread John Kane
> 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 provide commented, minimal, self-contained, reproducible code. > -- John Kane Ki

Re: [R] DrDimont package in R

2024-02-05 Thread John Kane
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 provide commented, minimal, self-contained, reproducible code. > -- John Kane Kingston ON Canada [

Re: [R] Use of geometric mean .. in good data analysis

2024-01-23 Thread John via R-help
gt;> >> So if you are serious about dealing with this and have a lot of data with >> these issues, my advice would be to stop looking for ad hoc advice and dig >> into the literature: it's one of the many areas of "data science" where >> seemingly simple but

Re: [R] Use of geometric mean .. in good data analysis

2024-01-22 Thread John Fox
Dear Martin, Helpful general advice, although it's perhaps worth mentioning that the geometric mean, defined e.g. naively as prod(x)^(1/length(x)), is necessarily 0 if there are any 0 values in x. That is, the geometric mean "works" in this case but isn't really inform

Re: [R] Is there any design based two proportions z test?

2024-01-18 Thread John Fox
01-17 9:47 p.m., Md. Kamruzzaman wrote: Caution: External email. Dear John Thank you so much for your reply. I have calculated the 95%CI of the separate two proportions by using the survey package. The code is given below. svyby(~Diabetes_Cate, ~Year, nhc, svymean, na=TRUE) Here:

Re: [R] Is there any design based two proportions z test?

2024-01-17 Thread John Fox
l for their difference. I hope this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ On 2024-01-16 10:21 p.m., Md. Kamruzzaman wrote: [You don't often get email from mkzama...@gmail.com. Learn why this is importan

Re: [R] arrow on contour line

2024-01-12 Thread John Kane
___ > 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 provide commented, minimal, self-contained, reproducible code. &g

Re: [R] Truncated plots

2024-01-09 Thread John Kane
ead the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- John Kane Kingston ON Canada [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Amelia. Imputation of time-series data

2024-01-05 Thread Sorkin, John
someone direct me to documentation that explains the imputation method? Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education

[R] Obtaining a value of pie in a zero inflated model (fm-zinb2)

2024-01-04 Thread Sorkin, John
ructural zero responses vs. the subject being in the portion of the population who can contribute a zero or a non-zero response? 3) zero inflated models can be solved using closed form solutions, or using iterative methods. Which method is used by fm_zinb2? Thank you, John John David Sorkin M.D., Ph.D.

Re: [R] Advice on starting to analyze smokestack emissions?

2023-12-17 Thread Sorkin, John
Kevin, I would like to be in touch with you. I am pursuing a research project similar to yours. Perhaps we can help each other. John jsor...@som.umaryland.edu John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and

[R] Convert two-dimensional array into a three-dimensional array.

2023-12-08 Thread Sorkin, John
y thanks for your help! John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clinical Center;  PI Biostatistics and Informati

[R] Convert character date time to R date-time variable.

2023-12-07 Thread Sorkin, John
Colleagues, I have a matrix of character data that represents date and time. The format of each element of the matrix is "2020-09-17_00:00:00" How can I convert the elements into a valid R date-time constant? Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine, Uni

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread John Kane
LessThan.com > > __ > 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 provi

Re: [R] ggplot adjust two y-axis

2023-11-24 Thread John Kane
;)+ > scale_y_continuous(name="First Axis", sec.axis=sec_axis(trans=~.*50, > name="Second Axis"))+ > scale_fill_brewer(palette="Set1") > > Thanks a lot > Sibylle > > __ > R-help@r-project.org mailing li

Re: [R] Can someone please have a look at this query on stackoverflow?

2023-11-14 Thread John Kane
> 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 provide commented, minimal, self-c

[R] Error running gee function. I neither understand the error message, nor know what needs to be done the get the gee to run

2023-10-25 Thread Sorkin, John
exchangeable", : NA/NaN/Inf in foreign function call (arg 3) In addition: Warning message: In gee(HipFlex ~ StepHeight, data = datashort, id = PID, corstr = "exchangeable", : NAs introduced by coercion Of note, when the analysis is run using lm, there is no problem. My fu

[R] by function does not separate output from function with mulliple parts

2023-10-24 Thread Sorkin, John
-- mydata$StepType: Second Regression results StepType Second Contrast results StepType Second Can you help me get the separators included in the printed otput? Thank you, John # Create Dataframe

Re: [R] download.file strict certificate revocation check

2023-10-05 Thread John Neset
Ivan, SSL connect error & we definitely have MITM doing certificate interference. No change with True or False with R_LIBCURL_SSL_REVOKE_BEST_EFFORT Environment variable results should be attached. -Original Message- From: Ivan Krylov Sent: Wednesday, October 4, 2023 8:52 AM To:

[R] download.file strict certificate revocation check

2023-10-04 Thread John Neset
What/how do I interact with the download.file with turning off the strict certificate revocation check in regards to download & update packages? I clearly made an attempt at this, but failed miserably. Trying to do this, reference FAQ- 2.18 The Internet download functions fail. (c) A MITM proxy (

Re: [R] Grouping by Date and showing count of failures by date

2023-09-30 Thread John Kane
30)) > > ? > > And where can we find non-base PivotTable? Please start the scripts with > calls to library() when using non-base functionality. > > Hope this helps, > > Rui Barradas > > > -- > Este e-mail foi analisado pelo software antivírus AVG para verificar a > presença de vírus. > w

Re: [R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-09-26 Thread John Fox
there is also no intrinsic reason that deltaMethod() shouldn't be able to handle a rank-deficient model. We'll probably fix that. My apologies for the confusion, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ On 2023-09

Re: [R] car::deltaMethod() fails when a particular combination of categorical variables is not present

2023-09-26 Thread John Fox
2 Then the hypothesis is tested directly by the t-value for the coefficient bct2:sent. I hope that this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ On 2023-09-26 1:12 a.m., Michael Cohn wrote: Caution: External email.

Re: [R] Print hypothesis warning- Car package

2023-09-18 Thread John Fox
ed are entirely unaffected. I've made this change and will commit it to the next version of the car package. Thank you for the suggestion, John - Peter On 17 Sep 2023, at 16:43 , John Fox wrote: Dear Robert, Anova() calls linearHypothesis(), also in the car package, to compute sum

Re: [R] Print hypothesis warning- Car package

2023-09-17 Thread John Fox
-- snip There's no good reason that linearHypothesis() should try to express each hypothesis symbolically for Anova(), since Anova() doesn't use that information. When I have some time, I'll arrange to avoid the warning. Best, John -- John Fox, Professor Emeritus McMas

[R] Theta from negative binomial regression and power_NegativeBinomiial from PASSED

2023-09-14 Thread Sorkin, John
power_NetativeBinomial function the theta that is produced by the glm.nb function 2. What is theta, and how does it relate to the parameters of the negative binomial distribution? Thank you, John [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] R coding errors

2023-09-08 Thread John Kane
nformation that is non-public, proprietary, > privileged, confidential > and > exempt from disclosure under applicable law including the > Official > Secrets Act 1972. **READ MORE...* > <https://mail.uitm.edu.my/index.php?option=com_content&view=article&id=83> > >

Re: [R] Issue with gc() on Ubuntu 20.04

2023-08-27 Thread John Logsdon
On 27-08-2023 21:02, Ivan Krylov wrote: On Sun, 27 Aug 2023 19:54:23 +0100 John Logsdon wrote: Not so although it did lower the gc() time to 95.84%. This was on a 16 core Threadripper 1950X box so I was intending to use library parallel but I tried it on my lowly windows box that is years

[R] Issue with gc() on Ubuntu 20.04

2023-08-27 Thread John Logsdon
aged to do this yet. Can anyone advise me? And why is the Linux version so much worse than Windows? TIA -- John Logsdon Quantex Research Ltd m:+447717758675/h:+441614454951 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://sta

Re: [R] Determining Starting Values for Model Parameters in Nonlinear Regression

2023-08-19 Thread John Fox
Dear John, John, and Paul, In this case, one can start values by just fitting > lm(1/y ~ x1 + x2 + x3 - 1, data=mydata) Call: lm(formula = 1/y ~ x1 + x2 + x3 - 1, data = mydata) Coefficients: x1 x2 x3 0.00629 0.00868 0.00803 Of course, the errors enter this mo

Re: [R] Determining Starting Values for Model Parameters in Nonlinear Regression

2023-08-19 Thread Sorkin, John
limited. Please do not flame me, I am simply urging caution. John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street

Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread John Kane
datasets methods base > > > other attached packages: > > [1] zoo_1.8-12 > > > loaded via a namespace (and not attached): > > [1] compiler_4.2.2 tools_4.2.2 grid_4.2.2 lattice_0.20-45 > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIB

Re: [R] Obtaining R-squared from All Possible Combinations of Linear Models Fitted

2023-07-17 Thread John C Frain
least as great as R with any subset of the regressors). If you want to calculate all these R-squared's it should be easy to write a small routine to estimate them. I am very curious as to why you wish to do this. John C Frain. 3 Aranleigh Park Rathfarnham Dublin 14 Ireland www.tcd.ie/Econ

Re: [R] ggplot: Can plot graphs with points, can't plot graph with points and line

2023-07-13 Thread John Kane
Hi John, This should do what you want. I've changed your data.frame name for my own convenience to "dat1". ###=== dat1 <- data.frame( Time = c("Age.25","Age.35","Age.45","Age.55"), Medians = c(1

[R] ggplot: Can plot graphs with points, can't plot graph with points and line

2023-07-12 Thread Sorkin, John
the data format used by ggplot themedians <- data.frame(themedians) themedians # This plot works ggplot(themedians,aes(x=Time,y=Median))+ geom_point() # This plot does not work! ggplot(themedians,aes(x=Time,y=Median))+ geom_point()+ geom_line() Thank you, John __

Re: [R] Getting an error calling MASS::boxcox in a function

2023-07-08 Thread John Fox
Hi Bert, On 2023-07-08 3:42 p.m., Bert Gunter wrote: Caution: This email may have originated from outside the organization. Please exercise additional caution with any links and attachments. Thanks John. ?boxcox says: * Arguments object a formula or fitted model

Re: [R] Getting an error calling MASS::boxcox in a function

2023-07-08 Thread John Fox
in this context transforms towards *multi*normality: -- snip -- > library(car) Loading required package: carData > powerTransform(dd + 1) Estimated transformation parameters Y1Y2 0.1740200 0.2089925 I hope this helps, John -- John Fox, Professor Emeritus McMaster U

Re: [R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Sorkin, John
My life is complete. I have inspired a fortune! John From: Rolf Turner Sent: Monday, July 3, 2023 6:34 PM To: Bert Gunter Cc: Sorkin, John; r-help@r-project.org (r-help@r-project.org); Achim Zeileis Subject: Re: [R] Create a variable lenght string that

[R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Sorkin, John
2] not equal to array extent A colnames statement, colnames(myvalues)<-as.character(zzz) produces the same error. Can someone tell me how to create a sting that can be used in the dimnames statment? Thank you (and please accept my apologies for double posting). John # create variable na

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
umn names, j, k, xxx1, xxx2 to the matrix # create column names, j, k, xxx1, xxx2. dimnames(myvalues)<-list(NULL,c(zzz)) colnames(myvalues)<-zzz ____ From: Jeff Newmiller Sent: Monday, July 3, 2023 2:45 PM To: Sorkin, John Cc: r-help@r-project.org Subj

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
Jeff, Thank you for your reply. I should have said with dim names not column names. I want the Mateix to have dim names, no row names, dim names j, k, xxx1, xxx2. John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of

[R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
se help me get the code to work. Thank you, John # create variable names xxx1 and xxx2. string="" for (j in 1:2){ name <- paste("xxx",j,sep="") string <- paste(string,name) print(string) } # Creation of xxx1 and xxx2 works string # Create matrix myvalues

Re: [R] Plotting factors in graph panel

2023-06-29 Thread John Kane
/st/ > > > at.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl > > > .edu%7C59874e74164c46133f2c08db7853d28f%7C0d4da0f84a314d76ace60a6233 > > > 1e1b84%7C0%7C0%7C638236073642897221%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi > > > MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C

Re: [R] R does not run under latest RStudio

2023-04-06 Thread Sorkin, John
I have also had difficulty running R in RStudio. Has anyone else had problems? It will be a shame if we need to abandon R Studio. It is a very good IDE. John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine

Re: [R] R does not run under latest RStudio

2023-04-06 Thread John Dougherty via R-help
On Thu, 6 Apr 2023 17:28:32 +0800 "Steven T. Yen" wrote: > I updated to latest RStudio (RStudio-2023.03.0-386.exe) but > R would not run. Error message: > > Error Starting R > The R session failed to start. > > RSTUDIO VERSION > RStudio 2023.03.0+386 "Cherry Blossom " (3c53477a, 2023-03-09) for

Re: [R] R does not run under latest RStudio

2023-04-06 Thread John C Frain
Does R run from a command prompt? If so, the problem is likely due to your Rstudio setup. If R does not run from a command prompt, any error messages might give some idea of the problem. I can run R and Rstudio in Windows 11?, Windows 10 and the current version of Linux Mint. On Thu 6 Apr 2023,

[R] Simple Stacking of Two Columns

2023-04-03 Thread Sparks, John
2 Dick 3Larry 4Curly gather makes no change to the data NamesLong<-gather(NamesWide,Name1,Name2) > NamesLong Name1 Name2 1 Tom Larry 2 Dick Curly Please help me solve what should be a very simple

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

2023-03-23 Thread John C Frain
1. estimate r 2. do the z transformation - z is a simple function of r - z has an approximate standard normal distribution. 3. use the normal distribution tables to decide on the significance of z or of differences between two z's. I don't see the need for packages. John

Re: [R] loess plotting problem

2023-03-23 Thread John Fox
Dear , On 2023-03-23 11:08 a.m., Anupam Tyagi wrote: Thanks, John. However, loess.smooth() is producing a very different curve compared to the one that results from applying predict() on a loess(). I am guessing they are using different defaults. Correct? No need to guess. Just look at the

Re: [R] loess plotting problem

2023-03-23 Thread John Fox
g a loess regression to a scatterplot; for example, plot(speed ~ dist, data=cars) with(cars, lines(loess.smooth(dist, speed))) Other points: You don't have to load the stats package which is available by default when you start R. It's best to avoid attach(), the use of which can cause

[R] Error: 'format_glimpse' is not an exported object from 'namespace:pillar'

2023-03-21 Thread Sorkin, John
I am receiving the following error message. I don't understand what it means, and I don't know how to fix it. I am running my code in R studio. I do not know if the error comes from R or RStudio. Please see session data below, Thank you, John version data: platform x86_64-w

Re: [R] Good Will Legal Question

2023-03-21 Thread John Fox
e license on the webpage that sells the hoodie. FWIW, I (and I expect you) have seen many t-shirts, etc., with R logos, some from companies, and I even have a few. I doubt that anyone will care. Best, John -Original Message----- From: R-help On Behalf Of John Fox Sent: Tuesday, March 21, 2

Re: [R] DOUBT

2023-03-21 Thread John Fox
ple of the problem -- but it's a good guess that the variable (HHsize or perhaps some other variable) isn't in the newdata data frame. Best, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ On 2023-03-21 1:24 p.m., N

Re: [R] Good Will Legal Question

2023-03-21 Thread John Fox
tion wanted to limit commercial use of the R logo, it wouldn't have released it under the CC-BY-SA 4.0 license. I'm not sure what moral issues concern you. I hope this helps, John John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://socialsciences.

Re: [R] DOUBT

2023-03-21 Thread John Fox
Dear Nandini raj, You have a space in the variable name "HH size". I hope this helps, John John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://socialsciences.mcmaster.ca/jfox/ On 2023-03-20 1:16 p.m., Nandini raj wrote: Respected sir/madam can

Re: [R] Trying to learn how to write an "advanced" function

2023-03-16 Thread Sorkin, John
s would be appreciated! Thank you, John doit <- function(x){ ds <- deparse(substitute(x)) cat("1\n") print(ds) eval(lm(quote(ds)),parent.frame()) } # define data that will be used in regression y <- 1:10 x <- y+rnorm(10) z <- c(rep(1,5),rep(2,5)) # Show wha

[R] Trying to learn how to write an "advanced" function

2023-03-16 Thread Sorkin, John
match. (1) can someone point me to an explanation of match.call or match that can be understood by the uninitiated? (2) can someone point me to a document that will help me learn how to write an "advanced" function? Thank you, John > lm function (formula, data, subset, weights,

[R] Trying to learn how to write a function

2023-03-16 Thread Sorkin, John
I am trying to understand how to write an "advanced" function. To do this, I am examining the code of lm, a small part of the lm code is below. N > lm function (formula, data, subset, weights, na.action, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, c

Re: [R] tcl tk: set the position button

2023-03-13 Thread John Fox
Dear Rodrigo, Try tkwm.geometry(win1, "-0+0"), which should position win1 at the top right. I hope this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://socialsciences.mcmaster.ca/jfox/ On 2023-03-12 8:41 p.m., Rodrigo Bad

Re: [R] Shaded area

2023-03-03 Thread John Kane
ps://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- John Kane Kingston ON Canada [[alternative HTML version deleted]] _

Re: [R] Generic Function read?

2023-02-28 Thread John Kane
; __ > 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.htm

Re: [R] MFA variables graph, filtered by separate.analyses

2023-02-21 Thread John Fox
Dear gavin, I think that it's likely that Jim meant the hetcor() function in the polycor package. Best, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://socialsciences.mcmaster.ca/jfox/ On 2023-02-21 5:42 p.m., gavin duley wrote: Hi Jim

Re: [R] Bug in R-Help Archives?

2023-01-27 Thread Sorkin, John
My apologies, I did not mean to be part of the discussion. If there is such a thing as a pocket email (similar to a pocket dial) the email would be classified as a pocket email. John From: R-help on behalf of Rui Barradas Sent: Friday, January 27

Re: [R] return value of {....}

2023-01-15 Thread Sorkin, John
ommended, but can, and should be used when needed. John From: R-help on behalf of avi.e.gr...@gmail.com Sent: Sunday, January 15, 2023 10:53 PM Cc: 'R help Mailing list' Subject: Re: [R] return value of {} Again, John, we are comparing d

Re: [R] return value of {....}

2023-01-15 Thread Sorkin, John
l value that is known to the function, but not passed as a parameter to the function: y <- 2 myNGfunction <- function(a){ cat("a=",a,"b=",b,"\n") y <- a y2 <- y+b cat("y=",y,"y2=",y2,"\n") } # b is a global variable an

Re: [R] return value of {....}

2023-01-15 Thread Sorkin, John
Richard, A slight addition to your code shows an important aspect of R, local vs. global variables: x <- 137 f <- function () { a <- x x <- 42 b <- x list(a=a, b=b) } f() print(x) From: R-help on behalf of Richard O'Keefe

Re: [R] Removing variables from data frame with a wile card

2023-01-15 Thread Sorkin, John
elete,"\n") ColumToDelete # Drop the column whose name starts with "th" newdata2 <- mydata[,-ColumnToDelete] cat("Data frame after droping column whose name is three\n") newdata2 I hope this helps. John From: R-he

Re: [R] Removing variables from data frame with a wile card

2023-01-14 Thread John Kane
___ > >> 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 prov

  1   2   3   4   5   6   7   8   9   10   >