Trending questions in Data Analytics

0 votes
1 answer

TwitteR package download of package ‘rjson’ fails in R

If you don't want to upgrade your ...READ MORE

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

Use different distance formula other than euclidean distance in k means

K-means is based on variance minimization. The sum-of-variance formula ...READ MORE

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

Rattle packages in R

Rattle is a popular GUI for data mining ...READ MORE

Jul 6, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
589 views
0 votes
1 answer

How to convert a sentence to word table in R?

Try the following code: sentence <- c("case sweden", ...READ MORE

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

Create vector matrix of movie ratings using R project?

Why do'nt you try the dcast function, in the reshape2 package. d ...READ MORE

Jun 30, 2018 in Data Analytics by anonymous
877 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,869 views
0 votes
1 answer

How to remove all variables except functions in R?

One line that removes all objects except for functions: rm(list ...READ MORE

Apr 25, 2018 in Data Analytics by DeepCoder786
• 1,720 points
3,624 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,047 views
0 votes
1 answer

Extract lhs items from rules in R

Try the following code: data("Adult") rules <- apriori(Adult, ...READ MORE

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

Aligning title in ggplot2

You can use the theme layer to ...READ MORE

Apr 27, 2018 in Data Analytics by Bharani
• 4,660 points

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

How to sample random rows in dataframe?

Create data frame and then implement as ...READ MORE

Jul 3, 2018 in Data Analytics by Sahiti
• 6,370 points
586 views
0 votes
1 answer

How to use dplyr functions such as filter() inside nested data frames with map()

You can use map() call as follows:  map(full, ...READ MORE

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

Is there any easy way to fill in missing data?

You can try the following code: First, you ...READ MORE

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

hclust size limit

Classic hierarchical clustering approaches are O(n^3) in runtime and O(n^2) in ...READ MORE

Jun 26, 2018 in Data Analytics by DataKing99
• 8,240 points
631 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,464 views
0 votes
1 answer

Unload a package without restarting R

Try the below option: detach("package:vegan", unload=TRUE) NOTE: You can ...READ MORE

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

How to cluster center mean of DBSCAN in R?

Just index back into the original data ...READ MORE

Jun 26, 2018 in Data Analytics by DataKing99
• 8,240 points
548 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,642 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,848 views
0 votes
1 answer

Read command line parameters from an R script

Here's an example to explain : Two files ...READ MORE

Apr 17, 2018 in Data Analytics by kappa3010
• 2,090 points
3,349 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
639 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
808 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,933 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,728 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,681 views
0 votes
1 answer

How to stack scatterplot in ggplot2?

Use melt() to reshape your data with total as a factor ...READ MORE

May 8, 2018 in Data Analytics by Sahiti
• 6,370 points
2,239 views
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
429 views
0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

Apr 12, 2018 in Data Analytics by DataKing99
• 8,240 points
3,344 views
0 votes
1 answer

How can I remove duplicated rows in R ?

The function distinct() in the dplyr package ...READ MORE

Apr 27, 2018 in Data Analytics by shams
• 3,670 points
2,713 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,258 views
0 votes
1 answer

What is the Difference in Size and Count in pandas (python)?

The major difference is "size" includes NaN values, ...READ MORE

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

edited Jun 8, 2020 by Gitika 2,484 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
952 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,147 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,959 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,663 views
0 votes
1 answer

How to group all columns exculding a single column?

You can either use group_by or group_by_at Using ...READ MORE

Apr 12, 2018 in Data Analytics by Sahiti
• 6,370 points
3,173 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
443 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,431 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
541 views
0 votes
1 answer

How to limit output of a dataframe in R?

For randomly sampling a row/cell where a ...READ MORE

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

How to change y axis max in time series using R?

The axis limits are being set using ...READ MORE

Apr 3, 2018 in Data Analytics by Sahiti
• 6,370 points
3,506 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,615 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
908 views
0 votes
2 answers

"Train" and "Test" sets in Data Science

Normally to perform supervised learning you need ...READ MORE

Aug 3, 2018 in Data Analytics by Abhi
• 3,720 points
952 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
741 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
891 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,579 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,142 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,203 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,306 views