[R] Column value comparison and colouring

Bert Gunter gunter.berton at gene.com
Sun Apr 6 16:40:40 CEST 2014


Post in plain text, not HTML.

I would suggest that R is not Excel, and that you do not (shudder)
treat it as such. Learn R and use it sensibly.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch




On Sun, Apr 6, 2014 at 7:23 AM, Nico Met <nicomet80 at gmail.com> wrote:
> Dear all,
>
> I have a big matrix,  where I want to compare, one element of a vector with
> many others and clear them.
>
> For example:
>
> In column sil compare elements with other columns (0.734)>-1.0770 in 3rd
> column, so, color them bold else color them bold red
> For example:
>
>> dput(test)
> structure(list(Class = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L), sil = c(0.734,
> 0.734, 0.734, 0.734, 0.734, -0.03, -0.03, -0.03), M201.1637T.1 =
> c(-1.077019059,
> -1.025923945, -2.025907674, -1.223001413, -1.547348898, -0.376842603,
> -1.33495095, -0.486811653), M203.1794T.1 = c(-0.884899777, -0.878305283,
> -1.910526051, -1.446826543, -1.950515819, -0.192865129, -1.669691644,
> -0.636095942), M205.1950T.1 = c(-1.307163965, -1.022407192, -2.050283307,
> -1.508604131, -1.710170605, -0.197410826, -1.547129558, -0.780189201
> ), M207.2107T.1 = c(-1.378614081, -0.950293267, -1.714837198,
> -1.827195011, -1.629677288, -0.064343778, -1.598304259, -0.502002575
> )), .Names = c("Class", "sil", "M201.1637T.1", "M203.1794T.1",
> "M205.1950T.1", "M207.2107T.1"), class = "data.frame", row.names =
> c("500002T_D06_19_42",
> "500030X_B03_19_15", "500059R_G09_19_81", "500061V_H02_13_86",
> "500078W_D10_6_46", "500082M_D05_18_41", "500105S_B09_15_21",
> "500120W_B04_19_16")
>
> Thanks in advance
>
> Nico
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list