[R] row names of a heatmap on left hand side
1Rnwb
sbpurohit at gmail.com
Mon Feb 27 23:43:26 CET 2012
Hello R Gurus,
I have a matrix for which I am doing a heatmap using heatmap.2. I want to
put the rownames on the lefthand side instead of the right side of the
heatmap. how can i put the rownames on left hand side: I have already tried
axis but could not make it work
ccc<-structure(c(1, 0.283300333755851, 0.237863231117007,
0.0148696794159253,
-0.0780756406815149, -0.106161465097659, -0.0756387578559718,
-0.0331407390639047, -0.0707492640028071, -0.0613323523367336,
0.160614869977481, 0.163220169151304, -0.00799405273310068,
0.0702415660531524,
-0.00269044770795431, 0.022118567043969, 0.0620175783757948,
0.071884246401891, -0.0469804302975448, 0.0261500962333625,
0.126816435101853,
0.135887180731395, 0.0110308674727327, 0.0805731314652419,
-0.147245436227401,
NA, 1, 0.756696630102848, -0.0253573545151531, -0.0436449174849985,
-0.0681193805838121, -0.125651668003682, -0.132100479190945,
-0.0672954083207475, -0.230426861035276, -0.000418410746782722,
0.0769862111911649, -0.0335582429785183, -0.0842411971843023,
-0.122530783393992, -0.0649446178327085, -0.077787483725924,
-0.0351869234224504, -0.083404295266297, -0.0381865040141299,
0.106839122670871, 0.110275858855431, 0.0863464084194804, 0.153158957903198,
-0.0240563780789799, NA, NA, 1, -0.0581824191662743, -0.0577752089674947,
-0.0732098989298006, -0.128791472234673, -0.0988078828924034,
-0.0679818896618525, -0.17312177564727, 0.012457362675565,
0.0592327855817399,
-0.0666240794205135, -0.0715883024096398, -0.0922611542475004,
-0.0690818250876944, -0.0580129934906561, -0.0172677939384777,
-0.107766765710368, 0.00520294080324943, 0.0784863927912482,
0.102062918116874, 0.0571392089924128, 0.122231446563675,
-0.037588761722365,
NA, NA, NA, 1, 0.525472699159769, 0.514041356697963, 0.561064373161352,
0.431210983834436, 0.452619063041757, 0.147444937649346, 0.0499871095691751,
0.101711708044079, 0.313069848945963, 0.173478908711319, 0.234099595958429,
0.442444172603688, 0.271047417517104, 0.271574694324702, 0.335146377247985,
0.261796658619168, 0.20615917507402, 0.179710108054483, 0.00693091170071528,
0.0572351824096096, 0.0421931015525606, NA, NA, NA, NA, 1,
0.500262732680092,
0.575331145231366, 0.535966575237105, 0.588011751256699, 0.209316134244339,
0.178306362315634, 0.144372963193607, 0.449164822440907, 0.311585643277039,
0.373916415586687, 0.42342063290168, 0.257074092743689, 0.235277302551095,
0.349938957503695, 0.330125591891904, 0.343804820698451, 0.273320029845419,
-0.00571265033987237, 0.0226529101519386, 0.0133821821423264,
NA, NA, NA, NA, NA, 1, 0.783943436792447, 0.738881212745611,
0.74753358245511, 0.154011088987657, -0.0345413593712036,
0.0774290165561568,
0.270530619110383, 0.197653878154696, 0.175622464937608, 0.494122861400667,
0.205654982662595, 0.262435922111394, 0.336248481780927, 0.2457208720417,
0.225645535832965, 0.166011304030232, -0.000628760762335414,
-0.0498164098632905, 0.0504668500594617, NA, NA, NA, NA, NA,
NA, 1, 0.694267683304991, 0.665025879567406, 0.202215608856743,
0.0242420445336668, 0.115486719828318, 0.327074561287353, 0.232316609009873,
0.252557073368415, 0.528071198751934, 0.271456859045674, 0.308461563380474,
0.430695444971444, 0.343610015300747, 0.270906939265836, 0.233818502929012,
0.0267752322720164, 0.0263022347486687, 0.0451312848263739, NA,
NA, NA, NA, NA, NA, NA, 1, 0.776593952305343, 0.264441281328401,
0.18148880771864, 0.123206249983537, 0.298515458147549, 0.325676094897333,
0.269563532182944, 0.500437079037779, 0.315922872681825, 0.320594404612037,
0.342087722381524, 0.234383707828859, 0.333287400951434, 0.218902122287433,
0.0369772789625516, 0.0129942406701288, 0.0489108090105715, NA,
NA, NA, NA, NA, NA, NA, NA, 1, 0.162583487686877, 0.195970937901678,
0.120763943840432, 0.436732203917893, 0.466737746485222, 0.379044627054444,
0.512555709916608, 0.242432982203289, 0.253876944460396, 0.309350372966892,
0.251258196675636, 0.230011894342281, 0.127848664881258,
-0.0115057022105185,
-0.00311190058097034, 0.0549673967736474, NA, NA, NA, NA, NA,
NA, NA, NA, NA, 1, 0.245845410111639, 0.244681678373053, 0.345224517493842,
0.231228340394969, 0.375331818652881, 0.279222931694161, 0.449497588453708,
0.381759655904665, 0.125594966938876, 0.123732822791146, 0.242643089641339,
0.213713940442987, -0.0464978734739873, -0.0530884098109049,
0.00741507616587697, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
1, 0.257637258425107, 0.266404784079116, 0.418770493609101,
0.380954319800656,
0.225911833064407, 0.239940125963318, 0.166185116079108, 0.0545692769866459,
0.104587370234936, 0.157906865871569, 0.153607122076791,
-0.0654111656429167,
-0.00340208731802426, -0.0629540855938132, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, 1, 0.302626240633324, 0.314160256475753,
0.36659577440935, 0.283381437378777, 0.356824428698387, 0.458399544248849,
0.0513918399545163, 0.175229426288891, 0.219315198173476, 0.379344376229316,
0.0380837761734483, 0.052844098764557, 0.0771192119624726, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.498647136209873,
0.582387550042837, 0.441691068119762, 0.360547979040474, 0.312748544895925,
0.244076824227031, 0.29070332337559, 0.299375724903246, 0.278776427245387,
-0.0233530895921723, 0.0188890174998661, 0.0537593576716442,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.617278526382577,
0.469863896065046, 0.343036271426356, 0.249996420472117, 0.0985245529113512,
0.18503898167453, 0.149496016105046, 0.154226446439698, -0.064471717360984,
-0.0101957522022443, 0.0411916765521752, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.457822819385857, 0.458093623179629,
0.374324689876481, 0.207749418737772, 0.238311650773327, 0.194270427007125,
0.188647023840467, -0.0275722481215791, 0.0319885426743396,
0.0631268608693387,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1,
0.60339450875772, 0.593545067327753, 0.318400480103779, 0.337627198737953,
0.285681419377224, 0.260807893463722, 0.0247996335553676,
0.00786034997428267,
0.0667744026617296, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, 1, 0.780668261264502, 0.187549954702155,
0.278514596870099, 0.342181977701156, 0.322059612016306,
-0.0205616434259813,
-0.00206891781760134, 0.0408866596996681, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.182692968866239,
0.232975020338943, 0.258315968968807, 0.437356119271258,
-0.00444191855257121,
-0.0252540245227443, 0.0564535842169471, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.254259511407778,
0.251349176748914, 0.206192986073421, 0.0414566192922011,
0.0955221601014276,
0.0696400887189078, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.21263376857046, 0.193521620649816,
-0.0444935160497807, 0.00398950717312592, -0.00380931251190607,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, 1, 0.508389587635275, -0.00622806022199601,
0.0361779322083993,
-0.00990761382538211, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 0.0224973449816949,
0.0374423861946707, 0.0185759367110533, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
1, 0.493392565723036, 0.81249990020483, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, 1, 0.366348927988254, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1
), .Dim = c(25L, 25L), .Dimnames = list(c("LEPTIN", "CRP", "SAA",
"IL7", "IL10", "TNFB", "IL5", "MCP3", "IL6", "sRAGE", "IL1Ra",
"HGF", "TNFA", "IL8", "MIP1B", "TGFA", "sVEGFR2", "TPO", "FRACTALKINE",
"FLT3", "IP10", "MIG", "IGFBP6", "MMP1", "IGFBP7"), c("LEPTIN",
"CRP", "SAA", "IL7", "IL10", "TNFB", "IL5", "MCP3", "IL6", "sRAGE",
"IL1Ra", "HGF", "TNFA", "IL8", "MIP1B", "TGFA", "sVEGFR2", "TPO",
"FRACTALKINE", "FLT3", "IP10", "MIG", "IGFBP6", "MMP1", "IGFBP7"
)))
rlab<-dimnames(ccc)[[1]]
heatmap.2(ccc, breaks=c(-0.1,0,0.1,0.25),
col=brewer.pal(3,"Blues"),
Rowv=FALSE, Colv=FALSE,symm=TRUE,
key=TRUE,symkey=FALSE, density.info="none", trace="none", cexRow=0.75,
keysize=1,
scale = "none", dendrogram="none",labRow=FALSE,labCol=FALSE,
main='Total')
#axis(2, labels=rlab) ### does not works gives error asking to supply values
of at.
I would appreciate any directions on this
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/row-names-of-a-heatmap-on-left-hand-side-tp4426353p4426353.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list