Convert character to integer type - R

0 votes

Hi, I'm using superstore dataset for visualizations.

I want to use sales and profit values, but they have currency along with digits.

Like this below

How to use the values now? Can someone help me to use the values from dataset?

Jul 25, 2019 in Data Analytics by anonymous
2,546 views

1 answer to this question.

0 votes

Use substring() function to extract value from 2nd position and load it into the same field.

df$sales = as.numeric(substring(ds$sales, 2))
answered Nov 3, 2019 by Cherukuri
• 32,460 points

Related Questions In Data Analytics

0 votes
1 answer

Convert character column to Date field in R Data frame

This is a good question. READ MORE

answered May 4 in Data Analytics by anonymous
199 views
0 votes
1 answer

How to convert a list to data frame in R?

Let's assume your list of lists is ...READ MORE

answered Apr 12, 2018 in Data Analytics by nirvana
• 3,060 points

edited Apr 12, 2018 by nirvana 12,448 views
+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 13, 2018 in Data Analytics by Sahiti
• 6,290 points
726 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

answered Apr 20, 2018 in Data Analytics by zombie
• 3,750 points
1,436 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

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

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
383 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

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

edited Jun 9 by Gitika 157 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
231 views
+1 vote
1 answer
0 votes
1 answer

How to replace all occurrences of a character in a character column in a data frame in R

If you used sub() to replace the ...READ MORE

answered Jun 28, 2019 in Data Analytics by anonymous
• 32,460 points
5,243 views