Latest questions in Data Analytics

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,262 views
+1 vote
1 answer

How to change fill color in each facet using ggplot2?

You can map the facetting variable to ...READ MORE

May 8, 2018 in Data Analytics by kappa3010
• 2,090 points
24,720 views
0 votes
1 answer

Changing the column type from numeric to factor - R

You can use the as.factor() function for ...READ MORE

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

Vector vs List in R

Well, you are right in  saying that ...READ MORE

May 8, 2018 in Data Analytics by anonymous
771 views
0 votes
1 answer

How can I remove plot axis values?

In order to remove numbering on x-axis ...READ MORE

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

How to drop rows of Pandas DataFrame whose value in certain coulmns is NaN

Hi@DataKing99, You can create one function according to ...READ MORE

May 7, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 1,482 views
+1 vote
2 answers

Splitting the data into training and testing sets - R

Hi, Try like this. train = sample(x = ...READ MORE

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

Deleting particular objects from workspace - R

You can use the rm() function to ...READ MORE

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

Discarding duplicate rows from a data.frame - R

You can use distinct() function along with ...READ MORE

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

How to delete DataFrame row in pandas based upon a column value?

You can use drop function in your ...READ MORE

May 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 1,445 views
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,440 views
0 votes
1 answer

How to print new lines with print() in R?

You can use cat() instead of writeLines(): ...READ MORE

May 3, 2018 in Data Analytics by kappa3010
• 2,090 points
601 views
0 votes
1 answer

How can I label points in geom_point?

Use geom_text , with aes label. You ...READ MORE

May 8, 2018 in Data Analytics by zombie
• 3,790 points
5,328 views
0 votes
1 answer

Grouping rows in a list in pandas (python) groupby

Yes, this possible by using groupby function ...READ MORE

May 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 8, 2020 by MD 1,130 views
0 votes
1 answer

How can I control the size of points in an R scatterplot?

plot(variable, type='o' , pch=5, cex=.3) The pch argument ...READ MORE

May 3, 2018 in Data Analytics by shams
• 3,670 points
1,077 views
0 votes
7 answers

How to iterate over rows in a Dataframe in pandas (Python)?

You can use IMHO: for ind in df.index: ...READ MORE

Dec 10, 2018 in Data Analytics by Ishaan
5,202 views
0 votes
1 answer

How to order data frame rows according to vector with specific order using R?

You can try using match: data <- data.frame(alphabets=letters[1:4], ...READ MORE

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

How to add leading zeros in R?

There are several solutions to this. One of ...READ MORE

Apr 30, 2018 in Data Analytics by Sahiti
• 6,370 points
24,014 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,522 views
0 votes
1 answer

How to rename columns in pandas (Python)?

You can use the rename function in ...READ MORE

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

edited Jun 8, 2020 by MD 1,679 views
0 votes
1 answer

How to export a graph to .eps file with R?

The easiest way that I could suggest ...READ MORE

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

Catch integer(0) in R

R's way of printing a zero length ...READ MORE

Apr 27, 2018 in Data Analytics by kappa3010
• 2,090 points
4,012 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,474 views
0 votes
1 answer

data.frame vs matrix

Yes, both matrix and data.frame are multidimensional ...READ MORE

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

How to find common elements from multiple vectors in R?

Reduce(intersect, list(a,b,c)) READ MORE

Apr 27, 2018 in Data Analytics by DeepCoder786
• 1,720 points
5,586 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,726 views
0 votes
1 answer

How can I delete multiple values from a vector in R?

The %in% operator tells  which elements are ...READ MORE

Apr 27, 2018 in Data Analytics by shams
• 3,670 points
5,974 views
0 votes
1 answer

How to subset data so that it contains only columns whose names match a condition

You can use grepl on the names ...READ MORE

Apr 27, 2018 in Data Analytics by Sahiti
• 6,370 points
6,050 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,852 views
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

Apr 26, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,071 views
0 votes
1 answer

What is the standard naming convention for the variables in R?

Use of period separator e.g. product.prices <- c(12.01, ...READ MORE

Apr 25, 2018 in Data Analytics by shams
• 3,670 points
463 views
0 votes
1 answer

How can I define Global Variables in R?

The variables declared inside a function are ...READ MORE

Apr 25, 2018 in Data Analytics by shams
• 3,670 points
5,760 views
0 votes
1 answer

How to wait for a keypress in R?

It is easy by using readline readline(prompt="Press any ...READ MORE

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

How to set global variables in R

To set global variables, you can use ...READ MORE

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

How do I find out what directory R has chosen to store packages?

.libPaths() // You can use this command ...READ MORE

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

Why should I use set.seed function() in R?

set.seed(seed) Set the seed of R‘s random number ...READ MORE

Apr 24, 2018 in Data Analytics by zombie
• 3,790 points
1,634 views
0 votes
5 answers

How to remove NA values from a Vector in R?

Hello team, you can use na.omit x <- c(NA, 3, ...READ MORE

Dec 9, 2020 in Data Analytics by anonymous
• 82,880 points
192,394 views
0 votes
1 answer

How to import text file as a single character string?

First way: rd<-readChar("temp.txt",file.info("temp.txt")$size) ...READ MORE

Apr 23, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,057 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,221 views
0 votes
4 answers

How to change font size of text and axes on R plots ?

To change the font size of text ...READ MORE

Dec 16, 2020 in Data Analytics by Gitika
• 65,910 points
115,093 views
0 votes
1 answer

How to prevent row names to be written to a file while using

Easily by: write.csv(df, "temp.csv", row.names=FALSE) READ MORE

Apr 20, 2018 in Data Analytics by DeepCoder786
• 1,720 points
510 views
0 votes
1 answer

How to save a DataFrame in R??

Suppose your DataFrame is named as df: write.csv(df,file="exmp.csv") Then ...READ MORE

Apr 20, 2018 in Data Analytics by DeepCoder786
• 1,720 points
4,841 views
0 votes
1 answer

How can I import multiple .csv files into R ?

## import_multiple_csv_files_to_R # Purpose: Import multiple csv files ...READ MORE

Apr 20, 2018 in Data Analytics by zombie
• 3,790 points
6,003 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,756 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,913 views
0 votes
1 answer

How to join columns that are non-NA?

You can match on something like X=X ...READ MORE

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

How to find out the package version which is loaded in R?

You can use sessionInfo() to accomplish that. > ...READ MORE

Apr 18, 2018 in Data Analytics by zombie
• 3,790 points
563 views
0 votes
1 answer

How can we trim leading and trailing whitespaces in R?

trimws {base} //Remove Leading/Trailing Whitespace Removes leading and/or ...READ MORE

Apr 18, 2018 in Data Analytics by zombie
• 3,790 points
1,822 views