questions/data-science
You can use grepl on the names ...READ MORE
You can give this a try. subset(dataframe, is.na(dataframe$col2)) ...READ MORE
Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE
Use of period separator e.g. product.prices <- c(12.01, ...READ MORE
The variables declared inside a function are ...READ MORE
It is easy by using readline readline(prompt="Press any ...READ MORE
One line that removes all objects except for functions: rm(list ...READ MORE
To set global variables, you can use ...READ MORE
.libPaths() // You can use this command ...READ MORE
set.seed(seed) Set the seed of R‘s random number ...READ MORE
Hello team, you can use na.omit x <- c(NA, 3, ...READ MORE
First way: rd<-readChar("temp.txt",file.info("temp.txt")$size) ...READ MORE
> trial.table.df <- as.data.frame(trial.table) //assuming that trial.table ...READ MORE
To change the font size of text ...READ MORE
Easily by: write.csv(df, "temp.csv", row.names=FALSE) READ MORE
Suppose your DataFrame is named as df: write.csv(df,file="exmp.csv") Then ...READ MORE
## import_multiple_csv_files_to_R # Purpose: Import multiple csv files ...READ MORE
For randomly sampling a row/cell where a ...READ MORE
You can match on something like X=X ...READ MORE
You can use sessionInfo() to accomplish that. > ...READ MORE
trimws {base} //Remove Leading/Trailing Whitespace Removes leading and/or ...READ MORE
You can use reshape2 library: library(reshape2) data <- read.table(text="type ...READ MORE
You can use the reshape function reshape(data, idvar ...READ MORE
You can use factor(ff) to drop levels ...READ MORE
There are 2 options: Either you can use ...READ MORE
If you have small number of variables, ...READ MORE
Try the below option: detach("package:vegan", unload=TRUE) NOTE: You can ...READ MORE
You can use the exists(): > exists("toFindUnknown") [1] FALSE > ...READ MORE
You can use showWarnings = FALSE NOTE: showWarnings ...READ MORE
You can try nchar > nchar("fast") [1] 4 > set.seed(10) > ...READ MORE
Here's an example to explain : Two files ...READ MORE
5 ways to measure running time of ...READ MORE
By Using gridExtra library we can easily ...READ MORE
sink("outfile.txt") cat("hello") cat("\n" ...READ MORE
Consider for both the situations: 1. Image will ...READ MORE
If you have your file located locally ...READ MORE
You can use the paste() command: You can ...READ MORE
You can try out the below code ...READ MORE
The function match works on vectors : x <- sample(1:10) x # ...READ MORE
colnames(Samp)[2] <- "newname2" This sets the name of ...READ MORE
Initialize with empty vectors: data <- data.frame(Date=as.Date(character()), ...READ MORE
You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE
Hi, The below code returns rows without ...READ MORE
First we should have some data: df1<-data.frame(matrix(rnorm(20), nrow=10)) > ...READ MORE
.SD stands for "Subset of Data.table". The ...READ MORE
According to the document if you set limits manually, ...READ MORE
R provides 3 basic indexing operators. Refer ...READ MORE
You can use the reshape2 package for ...READ MORE
Let's assume your list of lists is ...READ MORE
You can use the merge function with ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.