Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204798

How do I write my function calling data and column?

$
0
0

I want my function to:

  • change the values in a column so that the ',' is a '.'
  • convert that column to a double

I have tried many different forms of this equation but I keep getting the error "Unknown or uninitialised column"

convert_number <- function(data, column, y) {
  a <- str_replace(data$column, ",", ".")
  y <- as.double(data$column)
  return(a)
}

How can I fix it?


Viewing all articles
Browse latest Browse all 204798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>