Most answered questions in Data Analytics

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
974 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
380 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
346 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,503 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
924 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,481 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,541 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,341 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,681 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,171 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
932 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,476 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,273 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,037 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,074 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
602 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
474 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,575 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
384 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
572 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
621 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,516 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
483 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,910 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,775 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,167 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,367 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,709 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,466 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,760 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
917 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,231 views
+1 vote
1 answer

Binding rows of 2 data-frames which have non-identical columns

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

May 22, 2018 in Data Analytics by Bharani
• 4,660 points
5,853 views
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,356 views
0 votes
1 answer

How to forecast season and trend of data using STL and ARIMA in R?

You can use the forecast.stl function for the ...READ MORE

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

R plot arima fitted model with the original series

This question has many ways to answer, ...READ MORE

May 19, 2018 in Data Analytics by DataKing99
• 8,240 points
4,199 views
0 votes
1 answer

How can I rotate axis labels in R ?

library(ggplot2) p <- data.frame(Day=c("2011-04-11", "2014-05-24","2004-01-12","2014-06-20","2010-08-07","2014-05-28"), Impressions=c(24010,15959,16107,21792,24933,21634),Clicks=c(211,106,248,196,160,241)) p       ...READ MORE

May 18, 2018 in Data Analytics by zombie
• 3,790 points
1,684 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
341 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 filter a data frame with dplyr and tidy evaluation in R?

Requires the use of map_df to run each model, ...READ MORE

May 17, 2018 in Data Analytics by DataKing99
• 8,240 points
1,641 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
595 views
0 votes
1 answer

How can I save grid.arrange() plot to file ?

grid.arrange() directly draws on our device. However, ...READ MORE

May 16, 2018 in Data Analytics by zombie
• 3,790 points
6,498 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
917 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
407 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
617 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
594 views
0 votes
1 answer

Assigning global variables from inside a function - R

You can assign global variables from inside ...READ MORE

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

How can I install older version of R package ?

Supposedly you want to install some old ...READ MORE

May 14, 2018 in Data Analytics by zombie
• 3,790 points
1,599 views
+1 vote
1 answer

How to extract every nth element of a vector using R?

m <- 1:50 n<- m[seq(1, length(m), 6)] The above ...READ MORE

May 14, 2018 in Data Analytics by zombie
• 3,790 points
27,757 views
0 votes
1 answer

Remove messages from R markdown report

All you have to do is, set ...READ MORE

May 14, 2018 in Data Analytics by Bharani
• 4,660 points
3,488 views