Trending questions in Data Analytics

0 votes
1 answer

Converting a string to title case - R

library(tools) toTitleCase("this is sparta") [1] "this is Sparta" ...READ MORE

May 19, 2018 in Data Analytics by Bharani
• 4,660 points
1,345 views
0 votes
1 answer

How can I print string and variable contents on the same line using R?

There are two options for doing so.  You ...READ MORE

May 9, 2018 in Data Analytics by zombie
• 3,790 points
1,669 views
0 votes
1 answer

What is the difference between [] and [[]] notations to access the elements of a list or dataframe in R?

R provides 3 basic indexing operators. Refer ...READ MORE

Apr 12, 2018 in Data Analytics by kappa3010
• 2,090 points
2,684 views
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

Apr 26, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,073 views
0 votes
1 answer

Loading multiple packages at the same time

You can use the p_load() function from ...READ MORE

Jun 4, 2018 in Data Analytics by Bharani
• 4,660 points
376 views
0 votes
1 answer

Constructing a new data.frame by giving values row by row - R

Create an empty data.frame first and then  ...READ MORE

Jun 4, 2018 in Data Analytics by Bharani
• 4,660 points
343 views
0 votes
1 answer

Making a ggplot2 plot without any legends,axes or axis labels

The below command will give you the ...READ MORE

May 29, 2018 in Data Analytics by Bharani
• 4,660 points
598 views
0 votes
1 answer

R - Error: Duplicate identifiers for rows

You can try the below code as ...READ MORE

Apr 9, 2018 in Data Analytics by kappa3010
• 2,090 points
2,732 views
0 votes
1 answer

How can I get type of all variables in R?

It is a easy task and one ...READ MORE

May 22, 2018 in Data Analytics by zombie
• 3,790 points
912 views
0 votes
1 answer

Which command is Opposite of %in% ?

We can use the ! operator inorder ...READ MORE

May 28, 2018 in Data Analytics by zombie
• 3,790 points
618 views
0 votes
1 answer

How to drop rows of Pandas DataFrame whose value in certain coulmns is NaN

Hi@DataKing99, You can create one function according to ...READ MORE

May 7, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 1,490 views
0 votes
1 answer

Removing all objects from work-space except one - R

You can use the 'keep()' function from ...READ MORE

May 17, 2018 in Data Analytics by Bharani
• 4,660 points
1,059 views
0 votes
1 answer

How to get the output of number of elements to reach a cumulative sum?

You can use the sapply function, to loop ...READ MORE

May 29, 2018 in Data Analytics by Sahiti
• 6,370 points
567 views
0 votes
1 answer

Increasing the amount of memory available to R processes

You can use memory.limit() to set the ...READ MORE

May 29, 2018 in Data Analytics by Bharani
• 4,660 points
471 views
0 votes
1 answer

How to rename columns in pandas (Python)?

You can use the rename function in ...READ MORE

Apr 30, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 8, 2020 by MD 1,686 views
0 votes
1 answer

How to check if a directory exists and how to create and create if doesn't exist?

You can use showWarnings = FALSE NOTE:  showWarnings ...READ MORE

Apr 17, 2018 in Data Analytics by DataKing99
• 8,240 points
2,201 views
0 votes
1 answer

How can I add x and y axis labels in ggplot2 ?

# Load a dataset(to work with) # We’ll ...READ MORE

May 16, 2018 in Data Analytics by zombie
• 3,790 points
914 views
0 votes
1 answer

R: Sample from a neighborhood according to scores

I would suggest you to use the truncated ...READ MORE

May 29, 2018 in Data Analytics by Sahiti
• 6,370 points
379 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
2,331 views
0 votes
1 answer

How to delete DataFrame row in pandas based upon a column value?

You can use drop function in your ...READ MORE

May 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 1,450 views
0 votes
1 answer

Is there a way to make R beep/play a sound?

Yes there are few ways to do ...READ MORE

May 25, 2018 in Data Analytics by zombie
• 3,790 points
479 views
0 votes
1 answer

Why should I use set.seed function() in R?

set.seed(seed) Set the seed of R‘s random number ...READ MORE

Apr 24, 2018 in Data Analytics by zombie
• 3,790 points
1,638 views
0 votes
1 answer

Changing the column type from numeric to factor - R

You can use the as.factor() function for ...READ MORE

May 8, 2018 in Data Analytics by Bharani
• 4,660 points
959 views
0 votes
1 answer

How to extract tidy output from many single-variable models using purrr/broom?

You can try this solution: filter_starwars <- function(...) ...READ MORE

May 17, 2018 in Data Analytics by DataKing99
• 8,240 points
591 views
0 votes
1 answer

How can we trim leading and trailing whitespaces in R?

trimws {base} //Remove Leading/Trailing Whitespace Removes leading and/or ...READ MORE

Apr 18, 2018 in Data Analytics by zombie
• 3,790 points
1,826 views
0 votes
1 answer

R lag irregular time series data

You could try using: library(dplyr) library(zoo) na.locf(ts$value[sapply(ts$time, function(x) min(which(ts$time - ...READ MORE

May 11, 2018 in Data Analytics by Sahiti
• 6,370 points
802 views
0 votes
1 answer

Reordering levels of a factor variable

The factor() function provides the 'levels' attribute ...READ MORE

May 15, 2018 in Data Analytics by Bharani
• 4,660 points
613 views
0 votes
1 answer

Grouping rows in a list in pandas (python) groupby

Yes, this possible by using groupby function ...READ MORE

May 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 8, 2020 by MD 1,134 views
0 votes
1 answer

Appending values to a vector - R

This is actually quite easy, all you ...READ MORE

May 15, 2018 in Data Analytics by Bharani
• 4,660 points
590 views
0 votes
1 answer

How to wait for a keypress in R?

It is easy by using readline readline(prompt="Press any ...READ MORE

Apr 25, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,476 views
0 votes
1 answer

How can I control the size of points in an R scatterplot?

plot(variable, type='o' , pch=5, cex=.3) The pch argument ...READ MORE

May 3, 2018 in Data Analytics by shams
• 3,670 points
1,082 views
0 votes
1 answer

Converting R data-frame to h2o object

All you have to do is run ...READ MORE

Apr 3, 2018 in Data Analytics by Bharani
• 4,660 points
2,380 views
0 votes
2 answers

Vector vs List in R

Well, you are right in  saying that ...READ MORE

May 8, 2018 in Data Analytics by anonymous
776 views
0 votes
1 answer

How can I select a CRAN mirror in R ?

There are many ways of doing so ...READ MORE

May 9, 2018 in Data Analytics by zombie
• 3,790 points
753 views
0 votes
1 answer

Save a plot as image on the disk using R

Consider for both the situations: 1. Image will ...READ MORE

Apr 14, 2018 in Data Analytics by Sahiti
• 6,370 points
1,854 views
0 votes
1 answer

How can I use R to list all files with a specified extension ?

fls <- list.files(pattern = "\\.dbf$") $ at the ...READ MORE

May 11, 2018 in Data Analytics by zombie
• 3,790 points
683 views
0 votes
1 answer

Rename a single column in dataframe using R

colnames(Samp)[2] <- "newname2" This sets the name of ...READ MORE

Apr 13, 2018 in Data Analytics by kappa3010
• 2,090 points
1,850 views
0 votes
1 answer

How can I install R with Homebrew ?

brew tap homebrew/science brew install Caskroom/cask/xquartz brew install r The ...READ MORE

May 18, 2018 in Data Analytics by zombie
• 3,790 points
340 views
0 votes
1 answer

Removing all white-spaces from a string

You can use the 'str_replace_all()' function from ...READ MORE

May 16, 2018 in Data Analytics by Bharani
• 4,660 points
403 views
0 votes
1 answer

How to replace NA values in a dataframe with Zero's ?

It is simple and easy: df1<-as.data.frame(matrix(sample(c(NA, 1:10), 100, ...READ MORE

Apr 10, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
1,843 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,025 views
0 votes
1 answer

Deleting particular objects from workspace - R

You can use the rm() function to ...READ MORE

May 7, 2018 in Data Analytics by Bharani
• 4,660 points
570 views
0 votes
1 answer

Removing unimportant variables before building Random Forest

Build the randomForest model on top of ...READ MORE

Apr 4, 2018 in Data Analytics by Bharani
• 4,660 points
1,931 views
0 votes
1 answer

How can I left align two graph edges?

By using a modified version of rbind.gtable ...READ MORE

May 11, 2018 in Data Analytics by zombie
• 3,790 points
363 views
0 votes
1 answer

How to import text file as a single character string?

First way: rd<-readChar("temp.txt",file.info("temp.txt")$size) ...READ MORE

Apr 23, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,062 views
0 votes
1 answer

How can I remove plot axis values?

In order to remove numbering on x-axis ...READ MORE

May 8, 2018 in Data Analytics by zombie
• 3,790 points
435 views
0 votes
1 answer

How to print new lines with print() in R?

You can use cat() instead of writeLines(): ...READ MORE

May 3, 2018 in Data Analytics by kappa3010
• 2,090 points
610 views
0 votes
1 answer

How to set global variables in R

To set global variables, you can use ...READ MORE

Apr 24, 2018 in Data Analytics by kappa3010
• 2,090 points
1,031 views
0 votes
1 answer

Discarding duplicate rows from a data.frame - R

You can use distinct() function along with ...READ MORE

May 4, 2018 in Data Analytics by Bharani
• 4,660 points
521 views
0 votes
1 answer

How can I learn R?

As the name signifies it's only an ...READ MORE

May 9, 2018 in Data Analytics by zombie
• 3,790 points
311 views