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

how to extract specific value in R

$
0
0

I'd like to extract the specific value from dataframe that I need to do data arranging in R. I can't come up with any method to use in R, so any help will be appreciated.

As an example in my dataframe looks something like this:

the raw data looks like as below:

df <- data.frame(
  v1=c('aa',438652,22, ,01),
  v2=c(343012,45, ,'pi',75),
  v3=c(56,'hi',78,670934, ),
  v4=c( ,'cc',906235,05,44))

However, I'd like to extract "6 digits numbers" out into another new frame It's looked like this:

new <- data.frame(
  v5=c(438652,343012,670934,906235))

Does anyone have any ideas? That would be great appreciation !!


Viewing all articles
Browse latest Browse all 201839

Trending Articles



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