[R] [Q] It it possible to create the data frame only non-zero data column?
hiroysato at gmail.com
Fri Jan 8 04:12:35 CET 2016
I re-post this question by e-mail.
(I posted via google-group. But It's not posted yet.)
I'm newbie GNU R.
I would like to compare two datas.
How to select columns which has non-zero datas?.
It it possible to create the data frame only VAL3(non-zero data) column
real data has 5000 columns.
The difference sample1 and sample2 is ID3/VAL3.
sample1 <- read.table("sample1.txt",header=T,sep=',')
sample2 <- read.table("sample2.txt",header=T,sep=',')
result <- sample1[,2:4] - sample2[,2:4]
VAL1 VAL2 VAL3
1 0 0 0
2 0 0 0
3 0 0 1
I would like to create data frame which has non-zero value columns.
Could you tell me how to do it?
[[alternative HTML version deleted]]
More information about the R-help