Re: [R] Least error-prone reading of Excel files?

2024-05-16 Thread Ebert,Timothy Aaron
https://www.r-bloggers.com/2021/06/reading-data-from-excel-files-xlsxlsxcsv-into-r-quick-guide/ Excel can hold a great quantity of data. However, I find that it is slow and often crashes when I try to use Excel at large scale. It also grinds my entire system to a halt. At the kb and mb scales I

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

2024-04-22 Thread Ebert,Timothy Aaron
You could have negative indices. There are two ways to do this. 1) provide a large offset. Offset <- 30 for (i in -29 to 120) { print(df[i+Offset])} 2) use absolute values if all indices are negative. for (i in -200 to -1) {print(df[abs(i)])} Tim -Original Message- From: R-help On

Re: [R] seeking help with splicing in R

2024-04-11 Thread Ebert,Timothy Aaron
Whatever you had as HTML was deleted. If that was data we did not get it. 1) manipulate wpi_def_nic2004 and wpi_def_nic2008 first so that the data are compatible, then join them. 2) The full_join statement should explicitly state the columns to join by. Using by=NULL joins by all the columns

Re: [R] split a factor into single elements

2024-04-02 Thread Ebert,Timothy Aaron
g_data) values<-as.integer(levels(mydf$string_data)) for (i in 1:length(values)) { assign(paste("VAR_", i, sep=""), values[i]) } --- snip --- Best, Kimmo to, 2024-03-28 kello 14:17 +, Ebert,Timothy Aaron kirjoitti: > Here are some pieces of working code.

Re: [R] split a factor into single elements

2024-03-28 Thread Ebert,Timothy Aaron
Here are some pieces of working code. I assume you want the second one or the third one that is functionally the same but all in one statement. I do not understand why it is a factor, but I will assume that there is a current and future reason for that. This means I cannot alter the string_data

Re: [R] Initializing vector and matrices

2024-02-29 Thread Ebert,Timothy Aaron
You could declare a matrix much larger than you intend to use. This works with a few megabytes of data. It is not very efficient, so scaling up may become a problem. m22 <- matrix(NA, 1:60, ncol=6) It does not work to add a new column to the matrix, as in you get an error if you try m22[ ,

Re: [R] Trouble reading a UTF-16LE file

2024-02-28 Thread Ebert,Timothy Aaron
Yea, that worked. Thank you. :) From: jim holtman Sent: Wednesday, February 28, 2024 12:52 PM To: Ebert,Timothy Aaron Cc: r-help@r-project.org Subject: Re: [R] Trouble reading a UTF-16LE file [External Email] Try this: > x <- file("C:\\Users\\Jim\\Downloads\\PV2-ch2 -

[R] Trouble reading a UTF-16LE file

2024-02-28 Thread Ebert,Timothy Aaron
The earlier post had an attached text file that did not go through. I hope this link works. I tested it with a coworker, but that is no guarantee. https://uflorida-my.sharepoint.com/:u:/g/personal/tebert_ufl_edu/EXf5u_CtTwJCrhdfTBIPr7wBefZHx4P_suj4wAWb8i8HFA?e=iQawhh Regards, Tim

[R] Trouble reading a UTF-16LE file

2024-02-28 Thread Ebert,Timothy Aaron
Dear R-help, I am having trouble reading a UTF-16LE formatted file. The issue appears to be a byte order mark at the beginning of the file. I have tried readLines(file, encoding='utf-16LE') but that got me [1]"\xff\xfe1" "" "" "" "" "" This is a tab delimited text

[R] Trouble reading a UTF-16LE file

2024-02-28 Thread Ebert,Timothy Aaron
Dear R-help, I am having trouble reading a UTF-16LE formatted file. The issue appears to be a byte order mark at the beginning of the file. I have tried readLines(file, encoding='utf-16LE') but got me [1]"\xff\xfe1" "" "" "" "" "" Regards, Tim

Re: [R] help - Package: stats - function ar.ols

2024-02-23 Thread Ebert,Timothy Aaron
The data came through fine, the program was a miss. Can you paste the program into a ".txt" document like a notepad file and send that? You could also paste it into your email IF your email is configured to send text and NOT html. TIm -Original Message- From: R-help On Behalf Of Pedro

Re: [R] ggarrange & legend

2024-02-05 Thread Ebert,Timothy Aaron
Would something like this help? library(ggplot2) # Create a plot p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + labs(title = "Scatter Plot", x = "Weight", y = "Miles Per Gallon") # Add text at a specific location p + annotate("text", x = min(mtcars$wt) + 23, y = max(mtcars$mpg) -

Re: [R] Truncated plots

2024-01-09 Thread Ebert,Timothy Aaron
It would help to have reproducible code. Use dummy data for confidentiality (if you care about that). My guess is that you set margins somewhere and never returned them to a default value. The first thing I would try is to open a new window in RStudio, copy the smallest piece of code that will

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

2023-12-12 Thread Ebert,Timothy Aaron
That depends on how exactly everything must match your primary question. The ecology group might be helpful for how biodiversity changes with proximity to a smokestack. They might have a better idea if the smokestack was from a coal fired powerplant or oil refinery. The modeling process would

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-12 Thread Ebert,Timothy Aaron
Change year to a factor. Doing it in ggplot will not change the original data. ggplot(df, aes(x = as.factor(year), y = score)) + geom_point() + geom_smooth(method = "lm", formula = y ~ x) + labs(title = "Standard linear regression for France", x = "Year", y = "PISA score in mathematics") +

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

2023-12-07 Thread Ebert,Timothy Aaron
Look at the lubridate package in R. Regards, Tim -Original Message- From: R-help On Behalf Of Sorkin, John Sent: Thursday, December 7, 2023 11:22 AM To: r-help@r-project.org (r-help@r-project.org) Subject: [R] Convert character date time to R date-time variable. [External Email]

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

2023-12-02 Thread Ebert,Timothy Aaron
Would this work in general? Say I have a document with figures, special equations, text, and tables. The text and tables are relatively easy. The figures would need a conversion from pixels to lines, and the equations maybe printed out, counted as a figure, and then added to the line count. It

Re: [R] t.test with Welch correction is ambiguous

2023-11-27 Thread Ebert,Timothy Aaron
Your solution was educational. Thank you. I have two comments. 1) If you do not provide both options then you are forcing people to conform to your approach. In general I disapprove, but for specific cases I can see advantages. 2) Without reading the relevant papers (and possibly understanding

Re: [R] Bug in print for data frames?

2023-10-26 Thread Ebert,Timothy Aaron
The "problem" goes away if you use x$C <- y[1,] If you have another row in your x, say: x <- data.frame(A=c(1,4), B=c(2,5), C=c(3,6)) then your code x$C <- y[1] returns an error. If y has the same number of rows as x$C then R has the same outcome as in your example. It looks like your code

Re: [R] Problem with compatible library versions

2023-10-11 Thread Ebert,Timothy Aaron
Is that a method where a program that I write today would still run without changes in 10 years? Tim -Original Message- From: R-help On Behalf Of Richard O'Keefe Sent: Wednesday, October 11, 2023 8:08 AM To: Uwe Ligges Cc: r-help@r-project.org Subject: Re: [R] Problem with compatible

Re: [R] Question about R software and output

2023-10-03 Thread Ebert,Timothy Aaron
I would answer "local files only," but with sufficient motive it is possible for some people to abuse a system. Base R does not download any of your data. The packages that I know about do not download data. You can add a layer of protection by only downloading directly from the source rather

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

2023-09-30 Thread Ebert,Timothy Aaron
In this sort of post it would help if we knew the package that was being used for the example. I found one option. https://cran.r-project.org/web/packages/pivottabler/vignettes/v00-vignettes.html There may be a way to create a custom data type that would be a date but restricted to a -mm

Re: [R] replace character by numeric value

2023-09-29 Thread Ebert,Timothy Aaron
uot;))] or vals <- c(BUY=1, SELL = -1) vals[side] On 2023-09-29 9:21 a.m., Ebert,Timothy Aaron wrote: > Does this work? > mynewdf$side <- as.numeric(mynewdf$side) > > This code would be the next line after your mutate. > > TIm > > -Original Message- > From:

Re: [R] replace character by numeric value

2023-09-29 Thread Ebert,Timothy Aaron
Does this work? mynewdf$side <- as.numeric(mynewdf$side) This code would be the next line after your mutate. TIm -Original Message- From: R-help On Behalf Of Enrico Schumann Sent: Thursday, September 28, 2023 3:13 AM To: arnaud gaboury Cc: r-help Subject: Re: [R] replace character by

Re: [R] How to fix this problem

2023-09-25 Thread Ebert,Timothy Aaron
An update please: Collectively we have suggested removing commas from the "E..coli" column, checking for different forms of "NA", and looking outside the dataset for e-trash (spaces, text, or other content). For removing commas, I would use global replace to ensure that all commas were removed

Re: [R] Odd result

2023-09-24 Thread Ebert,Timothy Aaron
I tend to keep data in Excel. The reason is that I can keep data and analysis output in one file. A part of this is that I tend to use SAS where I get abundant output. One way that this type of result happens is with junk in the file. Someone might put a space in a cell or a period. Such

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-14 Thread Ebert,Timothy Aaron
Why insist on agricolae? Here is an example using multcompiew https://r-graph-gallery.com/84-tukey-test.html You have the same question posted to stackoverflow. https://stackoverflow.com/questions/77090467/graph-in-r-with-grouping-letters-from-the-tukey-lsd-duncan-test-with-agricolae I searched

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
t the date (say Day). Group_by the day and apply a max function to the grouped data. Then plot the result. Tim -Original Message- From: Kevin Zembower Sent: Wednesday, September 13, 2023 3:26 PM To: Ebert,Timothy Aaron ; Richard O'Keefe Cc: r-help@r-project.org Subject: Re: [R] Help wit

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
larger cities (Duluth, International Falls, Thunder Bay) and take a metal average. There is a lake effect for two of these more than the other. All good? Tim -Original Message- From: Kevin Zembower Sent: Wednesday, September 13, 2023 2:05 PM To: Ebert,Timothy Aaron

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
: Wednesday, September 13, 2023 1:22 PM To: Richard O'Keefe ; Ebert,Timothy Aaron Cc: r-help@r-project.org Subject: Re: [R] Help with plotting and date-times for climate data [External Email] Tim, Richard, y'all are reading too much into this. I believe that TMAX is the high temperature of the day

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Ebert,Timothy Aaron
+"turkey test +"mean comparison" 84 hits in google scholar. There is an aphid "Aphis gossypii." Some people have changed this to "Apis gossypii." "Apis" is a genus for bees, and there is no critter named "Apis gossypii." However there are 45 papers in google scholar suffering from this malady.

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
I had the same question. However, I can partly answer the off-topic question. Min and max can be important as lower and upper development thresholds. Below the min no growth or development occur because reaction rates are too slow to enable such. Above max, temperatures are too hot. Protein

Re: [R] prop.trend.test

2023-09-08 Thread Ebert,Timothy Aaron
Say I have one machine that produces 15 million widgets per day. Every day a few widgets are defective. Is the proportion increasing? The data analyst needs to know what time span is of interest. I assume that there is some day-to-day variability. Is today's defect rate greater or less than

Re: [R] prop.trend.test

2023-09-07 Thread Ebert,Timothy Aaron
The example is the example in the documentation for the method. There were no details. https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/prop.trend.test More documentation would be useful. Answering questions like what are these numbers? As shown, I see a cluster of three

Re: [R] Finding combination of states

2023-09-07 Thread Ebert,Timothy Aaron
;, repeats = FALSE) > > >> [1] "BCAE" "BDAE" "BEAE" "BABE" "BCBE" "BDBE" "BEBE" "BACE" > > >> [9] "BDCE" "BECE" "BADE" "BCDE" "BEDE" > > >

Re: [R] Finding combination of states

2023-09-04 Thread Ebert,Timothy Aaron
Does this work for you? t0<-t1<-t2<-LETTERS[1:5] al2<-expand.grid(t0, t1, t2) al3<-paste(al2$Var1, al2$Var2, al2$Var3) al4 <- gsub(" ", "", al3) head(al3) Tim -Original Message- From: R-help On Behalf Of Eric Berger Sent: Monday, September 4, 2023 10:17 AM To: Christofer Bogaso Cc:

Re: [R] How to create an R input

2023-08-31 Thread Ebert,Timothy Aaron
Add a break. Something like: If (is.character(x)) break If you have nested loops then a similar statement is needed for each level. "break" only exits the innermost loop. Tim -Original Message- From: R-help On Behalf Of Jeff Reichman Sent: Wednesday, August 30, 2023 9:46 PM To:

Re: [R] Questions about R

2023-08-17 Thread Ebert,Timothy Aaron
When I installed R no personally identifiable information was given, none was requested. There is no login, so no password or user name. R resides on the host computer, so security is the responsibility of the owner(s) of that computer. There are packages and other third party programs, but

Re: [R] Puzzled by results from base::rank()

2023-08-11 Thread Ebert,Timothy Aaron
I have entered values into Excel, and sorted them. I am assuming you are asking why the value 3 in x2 is ranked 4.5 versus in x5 it has a rank of 5. X2 looks like this Value RankOrder 1 1.5 1 1 1.5 2 2 3 3 3 4.5 4 3 4.5 5 4 6 6

Re: [R] Stacking matrix columns

2023-08-06 Thread Ebert,Timothy Aaron
You could use a for loop in a brute force approach. -Original Message- From: R-help On Behalf Of Rui Barradas Sent: Sunday, August 6, 2023 7:37 PM To: Iris Simmons ; Steven Yen Cc: R-help Mailing List Subject: Re: [R] Stacking matrix columns [External Email] Às 01:15 de 06/08/2023,

Re: [R] Style guide when using "R" in a title

2023-07-27 Thread Ebert,Timothy Aaron
I did a google search for "R books" and looked at the R in the titles. There is no consistency except it is always an upper case letter. Serif, white R on red: "R for Data Science" and again "R Packages." Given a common author this is a Hadley Wickham style. Sans-serif, black R on cream and a

Re: [R] Off-topic: ChatGPT Code Interpreter

2023-07-18 Thread Ebert,Timothy Aaron
Lemon' ; Ebert,Timothy Aaron Cc: 'R-help' Subject: RE: [R] Off-topic: ChatGPT Code Interpreter [External Email] Jim, I am not sure what your example means but text to image conversion can be done quite easily in many programming environments and does not need an AI unless you are using

Re: [R] Off-topic: ChatGPT Code Interpreter

2023-07-17 Thread Ebert,Timothy Aaron
This seems spot on, given that Paul Bernal just posted a request to fit all possible models and compare them using r-squared. The all models approach does not promote understanding about what your model is saying about the data and how the system works. Nor does it facilitate fitting the

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

2023-07-03 Thread Ebert,Timothy Aaron
At least on my system string has a single value of " xxx1 xxx2" not "xxx1" and "xxx2". The variable zzz has two values: "J K xxx1" and "J K xxx2" What you want is "J", "K", "xxx1", "xxx2" If I cheat everything works. So then the goal is to rewrite the program so cheating is not needed. #

Re: [R] Plotting factors in graph panel

2023-06-29 Thread Ebert,Timothy Aaron
Reposting the data did not help. We do not like to guess, and doing so takes a great deal of time that is likely wasted. Rows are observations. Columns are variables. In Excel, the first row will be variable names and all subsequent rows will be observations. Income is the first variable. It

Re: [R] Help sourcing datasets (.csv)

2023-06-02 Thread Ebert,Timothy Aaron
Another suggestion: The statistics does not care where the numbers come from. The values 1, 2, 3 have a mean of 2 no matter if these are weights of a bird, plant heights, or concrete tensile strength. Your interpretation might change, but the mean is still 2. Try synthetic data.

Re: [R] Question about implementing statistical test in R

2023-05-03 Thread Ebert,Timothy Aaron
Start with defining your dependent variable and independent variable(s). As an equation like y equals some function of x, the y is the dependent variable. It is often continuous, but does not have to be. If your continuous variable is the dependent variable and you have one categorical

Re: [R] Reg: Help regarding ggplot2

2023-05-02 Thread Ebert,Timothy Aaron
Reorganize the data so that you have three columns Something more like this: Date Country Value 2005-01-03 Crepub1.21 You ggplot statement has a mistake. The geom_line() should be outside the ggplot() call. You might then have a ggplot statement like

Re: [R] Error on using Confint function to calculate 95% CI

2023-04-26 Thread Ebert,Timothy Aaron
Are the numbers you provided multiple estimates of one coefficient or are they one estimate each of over 20 coefficients? -Original Message- From: R-help On Behalf Of Michael Dewey Sent: Wednesday, April 26, 2023 5:14 AM To: bharat rawlley ; r-help@R-project.org Subject: Re: [R] Error

Re: [R] diamonds data set from ggplot2

2023-04-25 Thread Ebert,Timothy Aaron
Thank you for sharing the paper. Tim -Original Message- From: R-help On Behalf Of Hadley Wickham Sent: Tuesday, April 25, 2023 9:44 AM To: Sigbert Klinke Cc: r-help@r-project.org Subject: Re: [R] diamonds data set from ggplot2 [External Email] On Tue, Apr 25, 2023 at 4:09 AM Sigbert

Re: [R] Circular plot - polar plot code questions

2023-04-24 Thread Ebert,Timothy Aaron
1) If you do not need it do not plot it. However, also consider how others will use your content. Might it be a trivial piece of information for you, but a critical piece of information for someone trying to use your content. A meta analysis, or just wanting to try to relate your outcomes to

Re: [R] detect and replace outliers by the average

2023-04-21 Thread Ebert,Timothy Aaron
Sometimes outliers happen. No matter the sample size there is always the possibility that one or more values are correct though highly improbable. -Original Message- From: R-help On Behalf Of Richard O'Keefe Sent: Friday, April 21, 2023 7:31 PM To: AbouEl-Makarim Aboueissa Cc: R

Re: [R] AIc and BIC in caret...

2023-04-19 Thread Ebert,Timothy Aaron
I searched for "caret AIC package r" and found this: https://stats.stackexchange.com/questions/443286/r-interpreting-output-of-carettrain-with-method-glmstepaic My guess (without having used it) is that this uses AIC in a stepwise model building approach. -Original Message- From: R-help

Re: [R] Simple Stacking of Two Columns

2023-04-04 Thread Ebert,Timothy Aaron
Originally this post was to just look at execution times for different approaches to solving this problem. Now I have a question: I change the code for calculating a1 from c(c1, c2) to data.frame(c(c1,c2)). This changes the execution times of all the other variables. What am I missing?

Re: [R] Simple Stacking of Two Columns

2023-04-03 Thread Ebert,Timothy Aaron
Combined, the answers are close to an example in the documentation for microbenchmark where they (in part) look at execution times for c() versus append(). Here is the code, but c() has the shortest execution time in this example. If I remove a3 and a4 then c() is significantly shorter than

Re: [R] Should help of estimate in t.test be corrected?

2023-04-03 Thread Ebert,Timothy Aaron
IMHO The difference makes sense for paired samples. For unpaired samples it is just the difference in means. I think presenting the means (and assuming the audience can perform subtraction) conveys more information. The interpretation of a difference of 5 might be influenced if I have means of

Re: [R] Simple Stacking of Two Columns

2023-04-03 Thread Ebert,Timothy Aaron
My first thought was pivot_longer, and stack() is new to me. How about append(c1,c2) as another solution? Or data.frame(append(c1,c2)) if you want that form. Tim -Original Message- From: R-help On Behalf Of Marc Schwartz via R-help Sent: Monday, April 3, 2023 11:44 AM To: Sparks,

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

2023-03-22 Thread Ebert,Timothy Aaron
If you are open to other options: The null hypothesis is that there is no difference. If I have two equations y=x and y=z and there is no difference then it would not matter if an observation was from x or z. Randomize the x and z observations. For each randomization calculate a

Re: [R] Good Will Legal Question

2023-03-21 Thread Ebert,Timothy Aaron
My guess: It I clear from the link that they can use the R logo for commercial purposes. The issue is what to do about the "appropriate credit" and "link to the license." How would I do that on a hoodie? Would they need a web address or something? -Original Message- From: R-help On

Re: [R] identify the distribution of the data

2023-02-08 Thread Ebert,Timothy Aaron
IMO) The best approach is to develop a good understanding of the individual processes that resulted in the observed values. The blend of those processes then results in the distribution of the observed values. This is seldom done, and often not possible to do. The alternatives depend on why you

Re: [R] question

2023-01-31 Thread Ebert,Timothy Aaron
ferent than Month 12. Tim From: Carolyn J Miller Sent: Tuesday, January 31, 2023 9:30 AM To: PIKAL Petr ; r-help@r-project.org; Ebert,Timothy Aaron Subject: Re: question [External Email] Hi Timothy, Here's some example data that might help to demonstrate how the data currently looks. Anim

Re: [R] question

2023-01-30 Thread Ebert,Timothy Aaron
Can you please show us a small sample of your data? The first 5 or 10 lines should be good enough. Tim -Original Message- From: R-help On Behalf Of Carolyn J Miller via R-help Sent: Monday, January 30, 2023 1:16 PM To: r-help@r-project.org Subject: [R] question [External Email] Hi

Re: [R] as.factor and floating point numbers

2023-01-25 Thread Ebert,Timothy Aaron
Another option is to convert all times to base units or the sample rate from the analog-to-digital converter. If this is 100 milliseconds then use milliseconds rather than fractions of an hour or day. This approach might not help if the range in values spans more than 16 digits: slightly finer

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Ebert,Timothy Aaron
This is a poster child for why we like open source software. "I dump numbers into a black box and get numbers out but I cannot verify how the numbers out were calculated so they must be correct" approach to analysis does not really work for me. Tim -Original Message- From: R-help On

Re: [R] Date order question

2023-01-04 Thread Ebert,Timothy Aaron
1) Your "dates" are not being processed as dates. They are strings. 2) As written your date "01-01" comes first because year is not specified and January comes before December. 3) A library statement is missing. I tried running the program and theme_cowplot() was not found. As you are plotting

Re: [R] Pipe operator

2023-01-03 Thread Ebert,Timothy Aaron
not tidy up after each task. If you wanted to test execution times for bits of code there is the microbenchmark package. Tim -Original Message- From: Sorkin, John Sent: Tuesday, January 3, 2023 12:13 PM To: Ebert,Timothy Aaron ; 'R-help Mailing List' Subject: Re: Pipe operato

Re: [R] Pipe operator

2023-01-03 Thread Ebert,Timothy Aaron
The pipe shortens code and results in fewer variables because you do not have to save intermediate steps. Once you get used to the idea it is useful. Note that there is also the |> pipe that is part of base R. As far as I know it does the same thing as %>%, or at my level of programing I have

Re: [R] Amazing AI

2022-12-18 Thread Ebert,Timothy Aaron
It would help students formulate a plan for coding. Successful students will be able to give good directions that the AI can turn into good code. This skill is essential no matter who writes the program. In more advanced classes I might collect some data sets designed to cause the AI problems.

Re: [R] Plot a line using ggplot2

2022-12-08 Thread Ebert,Timothy Aaron
A number of problems. The variable names are not helpful. PointEstx is not a point it is a value. I need an x and a y coordinate for a point. row1 is not defined While there is a function data.frame(), there is no data_frame(). Making this change gives an error that row1 is not defined. I solved

Re: [R] What is new in R especially about Tidyverse.

2022-11-27 Thread Ebert,Timothy Aaron
I suggest starting with a browser (I used Google), and search for "Tidyverse". Some pages there should help. I would check out the github link. Before going too far I would also check out the Wikipedia page, and the references cited therein. Using key words from these resources and using

Re: [R] (no subject)

2022-11-25 Thread Ebert,Timothy Aaron
1) Any HTML content you intended to share did not make it past the filters. All I get is [[alternative HTML version deleted] 2) AIC is for comparing models where lower AIC indicates a better model, though please see a statistics reference for additional details. No models were presented. 3)

Re: [R] test logistic regression model

2022-11-20 Thread Ebert,Timothy Aaron
I like option 1. Option 2 may cause problems if you are pooling groups that do not go together. This is especially a problem if you know that the data is missing some groups. I would consider dropping rare groups - or compare results between pooling and dropping options. If the answer is the

Re: [R] Initial value choosing in nleqslv package

2022-11-15 Thread Ebert,Timothy Aaron
I would suggest treating initial values as hyperparameters. Try a range of values to understand how your choice influences your outcome. Plot the result. Eventually (I hope) you will get a feel for the right answer for your specific type of data and you will be able to reduce the time needed

Re: [R] Logistic regression for large data

2022-11-12 Thread Ebert,Timothy Aaron
Hi George, I did not get an attachment. My first step would be to try simplifying things. Do all of these work? fit_1=glm(Base[,2]~Base[,1],family=binomial(link="logit")) fit_1=glm(Base[,2]~Base[,10],family=binomial(link="logit")) fit_1=glm(Base[,2]~Base[,11],family=binomial(link="logit"))

Re: [R] Plotting a triangular prism

2022-11-11 Thread Ebert,Timothy Aaron
Hi Erin, Note that the HTML version was deleted in RHelp. Whatever was there was not seen by anyone else. Not sure this is what you want, but try "mixture designs in R" as a google search. There are a number of options therein. Regards, Tim -Original Message- From: R-help On

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
Dear Akshay, I think we have provided several solutions to the question asked. Can you please adjust your question to more closely align with what you need. It would be nice if you can provide sufficient detail so that we can see how you have adapted our solutions and how these have not

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
Another option is use paste() within print() lapply(TP,function(x){print(paste("x= ",x, " x^2 = ", x^2))}) Tim -Original Message- From: R-help On Behalf Of Andrew Simmons Sent: Monday, November 7, 2022 12:21 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] print and

Re: [R] unexpected 'else' in " else"

2022-10-28 Thread Ebert,Timothy Aaron
I appreciate this thread on coding. My preference for reading is to have complete sentences. I can read this: { if (x On Behalf Of Jorgen Harmse via R-help Sent: Friday, October 28, 2022 10:39 AM To: r-help@r-project.org Subject: Re: [R] unexpected 'else' in " else" [External Email] Richard

Re: [R] Function for Distribution Fitting

2022-10-26 Thread Ebert,Timothy Aaron
If you have three values, then it should be possible to fit any number of distributions such that they could return those three values. On the other hand, if you have billions of values and insist on a perfect fit then you may have a unique distribution only identified by the data in hand. For

Re: [R] unexpected 'else' in " else"

2022-10-21 Thread Ebert,Timothy Aaron
Message- From: Martin Maechler Sent: Friday, October 21, 2022 8:43 AM To: Ebert,Timothy Aaron Cc: Andrew Simmons ; Jinsong Zhao ; R-help Mailing List Subject: Re: [R] unexpected 'else' in " else" [External Email] >>>>> Ebert,Timothy Aaron >>>>> o

Re: [R] unexpected 'else' in " else"

2022-10-21 Thread Ebert,Timothy Aaron
I can get it to work with ifelse(is.matrix(r), r[w!=0, , drop=FALSE], r[w!=0]) With w and r as defined r is not a matrix, so the first part will never execute. The test is for w not equal to zero so it is always true for these vectors. It is usually good to have test code such that all

Re: [R] statistical error in ggerrorplot argument desc_statby

2022-10-18 Thread Ebert,Timothy Aaron
While I agree that S.E. and S.D. are sometimes confused I disagree that the definition and use must be rehashed in every package that uses either one. The programmer (and documentation writer) makes tools available. If they do a good job with documentation then it is more likely that the tool

Re: [R] prcomp - arbitrary direction of the returned principal components

2022-10-13 Thread Ebert,Timothy Aaron
2]). In debugging or trouble shooting setting seed is useful. For actual data analysis you should not set seed, or possibly better yet use set.seed(NULL). Tim -Original Message- From: Ashim Kapoor Sent: Thursday, October 13, 2022 12:28 AM To: Ebert,Timothy Aaron Cc: R Help Subjec

Re: [R] prcomp - arbitrary direction of the returned principal components

2022-10-12 Thread Ebert,Timothy Aaron
Use absolute value Tim -Original Message- From: R-help On Behalf Of Ashim Kapoor Sent: Wednesday, October 12, 2022 7:48 AM To: R Help Subject: [R] prcomp - arbitrary direction of the returned principal components [External Email] Dear R experts, >From ?prcomp, snip - Note:

Re: [R] ggplot2 install.package

2022-10-10 Thread Ebert,Timothy Aaron
Can you please provide us with a copy of the error msg? I have used ggplot2 with R 4.2.1, and probably R 4.2.0 in RStudio on Windows 11 and not had trouble. You might need to update R, or RStudio. R and RStudio need to be compatible versions. Tim -Original Message- From: R-help On

Re: [R] Ids with matching number combinations?

2022-10-07 Thread Ebert,Timothy Aaron
Would an inner_join work? If not, please describe why so that we can improve our answer. This answer requires the dplyr package. https://statisticsglobe.com/r-dplyr-join-inner-left-right-full-semi-anti Regards, Tim -Original Message- From: R-help On Behalf Of PIKAL Petr Sent: Friday,

Re: [R] Robust standard error

2022-10-02 Thread Ebert,Timothy Aaron
Most computer code will take a pile of numbers and return a pile of numbers. Reading the documentation should help you figure out where each measure is appropriate. It all depends on the purpose of a specific method and its assumptions and how those relate to your data, application, and model

Re: [R] Reading very large text files into R

2022-09-30 Thread Ebert,Timothy Aaron
ity. For very large files, though, having multiple > variations in memory at once may be an issue, especially if they are > not removed and further processing and analysis continues. > > Perhaps it might be sensible to contact those maintaining the data and > point out the anomaly

Re: [R] Reading very large text files into R

2022-09-30 Thread Ebert,Timothy Aaron
an be used without anomalies. Avi -Original Message- From: R-help On Behalf Of Ebert,Timothy Aaron Sent: Friday, September 30, 2022 7:27 AM To: Richard O'Keefe ; Nick Wray Cc: r-help@r-project.org Subject: Re: [R] Reading very large text files into R Hi Nick, Can you post one line of da

Re: [R] Reading very large text files into R

2022-09-30 Thread Ebert,Timothy Aaron
Hi Nick, Can you post one line of data with 15 entries followed by the next line of data with 16 entries? Tim -Original Message- From: R-help On Behalf Of Richard O'Keefe Sent: Friday, September 30, 2022 12:08 AM To: Nick Wray Cc: r-help@r-project.org Subject: Re: [R] Reading very

Re: [R] How long does it take to learn the R programming language?

2022-09-29 Thread Ebert,Timothy Aaron
Learning R takes an hour. Find an hourglass, flip it over. Meanwhile we will start increasing the size of the upper chamber and adding more sand. Mastery of R is an asymptotic function of time. While such answers might indicate trying for mastery is futile, you can learn enough R to be very

Re: [R] How long does it take to learn the R programming language?

2022-09-27 Thread Ebert,Timothy Aaron
It depends on what you mean by learn, and the final goal. It also depends on your starting point. "Computer literacy" is poorly defined. Finally, it depends on the quality of instruction, your innate ability to learn this skill, and the time you can devote to this task. You will be able to

Re: [R] Ecological Detective worked solutions [R-wiki]

2022-09-26 Thread Ebert,Timothy Aaron
Hi Jada, Just so you know: I tried the link, but my system responded that it would not find that page. I got a note in the email that the HTML version was deleted. (That is expected given guidelines for posting) Tim -Original Message- From: R-help On Behalf Of Jada Daniels Sent:

Re: [R] Need help plotting

2022-09-21 Thread Ebert,Timothy Aaron
Yes, but if you want to learn R (or relearn R) it would be better for you to decompress the code. You know what b looks like so add the next step. If you want to be able to see the original then save the output to another data frame. New_df <- b %>% mutate(Dtime = paste(Sys.Date(), Dtime),

Re: [R] Write text file in Fortran format

2022-09-21 Thread Ebert,Timothy Aaron
This post was empty. Tim From: R-help On Behalf Of javad bayat Sent: Wednesday, September 21, 2022 2:09 AM To: R-help@r-project.org Subject: [R] Write text file in Fortran format [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Need help plotting

2022-09-20 Thread Ebert,Timothy Aaron
Have you done something like this first? install.packages("chron") After that comes library(chron) and the rest of your code. Tim -Original Message- From: R-help On Behalf Of Bert Gunter Sent: Tuesday, September 20, 2022 11:57 AM To: Parkhurst, David Cc: r-help@r-project.org Subject:

Re: [R] Question concerning side effects of treating invalid factor levels

2022-09-20 Thread Ebert,Timothy Aaron
the numeric value to the numeric variable. Keeping in mind that a vector can only be of one class will save you many debugging hours later on. Tim -----Original Message- From: Sarah Goslee Sent: Tuesday, September 20, 2022 9:02 AM To: tibor.k...@rub.de Cc: Ebert,Timothy Aaron ; r-help@r-projec

Re: [R] Need help plotting

2022-09-19 Thread Ebert,Timothy Aaron
David, Do these work for you? (I am resending this so others can see. The original only went to you.) library(lubridate) a<-c(4, 5, 6) b<-c("18:00", "18:01", "18:02") c<-as.data.frame(cbind(a,b)) c$d<-hm(c$b) c$d$minute[2] I could do it manually like this (where FrHour is fractional hour)

Re: [R] Question concerning side effects of treating invalid factor levels

2022-09-19 Thread Ebert,Timothy Aaron
his to your original df and finds that it must add a character to a numeric vector. To keep the vector of all the same class it converts everything to character. Better? Tim From: tibor.k...@rub.de Sent: Monday, September 19, 2022 8:07 AM To: Ebert,Timothy Aaron Cc: r-help@r-project.org Subject: Re:

Re: [R] Need help plotting

2022-09-19 Thread Ebert,Timothy Aaron
My version of this email has a bunch of ? that I do not know how to interpret. Emails to this group need to be in plain text. HTML content is deleted or converted and impossible or at least difficult to interpret. Do not share confidential data. Please change some numbers or variable names and

  1   2   >