Most viewed questions in Data Analytics

0 votes
2 answers

How to set working directory to source file location in R?

Hi,  I'm not sure about the command but you ...READ MORE

Aug 20, 2019 in Data Analytics by Cherukuri
• 33,030 points
13,430 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,029 views
0 votes
1 answer

Error in unique.default(x, nmax = nmax) : unique() applies only to vectors in R

This error is displayed if you used ...READ MORE

Oct 30, 2019 in Data Analytics by Cherukuri
• 33,030 points
12,988 views
0 votes
1 answer

R Error in matrix(if (is.null(value)) logical() else value, nrow = nr, dimnames = list(rn, : length of 'dimnames' [2] not equal to array extent

Hi Shiva, You need to provide a matrix ...READ MORE

Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
12,747 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,681 views
0 votes
1 answer

Random Forest Error : Error in y - ymean : non-numeric argument to binary operator

Hey, Convert the Class.variable to factor then it might work. random_forest ...READ MORE

Oct 9, 2019 in Data Analytics by Cherukuri
• 33,030 points
12,285 views
0 votes
1 answer

How can I measuring running time of R Code ?

5 ways to measure running time of ...READ MORE

Apr 17, 2018 in Data Analytics by anonymous
12,253 views
+1 vote
1 answer

Jupyter Notebook : superscripts and subscripts

You can use the markdown cell to do this. ...READ MORE

Dec 6, 2018 in Data Analytics by Shubham
• 13,490 points

edited Dec 12, 2018 by Shubham 12,062 views
0 votes
2 answers

How to add an image to shiny application?

Hi Prachi. To include an image in the ...READ MORE

Aug 30, 2019 in Data Analytics by anonymous
• 33,030 points
11,800 views
0 votes
1 answer

Turn values into scientific notation in R

Consider the below vector: a<-c(0.1324,0.0001234,234.21341324,09.324324) You can convert it ...READ MORE

Jul 19, 2018 in Data Analytics by DataKing99
• 8,240 points
11,370 views
+1 vote
1 answer

Error saying "Error in file(out, "wt") : cannot open the connection" when execute help command in r

Hey @Ali, change working dir, exit r ...READ MORE

Nov 21, 2018 in Data Analytics by Maverick
• 10,840 points
10,905 views
0 votes
1 answer

fetch all rows with null values in dataframe or dataset - R

Use below code -  which(is.na(air)) is.na() will return a boolean ...READ MORE

Jul 4, 2019 in Data Analytics by anonymous
• 33,030 points
10,660 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,600 views
0 votes
1 answer

What is the difference between NULL and NA?

In simple words, NULL represents the null or an empty object ...READ MORE

Oct 14, 2019 in Data Analytics by anonymous
• 33,030 points
10,595 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,493 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,197 views
0 votes
1 answer

How to rename a file using R?

I just found there are 2 functions file.rename() ...READ MORE

Oct 29, 2019 in Data Analytics by Cherukuri
• 33,030 points
10,193 views
0 votes
1 answer

How do I ignore errors in R

With the try function you can handle errors to ...READ MORE

Nov 6, 2018 in Data Analytics by Kalgi
• 52,360 points
10,147 views
0 votes
1 answer

Convert character to integer type - R

Use substring() function to extract value from ...READ MORE

Nov 3, 2019 in Data Analytics by Cherukuri
• 33,030 points
9,920 views
0 votes
1 answer

Slicing a list using an index vector in r

Use index within [] and provide an ...READ MORE

Nov 2, 2019 in Data Analytics by Cherukuri
• 33,030 points
9,904 views
0 votes
2 answers

How to subset rows containing NA in a chosen column of a data frame?

You can give this a try. subset(dataframe, is.na(dataframe$col2)) ...READ MORE

Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
9,835 views
0 votes
1 answer

Error in library(randomForest) : there is no package called ‘randomForest’

Hi@akhtar, You need to install the library in ...READ MORE

Oct 6, 2020 in Data Analytics by MD
• 95,440 points
9,786 views
+1 vote
2 answers

How can we count TRUE values in a logical vector?

Hi, You can get a count of all ...READ MORE

Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
9,747 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

resize the image in R

Hi,  You can read the image using Magick ...READ MORE

Aug 7, 2019 in Data Analytics by anonymous
• 33,030 points
9,463 views
+2 votes
1 answer

“subscript out of bounds” Error in r programming

This error is likely to occur when ...READ MORE

Oct 31, 2018 in Data Analytics by Kalgi
• 52,360 points
9,371 views
0 votes
1 answer

Error: stat_count() must not be used with a y aesthetic.

Hi Rayan, This error comes due to the ...READ MORE

Aug 19, 2019 in Data Analytics by anonymous
• 33,030 points
9,349 views
0 votes
1 answer

Difference between Eigenvectors and Eigenvalues

Eigenvectors are used for understanding linear transformations. In data ...READ MORE

Jul 17, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
9,259 views
0 votes
1 answer

Error saying " cannot open the connection" when trying to install a package in R

Try install.packages(“package_name”, repos="http://cr ...READ MORE

Nov 26, 2018 in Data Analytics by Maverick
• 10,840 points
8,586 views
0 votes
1 answer

How to plot side-by-side Plots with ggplot2 in R?

By Using gridExtra library we can easily ...READ MORE

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

edited Jun 9, 2020 by MD 8,523 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

Tibble vs Dataframe

Hi Shilpa, The differences are - 1. Tibble ...READ MORE

Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
8,510 views
0 votes
1 answer

Difference between summarise() and summarize() in R

summarise() and summarize() are synonyms. READ MORE

Sep 24, 2019 in Data Analytics by anonymous
8,502 views
0 votes
1 answer

R Shiny Error: no applicable method for 'filter_' applied to an object of class "c('reactiveExpr','reactive')"

The error could be because of using reactive ...READ MORE

Aug 21, 2019 in Data Analytics by Cherukuri
• 33,030 points
8,487 views
+1 vote
1 answer

Change font size of valueBox - shiny R

Try writing your valueBox with this syntax: valueBox( ...READ MORE

Dec 4, 2018 in Data Analytics by Haseeb
8,475 views
0 votes
1 answer

How to add legend or any text on the map in leaflet?

See below example, > p = colorFactor(palette = ...READ MORE

Oct 28, 2019 in Data Analytics by anonymous
• 33,030 points
8,403 views
0 votes
1 answer

Error saying "Error in map(.x, .f, ...) : argument ".x" is missing, with no default" in R

There is small mistake in your code. ...READ MORE

Nov 21, 2018 in Data Analytics by Maverick
• 10,840 points
8,390 views
0 votes
1 answer

How to extract specific columns from a DataFrame ?

Yes there are so many ways: df[,c(V2,V4)] and another ...READ MORE

Apr 11, 2018 in Data Analytics by DeepCoder786
• 1,720 points
8,360 views
0 votes
1 answer

Check Distribution of Categorical Variable in R

Consider the iris dataset use the table() function ...READ MORE

Jul 30, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
8,021 views
0 votes
1 answer

Calculating accuracy of prediction of rpart model

Your first task would be to build ...READ MORE

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

Sample random rows in DataFrame in R

First we should have some data: df1<-data.frame(matrix(rnorm(20), nrow=10)) > ...READ MORE

Apr 13, 2018 in Data Analytics by DeepCoder786
• 1,720 points
7,850 views
0 votes
1 answer

R vs Tableau data visualization.

@Yash, This is a requirement based question. ...READ MORE

Oct 28, 2019 in Data Analytics by anonymous
• 33,030 points
7,730 views
0 votes
1 answer

How to pass command line arguments to run a Rscript

1. For taking an argument from the ...READ MORE

Aug 6, 2018 in Data Analytics by Anmol
• 1,780 points
7,704 views
0 votes
1 answer

How to convert continuous variable to categorical variable and vice versa?

Use discretize function to convert a continuous variable ...READ MORE

Oct 29, 2019 in Data Analytics by Cherukuri
• 33,030 points
7,696 views
0 votes
1 answer

How to create a date variable in R?

Create a string with date notation as ...READ MORE

Jul 16, 2019 in Data Analytics by anonymous
7,692 views
+1 vote
1 answer

Error saying cannot open file 'file.pdf' when trying to save a plot in ggplot

You could try adding the following line ...READ MORE

Nov 9, 2018 in Data Analytics by Maverick
• 10,840 points
7,570 views
0 votes
1 answer

Extracting numeric columns from a data.frame - R

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

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

Reverse the stack order in a stacked bar chart

Hi kriti, Use below code inside geom_bar function. position ...READ MORE

Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
7,351 views
+1 vote
1 answer

How can I use which() function in R ?

which() function determines the position of elements ...READ MORE

Sep 25, 2018 in Data Analytics by Daisy
• 8,120 points
7,233 views
0 votes
1 answer

How to convert tables to a data frame in R ?

> trial.table.df <- as.data.frame(trial.table) //assuming that trial.table ...READ MORE

Apr 20, 2018 in Data Analytics by zombie
• 3,790 points
7,208 views