-3

I got data with ASCII form.

I ran it with R, and these data have * marked when it is under other condition.

enter image description here

V1, V2, V3, V4, V5 don't mean anything different. All that matters is to classify between *-ed things.

I tried c(V1,V2,V3,V4,V5) but it returns only the levels.

I have no idea. Help me with it.

Question. Can I specify *-ed things via some code?

Is there a way to make these columned things in one data?

HyeonPhil Youn
  • 428
  • 4
  • 11
  • 1
    Welcome to Stack Overflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – zx8754 Apr 05 '17 at 13:13
  • 2
    Question is not clear, what is the expected output? – zx8754 Apr 05 '17 at 13:14
  • Oh man every time I try to deal with my curiosity, I have to learn how to express things in right form right matter...It's so...better delete my question – HyeonPhil Youn Apr 05 '17 at 13:25
  • You want others' help for free, show at least some decent effort yourself. Help us to help you. – zx8754 Apr 05 '17 at 13:28
  • Sure. I usally try my best to pinpoint what I don't understand, but today was not the day. Thank you for your interest though – HyeonPhil Youn Apr 05 '17 at 14:02

1 Answers1

0

Select the values marked with *. I guess these values come with the symbol from the original file, right?

In this case use:

position <- grep('\\*', as.matrix(distress[]))
selectedValues <- as.matrix(distress[])[position] 
numericValues <- as.numeric(gsub('\*', '', selectedValues))
zx8754
  • 52,746
  • 12
  • 114
  • 209
gonzalez.ivan90
  • 1,322
  • 1
  • 12
  • 22