[R] Apply t-test on list in R
Zilefac Elvis
zilefacelvis at yahoo.com
Wed Feb 18 04:46:24 CET 2015
I have a list object in R with dataframe names as:
"pav_DJF_histo.csv" "pav_DJF_rcp26_2040s.csv"
"pav_DJF_rcp26_2080s.csv"
"pav_DJF_rcp45_2040s.csv""pav_DJF_rcp45_2080s.csv"
"pav_DJF_rcp85_2040s.csv" "pav_DJF_rcp85_2080s.csv"
"pav_JJA_histo.csv"
"pav_JJA_rcp26_2040s.csv" "pav_JJA_rcp26_2080s.csv"
"pav_JJA_rcp45_2040s.csv" "pav_JJA_rcp45_2080s.csv"
"pav_JJA_rcp85_2040s.csv" "pav_JJA_rcp85_2080s.csv"
and so on ...
I would like to apply a t-test of difference in mean between:
"pav_DJF_histo.csv" and all dataframes with names having "pav_DJF..."
the same for
"pav_JJA_histo.csv" and all dataframes with names having "pav_JJA..."
and so on...
There are 84 dataframes in my list. Calculations will be performed as above on all 84 dataframes.
Thanks for your suggestions.
Asong.
Reproducible example for "pav_DJF_histo.csv" and all dataframes with names having "pav_DJF...".
Each df has 1 row * 120 columns. I will like to do element-wise:
t.test(pav_DJF_histo.csv,all_dataframes)
structure(list(pav_DJF_histo.csv = structure(list(G100_pav_DJF = 0.0314208328712871,
G101_pav_DJF = 0.0316052879207921, G102_pav_DJF = 0.0338115233663366,
G103_pav_DJF = 0.0349753320792079, G104_pav_DJF = 0.0340410627722772,
G105_pav_DJF = 0.0344961831683168, G106_pav_DJF = 0.0331672699009901,
G107_pav_DJF = 0.0335578704950495, G108_pav_DJF = 0.0318934661386139,
G109_pav_DJF = 0.0326319041584158, G110_pav_DJF = 0.0314491928712871,
G111_pav_DJF = 0.0295078394059406, G112_pav_DJF = 0.0312701207920792,
G113_pav_DJF = 0.0274926542574257, G114_pav_DJF = 0.0280412045544554,
G115_pav_DJF = 0.0308147467326733, G116_pav_DJF = 0.0276809968316832,
G117_pav_DJF = 0.0334523455445545, G118_pav_DJF = 0.0231678550495049,
G119_pav_DJF = 0.0329736546534653, G120_pav_DJF = 0.0293986465346535,
GG10_pav_DJF = 0.0272844384158416, GG11_pav_DJF = 0.0250696742574257,
GG12_pav_DJF = 0.0267913558415842, GG13_pav_DJF = 0.028447095049505,
GG14_pav_DJF = 0.0258856714851485, GG15_pav_DJF = 0.0284966926732673,
GG16_pav_DJF = 0.0259450320792079, GG17_pav_DJF = 0.0275422631683168,
GG18_pav_DJF = 0.0267659001980198, GG19_pav_DJF = 0.0239620502970297,
GG20_pav_DJF = 0.0235523667326733, GG21_pav_DJF = 0.0280495275247525,
GG22_pav_DJF = 0.0260046952475248, GG23_pav_DJF = 0.0245813871287129,
GG24_pav_DJF = 0.0225754382178218, GG25_pav_DJF = 0.0340031586138614,
GG26_pav_DJF = 0.0281897057425743, GG27_pav_DJF = 0.0290264237623762,
GG28_pav_DJF = 0.0387512556435644, GG29_pav_DJF = 0.0316748243564356,
GG30_pav_DJF = 0.0268749459405941, GG31_pav_DJF = 0.0306790738613861,
GG32_pav_DJF = 0.0265153081188119, GG33_pav_DJF = 0.0287865821782178,
GG34_pav_DJF = 0.0269848536633663, GG35_pav_DJF = 0.0237527348514851,
GG36_pav_DJF = 0.0264141081188119, GG37_pav_DJF = 0.0273517104950495,
GG38_pav_DJF = 0.0299628936633663, GG39_pav_DJF = 0.0275048685148515,
GG40_pav_DJF = 0.0196275314851485, GG41_pav_DJF = 0.0226415651485149,
GG42_pav_DJF = 0.0292957691089109, GG43_pav_DJF = 0.0240719154455446,
GG44_pav_DJF = 0.0264125300990099, GG45_pav_DJF = 0.0245377025742574,
GG46_pav_DJF = 0.0254801978217822, GG47_pav_DJF = 0.0264283477227723,
GG48_pav_DJF = 0.0221284198019802, GG49_pav_DJF = 0.0281992881188119,
GG50_pav_DJF = 0.0251214203960396, GG51_pav_DJF = 0.022804923960396,
GG52_pav_DJF = 0.0253265572277228, GG53_pav_DJF = 0.0248078140594059,
GG54_pav_DJF = 0.0229847805940594, GG55_pav_DJF = 0.0245689685148515,
GG56_pav_DJF = 0.024459103960396, GG57_pav_DJF = 0.0261233461386139,
GG58_pav_DJF = 0.0248389976237624, GG59_pav_DJF = 0.0238194382178218,
GG60_pav_DJF = 0.025920022970297, GG61_pav_DJF = 0.0232416265346535,
GG62_pav_DJF = 0.0254770396039604, GG63_pav_DJF = 0.0248223295049505,
GG64_pav_DJF = 0.0249457611881188, GG65_pav_DJF = 0.0237617085148515,
GG66_pav_DJF = 0.023653757029703, GG67_pav_DJF = 0.0225660194059406,
GG68_pav_DJF = 0.0209042742574257, GG69_pav_DJF = 0.0253348401980198,
GG70_pav_DJF = 0.0269268635643564, GG71_pav_DJF = 0.0257322499009901,
GG72_pav_DJF = 0.0261817491089109, GG73_pav_DJF = 0.0267062437623762,
GG74_pav_DJF = 0.0254928786138614, GG75_pav_DJF = 0.0263220520792079,
GG76_pav_DJF = 0.0266288738613861, GG77_pav_DJF = 0.0261239605940594,
GG78_pav_DJF = 0.0239993772277228, GG79_pav_DJF = 0.0158666427722772,
GG80_pav_DJF = 0.0175424689108911, GG81_pav_DJF = 0.0193922348514851,
GG82_pav_DJF = 0.0263564615841584, GG83_pav_DJF = 0.0194876946534653,
GG84_pav_DJF = 0.0253149083168317, GG85_pav_DJF = 0.0250615659405941,
GG86_pav_DJF = 0.0241572235643564, GG87_pav_DJF = 0.0232231510891089,
GG88_pav_DJF = 0.027858396039604, GG89_pav_DJF = 0.0271891471287129,
GG90_pav_DJF = 0.0269782621782178, GG91_pav_DJF = 0.0259993922772277,
GG92_pav_DJF = 0.0271551689108911, GG93_pav_DJF = 0.0274789423762376,
GG94_pav_DJF = 0.0246039, GG95_pav_DJF = 0.0314879467326733,
GG96_pav_DJF = 0.031215642970297, GG97_pav_DJF = 0.0259254443564356,
GG98_pav_DJF = 0.028124596039604, GG99_pav_DJF = 0.0293694499009901,
GGG1_pav_DJF = 0.0280423463366337, GGG2_pav_DJF = 0.0266454362376238,
GGG3_pav_DJF = 0.0262475837623762, GGG4_pav_DJF = 0.0271603285148515,
GGG5_pav_DJF = 0.026403784950495, GGG6_pav_DJF = 0.026692183960396,
GGG7_pav_DJF = 0.0281706176237624, GGG8_pav_DJF = 0.0275187194059406,
GGG9_pav_DJF = 0.0267755964356436), .Names = c("G100_pav_DJF",
"G101_pav_DJF", "G102_pav_DJF", "G103_pav_DJF", "G104_pav_DJF",
"G105_pav_DJF", "G106_pav_DJF", "G107_pav_DJF", "G108_pav_DJF",
"G109_pav_DJF", "G110_pav_DJF", "G111_pav_DJF", "G112_pav_DJF",
"G113_pav_DJF", "G114_pav_DJF", "G115_pav_DJF", "G116_pav_DJF",
"G117_pav_DJF", "G118_pav_DJF", "G119_pav_DJF", "G120_pav_DJF",
"GG10_pav_DJF", "GG11_pav_DJF", "GG12_pav_DJF", "GG13_pav_DJF",
"GG14_pav_DJF", "GG15_pav_DJF", "GG16_pav_DJF", "GG17_pav_DJF",
"GG18_pav_DJF", "GG19_pav_DJF", "GG20_pav_DJF", "GG21_pav_DJF",
"GG22_pav_DJF", "GG23_pav_DJF", "GG24_pav_DJF", "GG25_pav_DJF",
"GG26_pav_DJF", "GG27_pav_DJF", "GG28_pav_DJF", "GG29_pav_DJF",
"GG30_pav_DJF", "GG31_pav_DJF", "GG32_pav_DJF", "GG33_pav_DJF",
"GG34_pav_DJF", "GG35_pav_DJF", "GG36_pav_DJF", "GG37_pav_DJF",
"GG38_pav_DJF", "GG39_pav_DJF", "GG40_pav_DJF", "GG41_pav_DJF",
"GG42_pav_DJF", "GG43_pav_DJF", "GG44_pav_DJF", "GG45_pav_DJF",
"GG46_pav_DJF", "GG47_pav_DJF", "GG48_pav_DJF", "GG49_pav_DJF",
"GG50_pav_DJF", "GG51_pav_DJF", "GG52_pav_DJF", "GG53_pav_DJF",
"GG54_pav_DJF", "GG55_pav_DJF", "GG56_pav_DJF", "GG57_pav_DJF",
"GG58_pav_DJF", "GG59_pav_DJF", "GG60_pav_DJF", "GG61_pav_DJF",
"GG62_pav_DJF", "GG63_pav_DJF", "GG64_pav_DJF", "GG65_pav_DJF",
"GG66_pav_DJF", "GG67_pav_DJF", "GG68_pav_DJF", "GG69_pav_DJF",
"GG70_pav_DJF", "GG71_pav_DJF", "GG72_pav_DJF", "GG73_pav_DJF",
"GG74_pav_DJF", "GG75_pav_DJF", "GG76_pav_DJF", "GG77_pav_DJF",
"GG78_pav_DJF", "GG79_pav_DJF", "GG80_pav_DJF", "GG81_pav_DJF",
"GG82_pav_DJF", "GG83_pav_DJF", "GG84_pav_DJF", "GG85_pav_DJF",
"GG86_pav_DJF", "GG87_pav_DJF", "GG88_pav_DJF", "GG89_pav_DJF",
"GG90_pav_DJF", "GG91_pav_DJF", "GG92_pav_DJF", "GG93_pav_DJF",
"GG94_pav_DJF", "GG95_pav_DJF", "GG96_pav_DJF", "GG97_pav_DJF",
"GG98_pav_DJF", "GG99_pav_DJF", "GGG1_pav_DJF", "GGG2_pav_DJF",
"GGG3_pav_DJF", "GGG4_pav_DJF", "GGG5_pav_DJF", "GGG6_pav_DJF",
"GGG7_pav_DJF", "GGG8_pav_DJF", "GGG9_pav_DJF"), row.names = c(NA,
-1L), class = "data.frame"), pav_DJF_rcp26_2040s.csv = structure(list(
G100_pav_DJF = 0.0336921695049505, G101_pav_DJF = 0.0353346894059406,
G102_pav_DJF = 0.0374039577722772, G103_pav_DJF = 0.0382527494059406,
G104_pav_DJF = 0.0372147038613861, G105_pav_DJF = 0.036982626039604,
G106_pav_DJF = 0.0357056598514851, G107_pav_DJF = 0.0367259367326733,
G108_pav_DJF = 0.0339615762376238, G109_pav_DJF = 0.0352461818316832,
G110_pav_DJF = 0.0331901645544554, G111_pav_DJF = 0.0327048907425743,
G112_pav_DJF = 0.0338771433663366, G113_pav_DJF = 0.0304345107425743,
G114_pav_DJF = 0.0299715592574257, G115_pav_DJF = 0.0323663623267327,
G116_pav_DJF = 0.0302113144059406, G117_pav_DJF = 0.0348880272772277,
G118_pav_DJF = 0.0244634474752475, G119_pav_DJF = 0.0356601117821782,
G120_pav_DJF = 0.0318457833168317, GG10_pav_DJF = 0.0292012213366337,
GG11_pav_DJF = 0.0276689620792079, GG12_pav_DJF = 0.0293319658910891,
GG13_pav_DJF = 0.0304862144059406, GG14_pav_DJF = 0.0280408795544554,
GG15_pav_DJF = 0.0301200932178218, GG16_pav_DJF = 0.0286451583663366,
GG17_pav_DJF = 0.0300997758415842, GG18_pav_DJF = 0.0288163182673267,
GG19_pav_DJF = 0.0263369057920792, GG20_pav_DJF = 0.0266477852475248,
GG21_pav_DJF = 0.0300933431683168, GG22_pav_DJF = 0.0289349790594059,
GG23_pav_DJF = 0.0268180481683168, GG24_pav_DJF = 0.0244735858415842,
GG25_pav_DJF = 0.0365696418316832, GG26_pav_DJF = 0.0300007536138614,
GG27_pav_DJF = 0.0316598915346535, GG28_pav_DJF = 0.0408627464356436,
GG29_pav_DJF = 0.0336171423762376, GG30_pav_DJF = 0.0293838656930693,
GG31_pav_DJF = 0.0328603355445545, GG32_pav_DJF = 0.029574533960396,
GG33_pav_DJF = 0.030923384009901, GG34_pav_DJF = 0.0295480556930693,
GG35_pav_DJF = 0.0253115618316832, GG36_pav_DJF = 0.0283057747029703,
GG37_pav_DJF = 0.0302438872277228, GG38_pav_DJF = 0.0321001403465347,
GG39_pav_DJF = 0.0297127561386139, GG40_pav_DJF = 0.0210915803465347,
GG41_pav_DJF = 0.0244056779207921, GG42_pav_DJF = 0.0318838803465347,
GG43_pav_DJF = 0.0262421126237624, GG44_pav_DJF = 0.0286438319306931,
GG45_pav_DJF = 0.0269299434158416, GG46_pav_DJF = 0.0278216301980198,
GG47_pav_DJF = 0.0284923436633663, GG48_pav_DJF = 0.024062545,
GG49_pav_DJF = 0.0297595119306931, GG50_pav_DJF = 0.0267064392079208,
GG51_pav_DJF = 0.0251601975247525, GG52_pav_DJF = 0.0270363448019802,
GG53_pav_DJF = 0.027031203960396, GG54_pav_DJF = 0.0253016908415842,
GG55_pav_DJF = 0.0266129271287129, GG56_pav_DJF = 0.0264486413861386,
GG57_pav_DJF = 0.0283687212376238, GG58_pav_DJF = 0.0267607587623762,
GG59_pav_DJF = 0.0258524088118812, GG60_pav_DJF = 0.0284728297029703,
GG61_pav_DJF = 0.0242683505445545, GG62_pav_DJF = 0.0269807252970297,
GG63_pav_DJF = 0.0260612163366337, GG64_pav_DJF = 0.0268121706435644,
GG65_pav_DJF = 0.0254399943069307, GG66_pav_DJF = 0.0256744116831683,
GG67_pav_DJF = 0.0242163128712871, GG68_pav_DJF = 0.0232865385643564,
GG69_pav_DJF = 0.027024237970297, GG70_pav_DJF = 0.0280309896039604,
GG71_pav_DJF = 0.027491227970297, GG72_pav_DJF = 0.0271313031188119,
GG73_pav_DJF = 0.0286036438118812, GG74_pav_DJF = 0.0282849307920792,
GG75_pav_DJF = 0.0280740992079208, GG76_pav_DJF = 0.0294208429207921,
GG77_pav_DJF = 0.0286056740594059, GG78_pav_DJF = 0.0252083457425743,
GG79_pav_DJF = 0.0171779085148515, GG80_pav_DJF = 0.0187473600495049,
GG81_pav_DJF = 0.020924249950495, GG82_pav_DJF = 0.0285746283663366,
GG83_pav_DJF = 0.0212331709405941, GG84_pav_DJF = 0.0275696948019802,
GG85_pav_DJF = 0.027292552970297, GG86_pav_DJF = 0.0265909641584158,
GG87_pav_DJF = 0.025798541039604, GG88_pav_DJF = 0.0306168697029703,
GG89_pav_DJF = 0.0303202963861386, GG90_pav_DJF = 0.0291813004950495,
GG91_pav_DJF = 0.0280794616831683, GG92_pav_DJF = 0.0299837882673267,
GG93_pav_DJF = 0.0299919872772277, GG94_pav_DJF = 0.0269039003465347,
GG95_pav_DJF = 0.0339354712376238, GG96_pav_DJF = 0.0325601980693069,
GG97_pav_DJF = 0.0285637703465347, GG98_pav_DJF = 0.0313221871782178,
GG99_pav_DJF = 0.0323324087128713, GGG1_pav_DJF = 0.0298989088118812,
GGG2_pav_DJF = 0.0290734964356436, GGG3_pav_DJF = 0.0281705633663366,
GGG4_pav_DJF = 0.0291793695544554, GGG5_pav_DJF = 0.0279056234653465,
GGG6_pav_DJF = 0.0281455424752475, GGG7_pav_DJF = 0.0309308349009901,
GGG8_pav_DJF = 0.0294452942574257, GGG9_pav_DJF = 0.0289754272277228), .Names = c("G100_pav_DJF",
"G101_pav_DJF", "G102_pav_DJF", "G103_pav_DJF", "G104_pav_DJF",
"G105_pav_DJF", "G106_pav_DJF", "G107_pav_DJF", "G108_pav_DJF",
"G109_pav_DJF", "G110_pav_DJF", "G111_pav_DJF", "G112_pav_DJF",
"G113_pav_DJF", "G114_pav_DJF", "G115_pav_DJF", "G116_pav_DJF",
"G117_pav_DJF", "G118_pav_DJF", "G119_pav_DJF", "G120_pav_DJF",
"GG10_pav_DJF", "GG11_pav_DJF", "GG12_pav_DJF", "GG13_pav_DJF",
"GG14_pav_DJF", "GG15_pav_DJF", "GG16_pav_DJF", "GG17_pav_DJF",
"GG18_pav_DJF", "GG19_pav_DJF", "GG20_pav_DJF", "GG21_pav_DJF",
"GG22_pav_DJF", "GG23_pav_DJF", "GG24_pav_DJF", "GG25_pav_DJF",
"GG26_pav_DJF", "GG27_pav_DJF", "GG28_pav_DJF", "GG29_pav_DJF",
"GG30_pav_DJF", "GG31_pav_DJF", "GG32_pav_DJF", "GG33_pav_DJF",
"GG34_pav_DJF", "GG35_pav_DJF", "GG36_pav_DJF", "GG37_pav_DJF",
"GG38_pav_DJF", "GG39_pav_DJF", "GG40_pav_DJF", "GG41_pav_DJF",
"GG42_pav_DJF", "GG43_pav_DJF", "GG44_pav_DJF", "GG45_pav_DJF",
"GG46_pav_DJF", "GG47_pav_DJF", "GG48_pav_DJF", "GG49_pav_DJF",
"GG50_pav_DJF", "GG51_pav_DJF", "GG52_pav_DJF", "GG53_pav_DJF",
"GG54_pav_DJF", "GG55_pav_DJF", "GG56_pav_DJF", "GG57_pav_DJF",
"GG58_pav_DJF", "GG59_pav_DJF", "GG60_pav_DJF", "GG61_pav_DJF",
"GG62_pav_DJF", "GG63_pav_DJF", "GG64_pav_DJF", "GG65_pav_DJF",
"GG66_pav_DJF", "GG67_pav_DJF", "GG68_pav_DJF", "GG69_pav_DJF",
"GG70_pav_DJF", "GG71_pav_DJF", "GG72_pav_DJF", "GG73_pav_DJF",
"GG74_pav_DJF", "GG75_pav_DJF", "GG76_pav_DJF", "GG77_pav_DJF",
"GG78_pav_DJF", "GG79_pav_DJF", "GG80_pav_DJF", "GG81_pav_DJF",
"GG82_pav_DJF", "GG83_pav_DJF", "GG84_pav_DJF", "GG85_pav_DJF",
"GG86_pav_DJF", "GG87_pav_DJF", "GG88_pav_DJF", "GG89_pav_DJF",
"GG90_pav_DJF", "GG91_pav_DJF", "GG92_pav_DJF", "GG93_pav_DJF",
"GG94_pav_DJF", "GG95_pav_DJF", "GG96_pav_DJF", "GG97_pav_DJF",
"GG98_pav_DJF", "GG99_pav_DJF", "GGG1_pav_DJF", "GGG2_pav_DJF",
"GGG3_pav_DJF", "GGG4_pav_DJF", "GGG5_pav_DJF", "GGG6_pav_DJF",
"GGG7_pav_DJF", "GGG8_pav_DJF", "GGG9_pav_DJF"), row.names = c(NA,
-1L), class = "data.frame")), .Names = c("pav_DJF_histo.csv",
"pav_DJF_rcp26_2040s.csv"))
More information about the R-help
mailing list