Skip to content

Sorting NA's and Graphing a histogram

4 messages · Koraelus, Jorge Ivan Velez

#
Let's say I have a dataset

Dataset<-read.csv("Dataset.txt", header=T, row.names=1)

Dataset
   Alpha Beta Gamma Delta
A   1      2        3       4
B   NA    2        4       5
C   NA    3        NA     NA
D   8      9       10      11
E    5     NA     7        13
F   NA    NA     NA       4

I want to remove all rows with more than one NA

So I want it to look like

   Alpha Beta Gamma Delta
A 1        2      3        4
B  NA     2       4        5
D  8       9      10       11
E  5       NA      7       13

Then I want to turn the rownames into variables A, B, D, E that I can work
with as if I had used the attach() cmd, but on the rownames.

plot(A)
2 days later
#
Hello all,

Thank you for you help with the first part, it worked perfectly. I now have
a dataset that is culled to only include rows with no NA's or only 1 NA.

What I want to achieve with the graph is:
Plot the new data matrix:
Such that (for this example) the x-axis has five points: Alpha, Beta, Gamma,
Delta and the y-axis has a numerical axis representing the numbers in the
matrix. I'm sorry, this example graph will look very crude.

4                              X
3                     X
2            X
1   X   
  Alpha  Beta  Gamma Delta
(with a line connecting the dots)

I would like to do this for all rows in the culled data matrix on a single
window (using par(mfrow)) and for the NA's to be left blank.

Thank you for your help so far!
Koraelus
Jorge Ivan Velez wrote: