Latest questions in Data Analytics

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
600 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,574 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
383 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
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,997 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,515 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,905 views
+4 votes
11 answers

Creating an empty data.frame with only column names - R

Hi, You need to create a data frame ...READ MORE

Dec 11, 2020 in Data Analytics by MD
• 95,440 points
107,105 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
17,011 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,773 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,164 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,364 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,071 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,707 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,465 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,759 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
915 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,850 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,354 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,198 views
+5 votes
3 answers

Counting the frequency of unique values - R

Hi, You can use plyr module. It will give ...READ MORE

Dec 14, 2020 in Data Analytics by MD
• 95,440 points
94,923 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
+2 votes
5 answers

Printing a data.frame without index - Python

.tolist() function will remove index READ MORE

Mar 11, 2019 in Data Analytics by nishant thakur
86,999 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,640 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
594 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,495 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
916 views
+1 vote
2 answers

Locating row index of a column which has the maximum value - R

Hi, Nirvana You can also try this. which(iris$Sepal.Length == ...READ MORE

Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
12,715 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
406 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
615 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
592 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,247 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,754 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,487 views
0 votes
1 answer

Any filter based on conditional criteria in r?

Consider a data frame like this: #Create DF ...READ MORE

May 11, 2018 in Data Analytics by Sahiti
• 6,370 points
1,990 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
803 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
684 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
365 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

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
757 views
0 votes
1 answer

How can I append rows to an R data frame?

Consider a dataSet i.e cicar(present under library ...READ MORE

May 9, 2018 in Data Analytics by zombie
• 3,790 points
10,511 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
312 views