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 a

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

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 u

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 write

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: Sunday,

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
s and 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-p

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

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

2022-09-19 Thread Ebert,Timothy Aaron
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

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. Wh

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

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 th

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

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 4.0

Re: [R] Correlate

2022-08-22 Thread Ebert,Timothy Aaron
im -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 multipl

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 ha

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 inc

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 Je

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

2022-07-15 Thread Ebert,Timothy Aaron
columns mean and what rhyme or reasons decides which 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

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 w

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. https://stackoverflow.com/questions/5233769/practical-limits-of-r-data-frame#:~:text=The%20number%20is%202%5E31,start%20collecting%20

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

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 indicates that ther

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 21

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 Me

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

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

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 conven

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 graph

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 Newmi

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 World

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 E

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 I

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 cran

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

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 loo

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

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

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

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 g

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 1

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 vec

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

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

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

2022-02-08 Thread Ebert,Timothy Aaron
will 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-

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 of

Re: [R] NAs are removed

2022-01-14 Thread Ebert,Timothy Aaron
y, January 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

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 "fract

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

<    1   2