Most voted questions in Data Analytics

0 votes
1 answer

How to write rules generated by Apriori?

I found out one solution: Use as() ...READ MORE

Jun 19, 2018 in Data Analytics by Sahiti
• 6,370 points
434 views
0 votes
1 answer

How to cluster a very large dataset in R?

You can initially use kmeans, to calculate ...READ MORE

Jun 19, 2018 in Data Analytics by Sahiti
• 6,370 points
2,768 views
0 votes
1 answer

Extract a subset of a data frame based on a condition involving a field

Here are the two main approaches. I ...READ MORE

Jun 19, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
16,008 views
0 votes
1 answer

Randomly subset of data with dplyr

Maybe this is what you want: # sample ...READ MORE

Jun 19, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
660 views
0 votes
1 answer

Do-while loop in R

You can use repeat{} condition and check ...READ MORE

Jun 14, 2018 in Data Analytics by DataKing99
• 8,240 points
462 views
0 votes
1 answer

Drop unused levels from a data frame in R

You can use this command droplevels() y <- ...READ MORE

Jun 14, 2018 in Data Analytics by DataKing99
• 8,240 points
1,769 views
0 votes
1 answer

Reshape dataframe without “timevar” from long to wide format in R

Assuming that the data is in the ...READ MORE

Jun 14, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
823 views
0 votes
1 answer

Reshape data from long to wide format in R

Use reshape function: reshape(dat1, idvar = "name", timevar = ...READ MORE

Jun 14, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
2,543 views
0 votes
1 answer

How can I read a .csv file in R language?

read.csv () function is used to read ...READ MORE

Jun 12, 2018 in Data Analytics by zombie
• 3,790 points
547 views
0 votes
1 answer

How can I differentiate between lapply and sapply ?

If the programmers want the output to ...READ MORE

Jun 12, 2018 in Data Analytics by zombie
• 3,790 points
3,783 views
0 votes
1 answer

How to evaluate expression given as a string in R?

The eval() function evaluates an expression, but "5+5" is a string, ...READ MORE

Jun 7, 2018 in Data Analytics by DataKing99
• 8,240 points
4,209 views
0 votes
1 answer

How to extract a dplyr tbl column as a vector?

With dplyr 0.7.0, you can use pull to ...READ MORE

Jun 6, 2018 in Data Analytics by Sahiti
• 6,370 points
6,182 views
0 votes
1 answer

Using dplyr package to summarise multiple columns - R

'dplyr' package provides 'summarise_all()' function to apply ...READ MORE

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

Unable to install the 'devtools' package in R

Run the below command in your Ubuntu/Linux ...READ MORE

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

How many data structures does R language have?

R language has Homogeneous and Heterogeneous data ...READ MORE

Jun 5, 2018 in Data Analytics by zombie
• 3,790 points
749 views
0 votes
1 answer

R language has several packages for solving a problem. How do you make a decision on which one is the best to use?

CRAN package ecosystem has more than 6000 ...READ MORE

Jun 5, 2018 in Data Analytics by zombie
• 3,790 points
967 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
373 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
336 views
0 votes
1 answer

How to add regression line equation and R2 on graph?

Below is one solution: # GET EQUATION AND ...READ MORE

Jun 1, 2018 in Data Analytics by DataKing99
• 8,240 points
6,483 views
0 votes
1 answer

How to order bars in a bar graph using ggplot2?

The key to ordering is to set ...READ MORE

Jun 1, 2018 in Data Analytics by DataKing99
• 8,240 points
914 views
0 votes
1 answer

Removing outliers from a box-plot - ggplot2 - R

You just have to add 'outlier.shape=NA' inside ...READ MORE

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

Finding the nth highest value in a vector or a data-frame column

sort(x,T)[n] Here, 'x' is the data-frame/vector and 'n' ...READ MORE

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

Trigger a data refresh in shiny

You're looking for invalidateLater. Put this, with the ...READ MORE

May 31, 2018 in Data Analytics by Sahiti
• 6,370 points
4,314 views
0 votes
1 answer

How to refresh shiny dataset?

When you refresh the page in the ...READ MORE

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

Python equivalent to replace function in R

There is actually a replace function in ...READ MORE

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

Adding values of common columns in pandas dataframe

Result = Set1.add(Set2)   x   y 0  70  ...READ MORE

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

How can I increase the number of axis ticks in R ?

You can try to override ggplots default ...READ MORE

May 30, 2018 in Data Analytics by zombie
• 3,790 points
6,459 views
0 votes
1 answer

Changing R default library path using .libPaths ?

You should try using one library but ...READ MORE

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

How can I change font size and direction of axes text in ggplot2 ?

You can try theme(): Library(ggplot2) a <- data.frame(x=gl(10, 1, ...READ MORE

May 30, 2018 in Data Analytics by zombie
• 3,790 points
4,017 views
0 votes
1 answer

How can I suppress warnings globally in an R Script ?

You can use: options(warn=-1) // turning off warnings ...READ MORE

May 30, 2018 in Data Analytics by zombie
• 3,790 points
2,062 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
591 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
467 views
0 votes
1 answer

Showing percentage instead of counts in a bar plot - ggplot2 - R

Load the 'scales' package first, which gives ...READ MORE

May 29, 2018 in Data Analytics by Bharani
• 4,660 points
3,553 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
372 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
556 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
604 views
0 votes
3 answers

How can I add YAML current date in rmarkdown ?

<$today:MM/dd/yyyy> READ MORE

Mar 25, 2019 in Data Analytics by Anupam Das
14,941 views
0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

May 28, 2018 in Data Analytics by Bharani
• 4,660 points
9,502 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
462 views
0 votes
1 answer

How can I pause, sleep, wait, execution for X seconds in R?

You can try the following piece of ...READ MORE

May 25, 2018 in Data Analytics by zombie
• 3,790 points
1,884 views
0 votes
11 answers

Changing the legend title in ggplot

Hi, you can also try guides() to ...READ MORE

Jul 30, 2019 in Data Analytics by Cherukuri
• 33,030 points
16,954 views
0 votes
1 answer

How can I calculate mean per group in a data.frame?

You can use aggregate function for calculating ...READ MORE

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

How can I find file name from full file path in R?

You can use: basename("C:/some_dir/filename.ext") # [1] "filename. ...READ MORE

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

Converting a pandas data-frame to a dictionary

Emp_dict=Employee.to_dict('records') You can directly use the 'to_dict()' function ...READ MORE

May 23, 2018 in Data Analytics by Bharani
• 4,660 points
4,346 views
0 votes
2 answers

Replacing a row in pandas data.frame

key error. I love python READ MORE

Feb 18, 2019 in Data Analytics by anonymous
13,026 views
0 votes
1 answer

Changing Pandas data-frame to JSON type

abc.to_json(orient='records') This command will give you the desired ...READ MORE

May 22, 2018 in Data Analytics by anonymous
1,696 views
0 votes
1 answer

Applying the same function to every row of a data.frame - R

You can use the 'appply()' function for ...READ MORE

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

How can I Split code over multiple lines in an R script?

You can do this as follows: setwd(paste("~/a/very/long/path/here ...READ MORE

May 22, 2018 in Data Analytics by zombie
• 3,790 points
1,745 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
900 views
0 votes
1 answer

Selecting only p-value and r.squared value from linear regression result

You can use the $ symbol to ...READ MORE

May 22, 2018 in Data Analytics by Bharani
• 4,660 points
1,217 views