Re: [R] KNN

2018-06-21 Thread Eivind K. Dovik
Yes, however using caret you can do it directly using the preProcess parameter, e.g. train(y ~., data = train, method = "knn", preProcess = c("center", "scale")). Hope this helps. Eivind On Thu, 21 Jun 2018, Jeff Reichman wrote: R-Help Does one need to normalize ones data is using

Re: [R] drc, ggplot2, and gridExtra

2018-05-18 Thread Eivind K. Dovik
rab() } x <- rnorm(100, 1, 2) y <- rnorm(100, 0, 0.5) plot(x,y) p <- grab() a <- rnorm(20, 0, 1) b <- rnorm(20, 1, 2) plot(a, b) q <- grab() grid.arrange(p, q) Best, Eivind K. Dovik Bergen, NO __ R-help@r-project.org mailing l

Re: [R] Regression model fitting

2018-05-04 Thread Eivind K. Dovik
On Fri, 4 May 2018, Allaisone 1 wrote: Hi all , I have a dataframe (Hypertension) with following headers :- Hypertension ID Hypertension(before drug A) Hypertension(On drug A)On drug B? Healthy diet? 1160

Re: [R] Converting a list to a data frame

2018-05-02 Thread Eivind K. Dovik
e, rep(names(thelist)[i], sapply(thelist, nrow)[i])) } # Creating the data frame df <- data.frame(type, do.call(rbind.data.frame, c(thelist, make.row.names = FALSE))) df Kind regards, Eivind K. Dovik Bergen, NO -- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Eivind K. Dovik
You may also want to check this out: plot(ttt, type = "p") points(ttt, col = ifelse(ttt < 8, "black", "red")) Eivind K. Dovik Bergen, NO On Tue, 1 May 2018, Christopher W Ryan wrote: Excellent! Worked like a charm. Thanks. --Chris Ryan On Tue, May 1, 2018

Re: [R] Merging dataframes

2018-05-01 Thread Eivind K. Dovik
Many thanks in advance. regards, Tito [[alternative HTML version deleted]] Dear Tito, Please provide your R-code so we can reproduce your data (and your setdt-error). Best, Eivind K. Dovik Bergen, NO __ R-help@r-project.or