Search
 
SCRIPT & CODE EXAMPLE
 

R

R remove commas

> df <- data.frame(numbers = c("123,456,789", "1,234,567", "1,234", "1"))
> df
      numbers
1 123,456,789
2   1,234,567
3       1,234
4           1
> df$numbers <- as.numeric(gsub(",","",df$numbers))
> df
    numbers
1 123456789
2   1234567
3      1234
4         1
Comment

PREVIOUS NEXT
Code Example
R :: convert string to lowercase R 
R :: r append to vector 
R :: R df space in column name 
R :: R extract regex from string 
R :: lubridate sequence of dates 
R :: r function syntax 
R :: what is a vector in r 
R :: for R 
R :: looping over R dictionary 
R :: how to change legend title in r 
R :: get list of words that are in two lists using set 
R :: how to filter a vector by location in r 
R :: two string in one string r 
R :: R create sequence of date each quarters 
R :: R currency ggplot axis 
R :: r read.csv tab delimited 
R :: r ggplot variable name 
R :: extract first element before a character stringr 
R :: convert ratio to numeric in r 
R :: combine row for every element of vector r 
Rust :: get random enum rust 
Rust :: char byte size rust 
Rust :: rust swap vector elements 
Rust :: rust hashmap 
Rust :: split rust 
Rust :: does rust support classes 
Rust :: armanriazi•rust•reference•vs•pointer 
Rust :: $sce trust url 
Rust :: Create and populate a 2d vector 
Rust :: primitive data types in rust 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =