[R] Identifying Values in Dataframe

Patzelt, Edward patzelt at g.harvard.edu
Thu Oct 2 22:17:31 CEST 2014


R Help -

I'd like to identify each correlation value in the dataframe below
above/below .3/-.3 in order to graph the original data points. I've started
with the call below to identify each value by it's row and column. I'd like
to form a data object that identifies each set of variables that meet the
criteria and then use that to graph the original data.

*do.call(cbind, lapply(list(row = row(data, T), col = col(data, T), value =
data), as.character))*
structure(c(-0.0228976615669603, 0.0228976615669603, 0.0345568787488209,
-0.0345568787488209, 0.0704941162950863, 0.0501672252097525,
0.119766411337358, 0.0697823742392512, 0.0223273454311378,
-0.0223273454311378,
0.125952482472234, -0.125952482472234, -0.0748856339421511,
-0.0353553864437216,
0.199331873910442, -0.068756564596986, 0.0188033303819659,
-0.0188033303819659,
0.124483870344689, -0.124483870344689, 0.158304442010968,
-0.158304442010968,
-0.00291892981576431, 0.00291892981576431, 0.289784855159971,
0.197017018634618, 0.0725645607308865, 0.0960039687045857,
0.145044311433109,
-0.145044311433109, 0.228975321916426, -0.228975321916426,
0.26388395000877,
0.175954114053622, 0.326823414986536, 0.0464304517962428,
0.171060413427109,
-0.171060413427109, 0.125608489395663, -0.125608489395663,
0.170699125959079,
-0.170699125959079, -0.0537588992684595, 0.0537588992684595,
0.237938136557008, 0.130101348701669, 0.0420659299644508,
0.140016889896702,
0.175781963301805, -0.175781963301805, 0.277913325677977,
-0.277913325677977,
0.250436246834054, 0.149310941080417, 0.345171759606147,
0.0499822279379925,
0.180291553611261, -0.180291553611261, 0.0983047617452837,
-0.0983047617452837,
0.0908629320478729, -0.0908629320478729, 0.0162624158794471,
-0.0162624158794471, 0.219099271324641, 0.143898328556892,
0.0808498509449568,
0.0534039458771934, 0.103639895676339, -0.103639895676339,
0.224298317217259,
-0.224298317217259, 0.13939241528796, 0.0923125296440915, 0.2952647762031,
-0.0573156158960486, 0.126972946909388, -0.126972946909388,
0.145176640269481,
-0.145176640269481, 0.176722440639515, -0.176722440639515,
-0.110517827771672,
0.110517827771672, 0.265161677824653, 0.0349452421080511,
-0.00586032680446085,
0.17140674405117, -0.0141919172668973, 0.0141919172668973,
0.0416754535115447,
-0.0416754535115447, 0.110687511145091, 0.163199987771469,
0.174846924599677,
0.116657756754811, 0.184924363876472, -0.184924363876472,
0.0740138506321435,
-0.0740138506321435, 0.0653341995281647, -0.0653341995281647,
0.101098966521841, -0.101098966521841, -0.0263969055123976,
-0.129660641707532,
0.16313101271814, -0.0000382052406584783, 0.118309823316179,
-0.118309823316179, 0.0408519777835592, -0.0408519777835592,
-0.15406959482671, -0.274340973979869, 0.1465995621482,
-0.0608360452726588,
-0.00570057335076342, 0.00570057335076342, 0.0988132735291764,
-0.0988132735291764, 0.159498629897594, -0.159498629897594,
-0.0258437210789338,
0.0258437210789338, 0.311623918577701, 0.0959243386674064,
0.0373444291324758,
0.131601179184854, 0.0032064022008327, -0.0032064022008327,
0.0126042917937794,
-0.0126042917937794, 0.0288999352531186, 0.0343919995425096,
0.0375647873892517, 0.0734866249695526, 0.125835994106989,
-0.125835994106989,
0.0557071876372764, -0.0557071876372764, 0.0190687287223345,
-0.0190687287223345, 0.0301326072710063, -0.0301326072710063,
0.0881640884608706, 0.0600194980037123, 0.0948090975231923,
0.0259282757599189,
0.120417132810781, -0.120417132810781, 0.196695581235906,
-0.196695581235906,
0.166210300278382, 0.0252645245285897, 0.239953962041662,
-0.013933692494363,
0.0174600644363753, -0.0174600644363753, 0.169008089964054,
-0.169008089964054,
0.0503612778194372, -0.0503612778194372, 0.175816302924921,
-0.175816302924921,
0.141434785651191, 0.0824019401386654, 0.173429908437586,
-0.136795834367563,
0.219543981806626, -0.219543981806626, 0.290697487363267,
-0.290697487363267,
0.331683649439792, -0.0035319780591347, 0.237371764540467,
-0.172828690804139,
0.00922163769628213, -0.00922163769628213, 0.275507919516733,
-0.275507919516733, 0.128267529853407, -0.128267529853407,
-0.16619622911667,
0.16619622911667, 0.102467428865746, -0.115779804556684,
0.000997318666924614,
0.297139396802529, 0.040957786791642, -0.040957786791642,
-0.0160650315621922,
0.0160650315621922, -0.043765426943726, -0.0637020898937285,
0.142863591010818, 0.214059283535989, 0.13975223034564, -0.13975223034564,
-0.0286586386843802, 0.0286586386843802, 0.13735028629468,
-0.13735028629468,
-0.147016933653806, 0.147016933653806, 0.174438743129307,
-0.0116564727226121,
-0.0413775943824046, 0.136551598575573, 0.0614942508131549,
-0.0614942508131549,
0.0687487372508148, -0.0687487372508148, -0.0352587211103196,
-0.0872464182568976, 0.162247767446472, 0.0282617081917608,
0.175608445537029,
-0.175608445537029, -0.0339260764991994, 0.0339260764991994,
0.130002432167221, -0.130002432167221, -0.141752408742242,
0.141752408742242,
0.126603115520512, -0.0784556105378803, -0.0736773348350251,
0.154815164010555, -0.102200077602115, 0.102200077602115,
-0.137144378194025,
0.137144378194025, 0.0132012835622079, 0.113105077279414,
-0.0412435172396771,
0.182836991911806, 0.109656132908221, -0.109656132908221,
-0.0341578533716874,
0.0341578533716874, -0.0155952702450936, 0.0155952702450936,
0.0962494517693934, -0.0962494517693934, 0.0745517006304259,
0.145954619132309, 0.0997683764233029, -0.0562240100001912,
0.13254524166143,
-0.13254524166143, 0.236418162977751, -0.236418162977751,
0.0878486801199713,
-0.00445794916320147, 0.227619583487885, -0.14911359391431,
0.0214260010937822,
-0.0214260010937822, 0.120246543167583, -0.120246543167583), .Dim = c(20L,
13L), .Dimnames = list(c("Loss_Gain_PE_Amygdala_SF_right_hemisphere",
"Gain_Loss_PE_Amygdala_SF_right_hemisphere",
"Loss_Gain_EV_Amygdala_SF_right_hemisphere",
"Gain_Loss_EV_Amygdala_SF_right_hemisphere",
"Loss_PE_Amygdala_SF_right_hemisphere",
"Gain_PE_Amygdala_SF_right_hemisphere",
"Loss_EV_Amygdala_SF_right_hemisphere",
"Gain_EV_Amygdala_SF_right_hemisphere",
"Loss_Gain_PE_Amygdala_SF_left_hemisphere",
"Gain_Loss_PE_Amygdala_SF_left_hemisphere",
"Loss_Gain_EV_Amygdala_SF_left_hemisphere",
"Gain_Loss_EV_Amygdala_SF_left_hemisphere",
"Loss_PE_Amygdala_SF_left_hemisphere",
"Gain_PE_Amygdala_SF_left_hemisphere",
"Loss_EV_Amygdala_SF_left_hemisphere",
"Gain_EV_Amygdala_SF_left_hemisphere",
"Loss_Gain_PE_Amygdala_LB_right_hemisphere",
"Gain_Loss_PE_Amygdala_LB_right_hemisphere",
"Loss_Gain_EV_Amygdala_LB_right_hemisphere",
"Gain_Loss_EV_Amygdala_LB_right_hemisphere"), c("hare2f1", "hare2f2",
"hare4", "hare", "ext_t", "total_barrat_11_imputed", "mcq_k",
"ppitots", "ppi_1_corrected", "ppi_2_corrected", "total_buss_perry",
"hareResidNetExt", "extResidNetHare")))

-- 

*Edward H Patzelt | Clinical Science PhD StudentPsychology | Harvard
University SNPLab http://scholar.harvard.edu/buckholtz
<http://scholar.harvard.edu/buckholtz>*

	[[alternative HTML version deleted]]



More information about the R-help mailing list