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 in Data Analytics by anonymous
28 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 by Cherukuri
• 32,260 points

Related Questions In Data Analytics

0 votes
0 answers

Convert character column to Date field in R Data frame

How to convert character column to date ...READ MORE

Jul 1 in Data Analytics by Nithin
59 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 4,131 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 darklord
• 6,190 points
219 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,710 points
117 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
128 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
184 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
91 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
115 views
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 in Data Analytics by anonymous
• 32,260 points
155 views