Re: [R] Save a graph file use jpeg(file=file)

2022-01-05 Thread Ebert,Timothy Aaron
The simple solution for Windows is to use (windows icon) + shift + s. You then select a portion of your screen and it gets copied to your clipboard. You can then paste that into your document. Of course this will not work if it is important that the reader is able to rotate the graphic. Tim

Re: [R] conditional filling of data.frame - improve code

2022-03-10 Thread Ebert,Timothy Aaron
You could try some of the "join" commands from dplyr. https://dplyr.tidyverse.org/reference/mutate-joins.html https://statisticsglobe.com/r-dplyr-join-inner-left-right-full-semi-anti Regards, Tim -Original Message- From: R-help On Behalf Of Jeff Newmiller Sent: Thursday, March 10, 2022

Re: [R] Convert a character string to variable names

2022-02-12 Thread Ebert,Timothy Aaron
How does “a value” differ from “an object?” From: Richard O'Keefe Sent: Friday, February 11, 2022 12:25 AM To: Ebert,Timothy Aaron Cc: Jeff Newmiller ; r-help@r-project.org; Erin Hodgess Subject: Re: [R] Convert a character string to variable names [External Email] You wrote "32 nu

Re: [R] confusion matrix like detail with continuous data?

2022-02-16 Thread Ebert,Timothy Aaron
In your prediction you will have a target level of accuracy. Something like "I need to predict the slope of the regression to within 1%." You break your data into a training and testing data sets, then for the testing data set you ask is the prediction within 1% of the observed value. That is

Re: [R] Problem with data distribution

2022-02-17 Thread Ebert,Timothy Aaron
You pipe the filter but do not save the result. A reproducible example might help. Tim -Original Message- From: R-help On Behalf Of Neha gupta Sent: Thursday, February 17, 2022 1:55 PM To: r-help mailing list Subject: [R] Problem with data distribution [External Email] Hello everyone

Re: [R] Problem with data distribution

2022-02-17 Thread Ebert,Timothy Aaron
; > > > > > This can be copied into an R session and the data set recreated > > > with > > > > > > data <- structure(etc) > > > > > > > > > Now the boxplots. > > > > > > (Why would you want to plot a vect

Re: [R] How important is set.seed

2022-03-22 Thread Ebert,Timothy Aaron
difference. Random.org might be another place for the OP to explore. Tim -Original Message- From: Bert Gunter Sent: Tuesday, March 22, 2022 12:12 PM To: Neha gupta Cc: Ebert,Timothy Aaron ; r-help@r-project.org Subject: Re: [R] How important is set.seed [External Email] OK, I'm somewh

Re: [R] How important is set.seed

2022-03-22 Thread Ebert,Timothy Aaron
way to address this is to characterize the distribution of model outcomes from different runs with different random seeds. Examine that characterization and hope for understanding. Tim From: Bert Gunter Sent: Tuesday, March 22, 2022 2:03 PM To: Ebert,Timothy Aaron Cc: Neha gupta ; r-help@r

Re: [R] How important is set.seed

2022-03-22 Thread Ebert,Timothy Aaron
:03 PM To: Ebert,Timothy Aaron Cc: Jeff Newmiller ; r-help@r-project.org Subject: Re: How important is set.seed [External Email] Thank you again Tim d=readARFF("my data") set.seed(123) tr <- d[index, ] ts <- d[-index, ] ctrl <- trainControl(method = "repeatedc

Re: [R] How important is set.seed

2022-03-21 Thread Ebert,Timothy Aaron
If you are using the program for data analysis then set.seed() is not necessary unless you are developing a reproducible example. In a standard analysis it is mostly counter-productive because one should then ask if your presented results are an artifact of a specific seed that you selected to

Re: [R] [External] Weird behaviour of order() when having multiple ties

2022-01-31 Thread Ebert,Timothy Aaron
Dat1 <- c(0.6, 0.5, 0.3, 0.2, 0.1, 0.1, 0.2) print(order(Dat1)) print(sort(Dat1)) Compare output -Original Message- From: R-help On Behalf Of Martin Maechler Sent: Monday, January 31, 2022 9:04 AM To: Stefan Fleck Cc: r-help@r-project.org Subject: Re: [R] [External] Weird behaviour

Re: [R] Convert a character string to variable names

2022-02-08 Thread Ebert,Timothy Aaron
keep that in mind. I agree that it makes life much easier to enter the data in the way it will be analyzed. -Original Message- From: Jeff Newmiller Sent: Tuesday, February 8, 2022 10:10 PM To: r-help@r-project.org; Ebert,Timothy Aaron ; Richard O'Keefe ; Erin Hodgess Cc: r-help@r-pro

Re: [R] NAs are removed

2022-01-14 Thread Ebert,Timothy Aaron
14, 2022 5:11 PM To: Ebert,Timothy Aaron Cc: Jim Lemon ; r-help mailing list Subject: Re: [R] NAs are removed [External Email] I have a variable in dataset "CA", which has the following values: [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [40] 1

Re: [R] NAs are removed

2022-01-14 Thread Ebert,Timothy Aaron
Hi Neha, You used a variable named "fraction" so we took a guess. However, as another pointed out 1/0 does not give NA in R. number/0 returns Inf except 0/0 which returns NaN. So 1/0 <= 1 returns FALSE and 0/0 <= 1 returns NA. A great deal of the behavior of your program hinges on what

Re: [R] What is the intended behavior, when subsetting using brackets [ ], when the subset criterion has NA's?

2022-04-06 Thread Ebert,Timothy Aaron
I get an error with this: my_subset_criteria <- c( F, F, T, NA, NA) my_subset_criteria Tim -Original Message- From: R-help On Behalf Of Kelly Thompson Sent: Wednesday, April 6, 2022 4:13 PM To: r-help@r-project.org Subject: [R] What is the intended behavior, when subsetting using

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] 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] 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
: 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] 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
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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] R Code Execution taking forever

2022-04-24 Thread Ebert,Timothy Aaron
1) Does it run perfectly with num_tirals_6 <- 100 ? 2) Rework the code to remove as much as possible from loops. Renaming column names each time through the loop seems pointless. Is the nested for loops converting the dice roll to person name necessary within the while

Re: [R] Confusing fori or ifelse result in matrix manipulation

2022-04-25 Thread Ebert,Timothy Aaron
A <- matrix(1:9,ncol=3) x <- c(0,1,0) M <- matrix(ncol=3,nrow=3) M<-A for(i in 1:3) { if(x[i]){ M[,i] <-0 } } } M The outcome you want is to set all of the middle column values to zero. So I used x as a logical in an if test and when true everything in that column is set to zero.

Re: [R] R and .asc file extension

2022-05-20 Thread Ebert,Timothy Aaron
A google search returned a stack overflow page that might help. stackoverflow.com/questions/20177581/reading-an-asc-file-into-r (add the https part to get a functional link.) I would also try looking at the file using something like notebook, or any program that is a plain text editor. That way

Re: [R] Placement of legend in base plot()

2022-05-31 Thread Ebert,Timothy Aaron
I will suggest that if the bty='n' approach works that is a good solution. If you have 50 graphs and they all have the same legend, then put the legend in a common area outside the graphs or in graph 1 (and a comment in the legend or a footnote.) I would be fine with the legend outside the

Re: [R] Unable to install gsynth without life package

2022-05-31 Thread Ebert,Timothy Aaron
You could play with install.versions() from the versions package. https://cran.r-project.org/web/packages/versions/README.html I would try installing versions of both packages from the last time you got them to work together. Tim -Original Message- From: R-help On Behalf Of Jeff

Re: [R] Suggestions as to how to proceed would be appreciated...............

2022-05-22 Thread Ebert,Timothy Aaron
Would lm, nls, or nlme work for what you need? Tim -Original Message- From: R-help On Behalf Of Bernard Comcast Sent: Sunday, May 22, 2022 3:01 PM To: Bert Gunter Cc: R-help@r-project.org Subject: Re: [R] Suggestions as to how to proceed would be appreciated... [External

Re: [R] Restoration of "rite" package of R as R-script editor or the like

2022-05-23 Thread Ebert,Timothy Aaron
Would you reconsider RStudio? If this is a person's first experience with a computer or cell phone then RStudio is a bit much. Relative to using a browser, MSWord, Excel, or many of the modern video games RStudio is simple. I have seen beginning R courses start at the level of print("Hello

Re: [R] Dplyr question

2022-06-21 Thread Ebert,Timothy Aaron
I do not see how to do this with exclusively dplyr commands. I might be able to make it work by including commands outside of dplyr, but at that point I would use pivot_longer() from the tidyr package. Tim -Original Message- From: R-help On Behalf Of Thomas Subia Sent: Tuesday, June

Re: [R] UTF-8 to the console

2022-06-23 Thread Ebert,Timothy Aaron
Print(a\u2248b") gives approximately equal sign. -Original Message- From: R-help On Behalf Of Ebert,Timothy Aaron Sent: Thursday, June 23, 2022 6:48 AM To: Helmut Schütz ; r-help@r-project.org Subject: Re: [R] UTF-8 to the console [External Email] Wikipedia indi

Re: [R] Back transform confidence intervals sjplot (plot_model)

2022-06-23 Thread Ebert,Timothy Aaron
Can one back transform confidence intervals: yes, just like one back transforms other values. Should one back transform confidence intervals: probably not. Even if you applied the log transformation because it fixed problems in the model residuals, it is possible (likely?) that the reason that

Re: [R] A humble request

2022-07-02 Thread Ebert,Timothy Aaron
Would package versions help? It would allow you to install a specific version of wmtsa into R 4.2. Tim -Original Message- From: R-help On Behalf Of Muhammad Zubair Chishti Sent: Saturday, July 2, 2022 12:39 PM To: Spencer Graves ; r-help@r-project.org Subject: Re: [R] A humble request

Re: [R] sqldf returns Error: database or disk is full

2022-06-27 Thread Ebert,Timothy Aaron
Jun 2022 at 23:00, Ebert,Timothy Aaron wrote: I would try answering these questions: 1) What is the expected size? 2) Is the current size smaller or larger? 3) Every program running on your computer takes up memory. Given all the other programs currently running, do you have space? Maybe

Re: [R] High concurvity/ collinearity between time and temperature in GAM predicting deaths but low ACF. Does this matter?

2022-06-05 Thread Ebert,Timothy Aaron
You are welcome to ask here. However, you should try contacting the authors of the gam package. Package authors are often extraordinarily helpful. Tim -Original Message- From: R-help On Behalf Of jade.shodan--- via R-help Sent: Sunday, June 5, 2022 3:02 PM To: r-help@r-project.org

Re: [R] Combining Differnt columns in one single column

2022-06-13 Thread Ebert,Timothy Aaron
t;,"name") ID6 <-as.data.frame(ID_names2) ID6$name<-colnames(ID6) colnames(ID6)<-c("val","name") IDall<-rbind(ID5,ID6) Tim -----Original Message- From: anteneh asmare Sent: Monday, June 13, 2022 4:49 PM To: Ebert,Timothy Aaron Cc: r-help@r-projec

Re: [R] Combining Differnt columns in one single column

2022-06-13 Thread Ebert,Timothy Aaron
lt;-c("name","val") #rename columns to be consistent for all dataframes. ID6 <-as.data.frame(ID_names2) ID6$name<-colnames(ID6) colnames(ID6)<-c("name","val") IDall<-rbind(ID5,ID6) Tim -----Original Message- From: anteneh asmare Sent: Monday,

Re: [R] Create a categorical variable using the deciles of data

2022-06-14 Thread Ebert,Timothy Aaron
Hana, the "right" answer depends on exactly what you need. Here are three correct solutions. They use the same basic strategy to give different results. There are also other approaches in R to get the same outcome. You could use data_catigocal[i,j] and some for loops. size1 <-5 ngroup <-

Re: [R] Rstudio cannot be loaded

2022-06-19 Thread Ebert,Timothy Aaron
Update RStudio through RStudio. In the "help" tab there is a choice "check for updates." This approach will preserve all your files. I use if(!require(package)){install.packages("package")} So that I always install a package I need but only if it is not already installed. Tim -Original

Re: [R] bootstrap CI of the difference between 2 Cramer's V

2022-06-04 Thread Ebert,Timothy Aaron
I would calculate the difference and the CI about that difference. You would not get the same thing by comparing the bootstrap CI of the group means. One use for this is to determine if the confidence interval for the difference in means includes zero. An alternative would be to use a more

Re: [R] Date and Time

2022-07-18 Thread Ebert,Timothy Aaron
An alternative is the lubridate() package if you use tidyverse. Check the data for daylight savings time. Twice per year Virginia changes time where in the Fall clocks are shifted back an hour and in the Spring they jump forwards an hour. -Original Message- From: R-help On Behalf Of

Re: [R] Does the function "c" have a character limit?

2022-07-13 Thread Ebert,Timothy Aaron
The limits to the size of vectors, matrices, data frames, lists, or other data structure does not have a simple answer. 1) 2^31 - 1 is the maximum number of rows.

Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)

2022-07-14 Thread Ebert,Timothy Aaron
Maybe this is too simple but could you use the select() function from dplyr? Tim -Original Message- From: R-help On Behalf Of Bert Gunter Sent: Thursday, July 14, 2022 2:10 PM To: Ian McPhail Cc: R-help Subject: Re: [R] mice: selecting small subset of variables to impute from dataset

Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)

2022-07-15 Thread Ebert,Timothy Aaron
to keep or exclude. A more specific question may get a more specific answer. -Original Message- From: R-help On Behalf Of Ebert,Timothy Aaron Sent: Thursday, July 14, 2022 2:12 PM To: Bert Gunter ; Ian McPhail Cc: R-help Subject: Re: [R] mice: selecting small subset of variables to

Re: [R] Request concerning use in book

2022-07-27 Thread Ebert,Timothy Aaron
My understanding is that the only requirement is to give proper credit. This is necessary anyway as readers would need to know what packages were used and what version of R was used. In R there is the citation() function that returns the approved citation. However, it might be useful to also

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread Ebert,Timothy Aaron
I think what you want is full_join() from the dplyr package. https://www.rdocumentation.org/packages/dplyr/versions/0.7.8/topics/join The only requirement is that both data frames must have a column in common wherein the data are entered in the same way. So the column labeled "state" needs to

Re: [R] Error with text analysis data

2022-04-13 Thread Ebert,Timothy Aaron
Cc: Ebert,Timothy Aaron ; r-help mailing list Subject: Re: Error with text analysis data [External Email] Someone just told me that you need to pre process the data before model construction. For instance, make the text to lower case, remove punctuation, symbols etc and tokenize the text (give

Re: [R] Symbol/String comparison in R

2022-04-13 Thread Ebert,Timothy Aaron
https://en.wikipedia.org/wiki/ASCII There is a table towards the end of the document. Some of the other pieces may be of interest and/or relevant. Tim -Original Message- From: R-help On Behalf Of Kristjan Kure Sent: Wednesday, April 13, 2022 10:06 AM To: r-help@r-project.org Subject:

Re: [R] Is there a canonical way to pronounce CRAN?

2022-05-04 Thread Ebert,Timothy Aaron
It would be nice in some ways if everyone would pronounce the same word in the same way, but then we could not argue over the correct pronunciation of words like tomato or aluminium/aluminum. I think of cran as "Kran". While I had German in high school I didnn't remember the German word for

Re: [R] Convert one rectangle into two rectangles

2022-04-27 Thread Ebert,Timothy Aaron
One thought was that these were farm fields in satellite images. I just had no clue why one would subdivide them. Maybe a training and testing portion of these polygons? At a few dozen meters the curvature might be negligible on a sufficiently large spheroid. If 45-55% split is approximate then

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-24 Thread Ebert,Timothy Aaron
library(dplyr) library(magrittr) dat2<-read.table(text="Code Y M D Q N O 41003 81 1 19 0.16 7.17 2.5 41003 77 9 22 0.197 6.8 2.2 41003 79 7 28 0.21 4.7 6.2 41005 79 8 17 0.21 5.5 7.2 41005 80 10 30 0.21 6.84 2.6 41005 80 12 20 0.21 6.84 2.4 41005 79 6 14 0.217 5.61 3.55 41009 79 2 21 0.218 5.56

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Ebert,Timothy Aaron
I missed where you explained how to choose a minimum value if there are several values within a group that are equal to the minimum value. Here is a dplyr code that returns eight values because there are ties for minimum values in Q. library(dplyr) library(magrittr) dat2<-read.table(text="Code

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Ebert,Timothy Aaron
=MinByCodeQ) dat2<-arrange(dat2,as.numeric(RN)) -Original Message- From: R-help On Behalf Of Ebert,Timothy Aaron Sent: Thursday, August 25, 2022 8:18 AM To: javad bayat ; Rui Barradas Cc: R-help@r-project.org Subject: Re: [R] Getting minimum value of a column according a factor column of a dat

Re: [R] Correlate

2022-08-22 Thread Ebert,Timothy Aaron
Original Message- From: Bert Gunter Sent: Monday, August 22, 2022 12:07 PM To: Ebert,Timothy Aaron Cc: Val ; r-help@R-project.org (r-help@r-project.org) Subject: Re: [R] Correlate [External Email] ... But of course the p-values are essentially meaningless without some sort of multiplicity

Re: [R] confidence intervals

2022-08-28 Thread Ebert,Timothy Aaron
I have a general dislike of "analysis emergencies." I would like to see a data emergency wherein someone must cram 3 years of data collection into 18 months so that they have time to work out the correct analysis. I am sure others would suggest working out how analyze the data before starting

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

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

2022-09-19 Thread Ebert,Timothy Aaron
In your example code, the variable remains a class factor, and all entries are valid. The variables will behave as expected given the factor levels in the original dataframe. (At least on my system R 4.2, in RStudio, in Windows) R returns a couple of error messages warning me that I was bad.

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
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] 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] GIS in R vs QGIS

2022-09-08 Thread Ebert,Timothy Aaron
Do not learn a new software unless you must. I would find a copy of "Geocomputation with R" and skim through it to see if it has figures or chapter/section titles that would suggest that it can do all of the tasks I need. If the answer looks even close to "yes" then I would go that route

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] Interpreting fa.diagram from package psych

2022-09-11 Thread Ebert,Timothy Aaron
It is a bad graphic as the legend that should explain the color coding is missing. The next option is to copy the data and code and see if you can reproduce the figure. You can then play with the code and read a bit about the procedures to figure out what is going on. It should not be too hard.

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] inadequacy in as.integer....

2022-09-11 Thread Ebert,Timothy Aaron
Can you tell us why you want to do this? Is there something special about 09098 versus 9098 or 009098? In any mathematical operation these are all the same number. Tim From: akshay kulkarni Sent: Sunday, September 11, 2022 2:58 PM To: Ebert,Timothy Aaron ; R help Mailing list Subject

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

  1   2   >