Hot answers tagged

2

The best way to achieve this would be to save the data as an R data file using either save() or saveRDS(): # option 1 save(df, file="data.Rdata") load("data.Rdata") # option 2 saveRDS(df, file="data2.Rds") df <- readRDS("data2.Rds")


1

This doesn't seem like a great task for regex--even your pattern would miss very close typos like COWID-19 or potential OCR mistakes like C0VID-I9. Instead, I'd suggest using the stringdist package to do fuzzy matching, perhaps stringdist::afind to find approximate matches of "COVID-19". You can read a bit about it here. This will let you select ...


1

Thank you for providing a good reproducible code, I can't resist answering the question :) Hope the following code helps: data <- read.table(text = "0 1 2 3 4 5 MR 155 211 64 14 1 1 Mob 0 393 51 2 0 0 SC 0 427 12 7 0 0 Act 0 386 45 15 0 0 Pain 0 379 62 5 0 0 Anx 0 355 73 18 0 0", header = TRUE)...


1

Wouldn't remove similar looking observations unless you have a strong reason to do so. By deleting similar looking observations you may be adding bias into the underlying distribution responsible for generating the data. Your model may be misled into learning a biased distribution and that may affect final performance. To start with use the entire dataset as ...


1

Below are two functions using my favorite packages: The first one shows a scatterplot of every column against the target column The second one shows the correlation of every column with the target column, with confidence intervals (I found how to do that with ggplot here). Code: library(ggplot2) library(reshape2) library(plyr) scatterplot <- function(...


Only top voted, non community-wiki answers of a minimum length are eligible