Re: [R] Mathematical working procedure of imputation methods (medianImpute, knnImpute, and bagImpute) in caret package R

2022-09-20 Thread Richard O'Keefe
?preProcess k-nearest neighbor imputation is carried out by finding the k closest samples (Euclidian distance) in the training set. Imputation via bagging fits a bagged tree model for each predictor (as a function of all the others). This method is simple, accurate and acce

Re: [R] Mathematical working procedure of imputation methods (medianImpute, knnImpute, and bagImpute) in caret package R

2022-09-20 Thread Bert Gunter
R is open source. Look at the code and read it. Alternatively, look at references for all of this. e.g. on Wikipedia or via web search. We generally do not provide statistical instruction on this list. Bert On Tue, Sep 20, 2022 at 2:20 PM K Purna Prakash wrote: > Dear Sir/Madam, > Greetings!!!

Re: [R] Mathematical working procedure of imputation methods (medianImpute, knnImpute, and bagImpute) in caret package R

2022-09-20 Thread K Purna Prakash
Dear Sir/Madam, Greetings!!! Kindly provide the detailed internal mathematical working mechanism of the following median, KNN, and bagging imputation methods available in caret package R. preProcess(train_data, method = "medianImpute") preProcess(train_data, method = "knnnImpute") preProcess(t

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] getDividents() doesn't work

2022-09-20 Thread Ivan Krylov
On Mon, 19 Sep 2022 20:47:55 + Phil Smith via R-help wrote: > incomplete final line found by readTableHeader on > 'https://query1.finance.yahoo.com/v7/finance/download/VOX?period1=-2208988800&period2=1663545600&interval=1d&events=split' When I follow the link myself, I get a CSV file that co

Re: [R] getDividents() doesn't work

2022-09-20 Thread Bert Gunter
... and do note that a "warning" is not an "error." Often the correct result will still be obtained. -- Bert On Tue, Sep 20, 2022 at 9:48 AM Phil Smith via R-help wrote: > Hi R-Help People! > > I'm using the current version of R for Ubuntu: R version 4.2.1 > (2022-06-23) -- "Funny-Looking Kid."

Re: [R] getDividents() doesn't work

2022-09-20 Thread Joshua Ulrich
You need to assign the result to an object. vox_div <- quantmod::getDividends("VOX") You should check to see if the dividends are split-adjusted or not. Yahoo has changed that several times over the years. Use the `split.adjust` argument to get the (un)adjusted dividends. The boolean may be backw

[R] getDividents() doesn't work

2022-09-20 Thread Phil Smith via R-help
Hi R-Help People! I'm using the current version of R for Ubuntu: R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid." I'm using the quantmod package and am having difficulty with the getDividends() function from the quantmod package. Here is my code: > library(quantmod) > > getDividends( "VO

Re: [R] Need help plotting

2022-09-20 Thread Bert Gunter
"Also, IU’s tech support told me yesterday that if I responded to a message that came as plain text, my response would go out as plain text. Is that true for this response, or is it in HTML?" Nope, HTML. You need to set your email client to send in plain text. Do an internet search on how to do t

Re: [R] Need help plotting

2022-09-20 Thread Parkhurst, David
I like the looks of what you are doing here. However, this from my system: > library(chron) Error in library(chron) : there is no package called �chron� How can I get chron? Also, IU�s tech support told me yesterday that if I responded to a message that came as plain text, my response would go

Re: [R] How to find the variance-covariance matrix of a random-vector using R

2022-09-20 Thread Bill Dunlap
?var E.g., > x <- mvtnorm::rmvnorm(1e5, mean=101:105, sigma=matrix(1,5,5)+diag(11:15)) > dim(x) [1] 10 5 > var(x) [,1] [,2] [,3] [,4] [,5] [1,] 11.9666055 1.0603876 0.9627672 1.0371084 0.983217 [2,] 1.0603876 13.0774518 1.0228972 0.9261868 1.0597

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

2022-09-20 Thread Ebert,Timothy Aaron
Hi Tibor, I'll try again. Your problem has nothing to do with factors and everything to do with trying to bind a vector to a dataframe and not understanding that a vector must be of one class and that a column in a data frame is a vector and therefore must also be of one class. If you want to

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

2022-09-20 Thread Sarah Goslee
Hi Tibor, No, you are misunderstanding the source of the problem. It has nothing to do with factors. Instead, it has to do with the inability of a vector to hold more than one class. You are using rbind() to add a new row to your data frame, but that vector is being coerced to character. That's

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

2022-09-20 Thread Tibor Kiss via R-help
Hi, this is a misunderstanding of my question. I wasn’t worried about invalid factor levels that produce NA. My question was why a column changes its class, which I thought was a side effect. If you add a vector containing one character string, the class of the whole vector becomes _chr_. And

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

2022-09-20 Thread Tibor Kiss via R-help
Dear Eric, thank you very much. I wouldn’t have come to the idea to look up the help page for _c()_, which of course explains the coercion to the highest type. Best T. > Am 19.09.2022 um 13:31 schrieb Eric Berger : > > You are misinterpreting what is going on. > The rbind command includes c

[R] How to find the variance-covariance matrix of a random-vector using R

2022-09-20 Thread Sun, John
Dear All, Reposting as plain text rather than html. I realized that R does not support finding the variance-covariance matrix of a random-vector. It must take two arguments. Numpy's cov doesn't give sensible results. I ask in a bigger context of finding the variance-covariance matrix of the ve

Re: [R] Need help plotting

2022-09-20 Thread Rui Barradas
Hello, Now with data, here are base R and ggplot2 plots. b <- read.table(text= "Dtime DNO2 DVOC Dpm10Dpm2.5 Dpm1 Mtime MNO2 MVOCMpm10 Mpm2.5 Mpm1 18:00 28 164 81.34773 24.695435 14 18:00 19 151 3.00 21 18:01 27 163 74.44034 23.751198 14 18

Re: [R] Need help plotting

2022-09-20 Thread Jim Lemon
Hi David, I'm back home again. Try this: b<-read.table(text= "Dtime DNO2 DVOC Dpm10Dpm2.5 Dpm1 Mtime MNO2 MVOCMpm10 Mpm2.5 Mpm1 18:00 28 164 81.34773 24.695435 14 18:00 19 151 3.00 21 18:01 27 163 74.44034 23.751198 14 18:01 20 148 3.00 21