Wednesday, 28 August 2013

NA s in Correlation in R

NA s in Correlation in R

I have two dataframes with a single row and would like to find the
correlation.
### data A
244901_at 244902_at 244903_at 244904_at 244905_at 244906_at 244907_at
244908_at 244909_at
5.992685 6.355384 8.892132 6.457952 4.796459 8.323776 4.372337
4.735242 4.571437
data B
244901_at 244902_at 244903_at 244904_at 244905_at 244906_at 244907_at
244908_at 244909_at
4.750239 5.041382 4.985982 6.15879 4.853101 5.684656 4.584193
4.503102 4.433312
when I calculate the correlation it gives me NA.
cor(data A, data B)
244901_at 244902_at 244903_at 244904_at
244905_at 244906_at 244907_at 2
44908_at
244901_at NA NA NA NA NA
NA NA NA
244902_at NA NA NA NA NA
NA NA NA
244903_at NA NA NA NA NA
NA NA NA
244904_at NA NA NA NA NA
NA NA NA
244905_at NA NA NA NA NA
NA NA NA
244906_at NA NA NA NA NA
NA NA NA
244907_at NA NA NA NA NA
NA NA NA
244908_at NA NA NA NA NA
NA NA NA
244909_at NA NA NA NA NA
NA NA NA
244910_s_at NA NA NA NA NA
NA NA NA
244909_at
244901_at NA
244902_at NA
244903_at NA
244904_at NA
244905_at NA
244906_at NA
244907_at NA
244908_at NA
244909_at NA
244910_s_at NA

No comments:

Post a Comment