Extract individual genes from modules in WGCNA - r

I've got the following MEs file after performing WGCNA on genes.
structure(list(MEdarkturquoise = -0.126475329197849, MEtan = -0.233526198026173,
MEdarkgrey = -0.086222455739712, MEsalmon = 0.0096490189937994,
MEviolet = -0.074214462874189, MEdarkolivegreen = 0.0351479764276791,
MEdarkred = 0.0669868352219114, MEskyblue = 0.0952261185132281,
MEskyblue3 = 0.135145582896583, MEsteelblue = 0.11287454763798,
MEmidnightblue = 0.0651813145953543, MEcyan = 0.209007602108883,
MEsienna3 = 0.44443648889449, MEyellowgreen = -0.103085026146051,
MElightcyan = -0.031750256452673, MEorange = -0.0126799698551899,
MEblack = -0.0634155967712594, MEdarkmagenta = 0.0211453409000538,
MEdarkorange = -0.00210726593791533, MEwhite = 0.133020812016434,
MEblue = -0.197746247022991, MEgrey60 = -0.0996015659492354,
MEdarkgreen = -0.0916627743675571, MEred = -0.0309829945285656,
MEgrey = 0.152772139607461), row.names = "TCGA.02.0054.01", class = "data.frame")
> dput(MEs[1:25,])
structure(list(MEdarkturquoise = c(-0.126482404651362, 0.00859685106988051,
-0.139119978025995, -0.121760256216002, -0.114050357589663, -0.16158166178197,
-0.169089521235389, 0.134388350128016, -0.128728040505512, 0.0933639502568886,
-0.116285533417, -0.0715164710720025, -0.050281653395796, -0.0712583935347317,
-0.116848802717176, -0.1394796603133, -0.131958454866075, -0.167862157710569,
0.0781961256653059, -0.0874083890994826, -0.142602528126273,
-0.132749359004561, 0.0530754944359762, -0.112556115187184, -0.126475329197849
), MEtan = c(-0.167883113654055, -0.0109845487812259, -0.246272322275879,
-0.155118397135028, -0.187094786264526, -0.208897816323153, 0.00918849047141923,
0.0660987731811726, -0.179682091342798, 0.0361927428937938, -0.168337427405039,
-0.0872997940891031, 0.0487147246178567, -0.104997421215032,
-0.166612765418889, -0.27972731849213, -0.269614736192796, -0.218686589132102,
0.0186266000013494, -0.115752853428279, -0.234180322169165, -0.234468472122879,
0.0853896953163215, -0.119401273395233, -0.233526198026173),
MEdarkgrey = c(-0.100329095271737, -0.0784894235648148, -0.0879486442773462,
-0.0995049018784005, -0.0714818317916746, -0.0976149187829668,
0.159506068630208, -0.0078547447048395, -0.0919187341851776,
-0.0183352208123751, -0.0802716031327569, -0.0921892597579533,
0.122475915845315, -0.105142453664124, -0.107464669408259,
-0.0838230654624859, -0.0643026477240475, -0.0991970944971272,
-0.0299497021490766, -0.0925869123215248, -0.0801263954108516,
-0.0801822804978344, 0.0483614999202892, -0.113020942570186,
-0.086222455739712), MEsalmon = c(-0.0358095654745313, -0.0534749789951331,
0.00945930449870025, -0.0402326557250527, 0.0141791776591814,
-0.0193044312130539, 0.0176549615193692, 0.0196918377830713,
-0.0161165396744247, 0.0489395668597594, -0.0157533935456657,
-0.0365864961052464, 0.00284816428633602, -0.0390827955707751,
-0.0331282498660023, 0.0160144463637484, 0.0456439557518989,
-0.0170910975438849, 0.0278516976939946, -0.0461529642613651,
0.000932542725999325, 0.0306652565937469, -0.00572936088385097,
-0.047929378464284, 0.0096490189937994), MEviolet = c(-0.0698514607272664,
-0.0625444441558566, -0.0505951048105294, -0.0449811807220172,
-0.0441953669134818, -0.0841615937800127, -0.0221491455239211,
-0.0267981445053516, -0.0794779460694139, -0.0302013048014515,
-0.0353669499138048, -0.0017331573094048, 0.0874838415896361,
-0.047762725972725, -0.0669664745407823, -0.0712203584491592,
-0.0295047546287239, -0.08493075962853, 0.0272695404925932,
-0.0525343912541236, -0.0847673835546743, -0.0538857173401459,
-0.0328162107969099, -0.0966668580989554, -0.074214462874189
), MEdarkolivegreen = c(0.0377820765118535, -0.126289848165377,
0.0457552036312885, -0.0720376769423904, 0.0674183078192647,
0.0872226089549376, 0.0671641745702857, 0.0986229412529974,
0.124873710183385, -0.0145322250064643, 0.0835047870659539,
0.0275515952723316, 0.114534984742249, 0.0174957637942426,
0.0638552985728309, 0.0778140457135465, 0.251550135774411,
0.0286025658766736, -0.0492443633949548, 0.0329210913327464,
0.0787017703166302, 0.0615020315780856, -0.0184948705908313,
-0.0954877380526897, 0.0351479764276791), MEdarkred = c(0.272876545608831,
0.000123183429299067, 0.0534538229798448, 0.0966098482194768,
0.0376326716689517, 0.822582158679362, -0.0248835680553132,
-0.0383904231751435, 0.0136807003192766, -0.0248358334970572,
0.0339322151406484, 0.0716557037805583, -0.0539693528926393,
0.106398558847861, 0.0923427494085759, 0.169664971210157,
0.161648440649969, 0.0190084156548717, 0.000138628237731107,
0.000585214632906398, 0.102262784369053, 0.0534505728224905,
-0.059973432049819, 0.0144335767114106, 0.0669868352219114
), MEskyblue = c(0.0300817906913275, -0.0283955827490865,
0.382808148350357, 0.0367108628998102, 0.119370910675356,
0.0412642225896619, -0.00346854861171808, -0.0143470278284632,
0.107636689352283, -0.0236684849544009, 0.0917438787357169,
0.0145447693950731, -0.0382373445817665, 0.0191434123578404,
0.0375158618776065, 0.249299207645228, 0.120963274601968,
0.146633570220078, -0.00679395818159729, 0.0233447602384917,
0.0792772300611593, 0.78202446362806, -0.0543273832838903,
0.0108020494546566, 0.0952261185132281), MEskyblue3 = c(0.0544999124430812,
-0.0415537322590853, 0.148498774122011, 0.045015742997482,
0.0728228727907875, 0.0763671830934277, 0.000625753326390824,
-0.0432869954615651, 0.0859576301808161, -0.0427299484684677,
0.092614515678829, 0.014278460672561, -0.0339679894655559,
0.0742750317248251, 0.0683990062576902, 0.147094858821046,
0.187211235984884, 0.817070341622215, -0.00380348023692627,
0.0271100286319751, 0.105519330253122, 0.25743166485415,
-0.0622649562610468, 0.0191289446807367, 0.135145582896583
), MEsteelblue = c(0.0496514378945234, -0.0119028777509424,
0.0876026179283109, 0.875168424597013, 0.113111751301955,
0.0512419512431396, -0.00415862479258981, -0.0287581359673004,
0.0358772065144821, -0.0233613685194822, 0.0245461112657854,
0.0338562304377162, -0.0315874613922273, 0.030394516232703,
0.0555994037601733, 0.160637881942329, 0.169118254533511,
0.0451606357014289, -0.0145989327568692, 0.0252714145226534,
0.0839064560962295, 0.159428227426239, -0.0573138459939694,
0.0174199687282867, 0.11287454763798), MEmidnightblue = c(0.261366892829522,
0.023044681576429, 0.0343889442489335, 0.132848541119855,
0.0451576879950088, 0.0252827715295774, -0.0337324509562343,
-0.0317626799281452, 0.00867375015130735, -0.0355601371114707,
-0.00444014493366716, 0.0524201198652068, -0.0465892341718296,
0.53368866448374, 0.40299004894058, 0.226878425330428, 0.288891850461152,
0.0034111639191928, -0.0218911490874513, 0.0428414277129276,
0.127759568873117, 0.0230208606028655, -0.0486763743391364,
-0.000393935612089922, 0.0651813145953543), MEcyan = c(0.14712352890204,
-0.0225389566680152, 0.310239714084796, 0.266828682037704,
0.274085380006878, 0.0198325328800958, -0.0271481393021675,
-0.024480016276833, 0.361036065881631, -0.0310804478509462,
0.104903141200727, -0.00844783885620602, -0.0423320596946433,
0.217939441329577, 0.168597379421396, 0.174848423174792,
0.17116192322786, 0.145536587676942, -0.0085695012138382,
0.262571866404432, 0.116885684620837, 0.298472250629788,
-0.0455865890454148, -0.0198367637146339, 0.209007602108883
), MEsienna3 = c(0.0364613522451339, -0.0150044936323261,
0.0859786195398347, 0.106731994744255, 0.3676154185844, 0.0176360451265258,
-0.0163146904234233, -0.0235733528486296, 0.0142637017953146,
-0.0313496090372881, 0.0554025449971393, -0.00886560890289934,
-0.0299155299683427, 0.0802190450199411, 0.0531084986705855,
0.132177853079289, 0.115753358405972, 0.04683928504613, -0.0224627603109401,
0.483305710073052, 0.0502197126088502, 0.0753150865546981,
-0.0487254418019003, -0.000161377685444758, 0.44443648889449
), MEyellowgreen = c(0.0115359152267024, 0.135057278002594,
-0.163986652388384, 0.0330253189145193, -0.0646237426605537,
-0.182159469390447, -0.0763758202479116, 0.00753002768998373,
-0.175745378130036, -0.0866930520900523, -0.127613619675027,
-0.0832229515648747, -0.0379533464493758, 0.227986268308109,
0.103786513478538, -0.111497522959011, 0.0543128016169437,
-0.168835985541294, -0.0443617981956915, 0.0497044203429988,
-0.0846269823241523, -0.161465337778303, -0.0345036685471383,
-0.0961578498644668, -0.103085026146051), MElightcyan = c(0.0496191101107336,
0.130845431420586, 0.0520264149008036, 0.0854617949112739,
0.0153143285568461, 0.0138577418822467, -0.146526829901649,
-0.0388445912643835, 0.16637132352514, -0.036790968426816,
0.136179898679897, 0.0325362917451082, -0.0862509925988111,
0.134280378238923, 0.0481757419670939, -0.0678217105237136,
-0.0980229321521949, 0.0660774319688092, 0.0686963951231444,
0.127712350792151, -0.0437788600734283, 0.0878538693816119,
-0.0370044484031624, 0.0774977578587763, -0.031750256452673
), MEorange = c(0.13722224885649, 0.348756408712165, -0.0800936623582766,
0.197824913378728, -0.0205788858009016, -0.126818727577524,
-0.0865505994454585, -0.0596441543425443, -0.0197970499720824,
-0.0463019712805513, -0.0334182781567987, 0.122694391378806,
-0.0578620147308185, 0.136041922205044, 0.0626293391953756,
0.0316228992508401, 0.051048170154005, -0.0938622475936843,
-0.0136841309266074, 0.29538347151955, 0.0672243499977651,
-0.081023944076598, -0.0707293257868871, 0.0650574935030528,
-0.0126799698551899), MEblack = c(0.0669111171346558, 0.0837057669788319,
-0.164559526573629, 0.014702020473466, -0.123047193449949,
-0.0291251094597731, -0.156231277020043, -0.0447495590042895,
-0.137596515322486, -0.0266068779713139, -0.130298868117392,
0.0501740645662331, -0.0848560252717673, 0.162625652137377,
0.0936054374640849, -0.0220460671613258, -0.0311431986113967,
-0.174860138606855, 0.0508889727241686, 0.013307684883397,
-0.0389735225998367, -0.146220072707352, -0.072458305736215,
-0.0163412223207896, -0.0634155967712594), MEdarkmagenta = c(0.0981791947286194,
0.138464419108534, -0.138443536660989, 0.0735849457821136,
-0.0989132475093273, 0.208435014282372, -0.196962446030651,
-0.0187764726316799, 0.0279066357560171, 0.107299478700084,
-0.0836441885372265, 0.0346409967849602, -0.0962524864123106,
0.142618931084639, 0.0750906041071312, 0.0800820894150817,
-0.0388956049610418, -0.0862962942007109, 0.125617514770139,
0.109800363695881, -0.0603003835784385, 0.00858662657497652,
0.0529975055493171, 0.0427784887634529, 0.0211453409000538
), MEdarkorange = c(-0.0389613203162392, 0.0812780201455584,
0.0750911866557248, 0.00750993227102546, -0.00170616028160571,
0.0678048499345556, 0.0631589127461073, -0.00903712074086093,
0.10349869021427, -0.0824956520330546, 0.0616051849769035,
-0.15434803287655, -0.029264436424772, 0.0201543005265066,
-0.0670127845248307, -0.0516851755136453, -0.4145788128165,
0.131425827634174, -0.0302549933173993, 0.01867736005915,
-0.0125070668068291, 0.0698915480466011, 0.0784835008404346,
0.0203252856416219, -0.00210726593791533), MEwhite = c(0.0290935398852734,
0.0422842196727377, 0.0695406138759151, 0.120865984617736,
0.159270489022687, 0.175941528117507, 0.0559958673176756,
-0.0960882619193223, 0.0681820267892018, -0.0899077237106928,
0.0624521908300418, -0.0619794085515802, -0.0976850447934499,
0.0868355955174896, 0.00534865194514006, -0.0489642356559877,
-0.234375104882794, 0.171063805316584, -0.128968065240522,
-0.0264488709945445, -0.0163951034436283, 0.0578930638008963,
-0.08895666012489, 0.0709316976503018, 0.133020812016434),
MEblue = c(-0.0438160100250189, 0.0205864110567424, -0.089574297986365,
-0.0228697246325195, -0.0478684201028521, 0.0315178886185285,
0.0997019543929526, 0.0522665035834491, 0.111573175132434,
-0.039766523067667, 0.0554814245199621, -0.0916893423364658,
0.0705662146799376, 0.0156334233571506, -0.107396855651202,
-0.302131304020196, -0.247578337048839, 0.043361259025573,
-0.0104425537088264, 0.0443072405388741, -0.198865108634832,
-0.0361698433062441, 0.0821076401458689, -0.0978577689161953,
-0.197746247022991), MEgrey60 = c(-0.00136880839558318, -0.0275833699067186,
-0.039882440735729, -0.0525869028464486, -0.00912419686053642,
0.0928788723567378, 0.0734655244111471, 0.132922206619663,
0.117756463773648, -0.0416205429323441, 0.0878530983399299,
-0.0600973853406165, 0.140077921831975, 0.0160988482647548,
-0.0553621242005487, -0.131331494202082, -0.142532621940606,
0.100721216689661, -0.100883207816199, 0.0597345076546271,
-0.105322855790332, 0.039735865024859, 0.0952310616043726,
-0.106615569178441, -0.0996015659492354), MEdarkgreen = c(0.0274020843334667,
0.0436385774800176, 0.0947005842374533, 0.0575400257478901,
0.120931034418584, 0.174210568563443, 0.13572478502157, -0.0311255678482926,
0.194745284926632, -0.102137593170246, 0.261056084621793,
-0.0403664444724046, 0.0787608796858007, 0.134775433556818,
0.017729034036735, -0.101597869034928, -0.121335386372983,
0.167218651293673, -0.0509483741931395, 0.17923174058135,
-0.0861912933809606, 0.0965421906363849, -0.00511227897621758,
-0.0575646092870182, -0.0916627743675571), MEred = c(0.00684939198719674,
0.013557838077012, 0.191954503171545, 0.0132835577290769,
0.0456079404330869, 0.19777154880118, 0.197929991500107,
-0.0505822456570982, 0.253001323274958, -0.0981601294837628,
0.192635505850396, -0.0522121852056791, 0.124362208531841,
-0.0849374786734087, -0.124823316491311, -0.0593347866019663,
-0.160654145093744, 0.277260325248897, -0.0887701479804753,
-0.00466328615275768, 0.0153802201669976, 0.0480954401161867,
0.0642172097701228, 0.00333365773780607, -0.0309829945285656
), MEgrey = c(-0.00533499927967739, -0.0866434191241955,
0.133801184209863, -0.0124432897797533, 0.0922499906965556,
0.0953795979215922, 0.0548824355446993, -0.0283109788329285,
-0.00931881479985485, 0.0184344848243561, 0.0313248766224585,
0.106731086518589, -0.000578668939631188, -0.0923485894819629,
0.0387579566695894, 0.209642899356913, 0.292344147721993,
0.08801305387923, 0.000499791539282575, -0.070360812595406,
0.145743119891815, 0.120846559493449, -0.0820460485075853,
0.0804668976442401, 0.152772139607461)), row.names = c("TCGA.02.0003.01",
"TCGA.02.0004.01", "TCGA.02.0007.01", "TCGA.02.0009.01", "TCGA.02.0010.01",
"TCGA.02.0011.01", "TCGA.02.0014.01", "TCGA.02.0016.01", "TCGA.02.0021.01",
"TCGA.02.0023.01", "TCGA.02.0024.01", "TCGA.02.0025.01", "TCGA.02.0026.01",
"TCGA.02.0027.01", "TCGA.02.0028.01", "TCGA.02.0033.01", "TCGA.02.0034.01",
"TCGA.02.0038.01", "TCGA.02.0039.01", "TCGA.02.0043.01", "TCGA.02.0046.01",
"TCGA.02.0047.01", "TCGA.02.0048.01", "TCGA.02.0051.01", "TCGA.02.0054.01"
), class = "data.frame")
I now want to extract the genes present in each individual module. What shall be the most effective way for the same? I tried searching from the tutorial, but it didn't work out.
Please help me extract the genes from individual modules specific to my case?

Related

factoextra variable plotting and labeling subset

I've run a PCA using prcomp in R and I am trying to produce a variable plot that has 1) a subset of the variables (arrows) in a different color (black) than the rest of the variables, 2) sort those variables prior to plotting so the black arrows aren't covered up by any of the other arrows, and 3) label the black arrows with their TUXXXX number.
Here is a truncated version of my data:
structure(list(sdev = c(21.7106794138444, 15.6885074594869, 11.9124316528111,
10.155277241318, 9.31528828036412, 7.56876266263865, 7.19938201515987,
5.81620977435434, 5.00785424840699, 4.57228787327195, 4.51525494575488,
3.20601607034873, 2.91477640215067, 2.48737967730048, 2.13230488376163,
1.74923754200417, 1.32745772948038, 1.27373216417502, 0.924437474777366,
0.749074623004602, 2.499709597053e-15), rotation = structure(c(-0.0710441966458092,
0.091894514828866, -0.0892433537986534, -0.269473709517009, -0.270455466278075,
0.217492458575054, 0.104541973199297, 0.198858094257877, 0.0222680112919805,
-0.220704163347643, -0.0144913885562279, 0.191255085890651, -0.0639203495167002,
0.156262929972648, 0.184067836594737, -0.221797618857792, 0.152932751853774,
0.218733634550932, 0.213989867048259, -0.219209176045661, 0.162232843055052,
-0.182649403408074, 0.0732706002149817, -0.0636694683826245,
0.197950156891487, -0.201332798849071, -0.0908133550739104, 0.204561640782066,
0.144543461720936, 0.128722984809536, 0.152014925749702, -0.219186163224382,
0.137427869376807, -0.0385728465064452, -0.210836096156869, 0.295086522896984,
0.0791956927556792, 0.154250304318938, 0.212537035577304, 0.165554637810987,
0.0559168852882808, 0.0389301896007549, 8.50109782205011e-06,
0.0386719091643949, -0.223181316780788, 0.0201295766763838, -0.0993945550528442,
-0.0797657364873552, 0.290392094157839, -0.210104310439075, 0.190507620860241,
0.288216604566037, -0.128091623622577, 0.0523741236254804, 0.165286635170839,
0.26567738477018, 0.067304658063138, -0.185395359345644, -0.0824392053628523,
0.0232331903282599, 0.206712718290849, -0.0599454190622519, 0.0694655529225049,
0.27934713843206, 0.120105146108152, 0.276987279291797, 0.137068573563571,
0.290227550805898, 0.0299855300238849, -0.048045392789825, 0.217209812823655,
-0.245207498414819, -0.0969050397538762, 0.0152958298727508,
0.0611874790392221, 0.244015616675892, -0.341439467152496, -0.0574074669754257,
-0.187473105527714, 0.0859725296785313, -0.230526618631008, 0.164238788534203,
-0.422116092865793, -0.0847447867791298, 0.0984005915083912,
0.0400031956936472, -0.0768787993932683, -0.127305543959199,
0.174417860300221, 0.00642366483942508, -0.0644270895895563,
-0.0445557418009, -0.206781215165792, -0.398796252833277, 0.198729650467593,
0.0351312161529938, -0.149474677035792, -0.0671760700655275,
-0.0776573448858521, -0.0276268199179851, -0.0622850132226139,
-0.0133848915206553, -0.0412751078511757, -0.196695235499305,
0.035533391699955, -0.0471461480863407, -0.471887698745297, 0.385807939659813,
-0.0521508210675749, -0.106054753553622, -0.0520098951237357,
-0.328301752147492, -0.0885218905714762, -0.392528395483506,
-0.0535243088811493, -0.0012232141956296, -0.143968515821013,
0.110020791115645, 0.105789408005642, -0.0173550741395983, -0.0754711706175302,
0.105789800532602, 0.035696880367874, -0.0235700328573188, -0.086664772131814,
0.140659513401983, -0.147738109860937, 0.158253547879328, 0.096508294839766,
-0.0405645836586841, -0.0308947063294566, 0.196563611460491,
-0.163272613036823, 0.102159062108236, -0.242801481572191, 0.100060947435785,
-0.122408620775568, 0.0879253395566385, 0.0964448760240853, -0.10574290240921,
0.473324985332234, 0.237791221156891, 0.121312056042028, -0.0156952213549262,
-0.0509545579371996, -0.188663582956394, -0.0296470996543493,
0.259217775431442, -0.151966417414955, -0.0246227447960926, 0.412107323913548,
0.135772975480753, -0.0902168853917747, -0.0478519874649824,
-0.0293395316078502, 0.036873372126565, -0.0600803315985544,
0.0951569802806819, -0.174539345831377, -0.0567399129758035,
-0.0522218071944251, -0.0208963041931566, 0.15376867866167, -0.0906491458699936,
-0.13257887196968, -0.0137277293203767, -0.329880055323168, -0.227898895128165,
-0.0402178711138279, -0.191724054954671, -0.0457418642155951,
-0.113122585201102, -0.0523451728177034, -0.0619052030873901,
-0.232037793152732, -0.286608825250971, -0.337575786471338, -0.106930203013502,
-0.0488020861881439, -0.0342694484533206, -0.316010730818033,
-0.138362452107825, 0.000204654351180751, 0.34062110315846, -0.0174472565351551,
0.321216705099307, 0.109402271713093, -0.195953316697484, 0.106147314965255,
0.0965509971711528, -0.0619150877056984, 0.0823900429544073,
0.107331603831664, -0.196505739977505, -0.106531330626324, 0.083316396319378,
-0.0150328553267955, -0.131557865292901, -0.197676924192316,
-0.302438247351333, 0.0850937235677142, -0.0588088540505814,
-0.0137660099545295, 0.0981614485249126, 0.064387690302654, 0.0870877447014138,
0.115369776587117, 0.0743160202050587, -0.302341999379974, 0.0990657432090211,
-0.109416851119016, 0.0566207941620112, -0.563376445425201, 0.022987878311214,
0.00914995477596945, -0.0698458973541682, -0.339551294424273,
0.328653723240687, -0.311621856766325, 0.0451475830297207, 0.0486778657760599,
-0.203890915518391, -0.00733314039012801, 0.0302380986964549,
-0.187740946530342, 0.107505967223115, 0.0112058761308914, 0.0124189091072754,
-0.0946013978939246, -0.0108516955206006, -0.0224544300789198,
-0.200447923165361, 0.00227210575436315, -0.0230219082173417,
-0.115276809069961, 0.113599893064251, 0.0547021334782484, 0.0750295713780988,
0.0318176533771422, 0.270756307602172, 0.0158888930662066, -0.0321100878211108,
0.0137635276916354, 0.285629078757821, -0.0707869220022327, -0.196194173921016,
0.0691894805409008, 0.196425060869134, 0.0609662656649608, 0.0112726648905893,
0.0763548314916228, -0.0203154117969338, -0.154183879477363,
-0.263435512251247, 0.0904584427059006, 0.443081105454767, 0.145760707944433,
-0.124076693641366, -0.00926033658765893, 0.322008337751576,
0.038976848601001, -0.00243771729397693, 0.0682300992336678,
0.101208051579165, -0.0044801862648156, -0.0288479608546419,
0.338293188340527, -0.148520145256712, -0.114001067101895, 0.0429068793268258,
-0.0808048267081677, 0.0147906601414549, 0.00024012812721683,
-0.0245592922986743, 0.26189600932665, 0.0089069926197661, 0.102640316156789,
0.0293398861736338, 0.461748240785653, 0.0268162505216955, -0.0262617915066989,
0.128477574136056, 0.304269602566599, -0.00833894425455883, 0.0183612622798514,
-0.0694598653855358, 0.143473468921974, 0.494741840190451, 0.11710470731812,
0.0938975501248067, -0.111819356177393, 0.074487393087207, -0.236744656433776,
-0.00888263838265717, -0.0411308668141714, -0.0205247425377322,
0.00682064532990936, -0.0657589971316789, -0.0854778766938379,
-0.0446898232128541, 0.0595158665026168, -0.164975323219787,
-0.21297106776461, -0.24328292167101, -0.0421999896796148, -0.0454152302659223,
0.536798625888851, -0.107184764029374, -0.134710620292912, -0.0486878301757869,
0.0112145455041351, -0.0888773206829193, -0.0231311387150055,
0.160224502964451, 0.116642580196556, 0.132842779999407, 0.0815222556677455,
0.0846715273158058, -0.168358316697627, -0.141086214309714, -0.0812000194350307,
0.108662664398591, -0.0391921007274459, -0.231315089883372, 0.25650378734853,
-0.0459946623780035, -0.366253502200094, 0.0485143397750607,
0.0417032700002287, -0.133038776710167, -0.230298287475923, 0.0369759420468897,
-0.00906710613565646, 0.0342935061381997, -0.273232725280753,
0.0602621389601039, 0.206808600842623, -0.32050527301245, 0.0622454407253566,
-0.0606525149750042, -0.0660628546307464, -0.038482743495315,
-0.198081930190034, -0.0732284456644516, 0.405606839140943, 0.0459681574877996,
-0.0809991829793473, -0.0121246261443008, -0.326485629157016,
0.0750251561011149, -0.0511696428776832, -0.0776271119484428,
0.0114894367280979, 0.014021492503364, 0.118849898460583, -0.0350044617639092,
0.0269961041673681, 0.239744113644073, -0.233879279575839, -0.115473220682409,
-0.139126309932733, 0.11002945246376, -0.0830577400425309, -0.0642289884705754,
-0.0817307298240943, 0.0291046627888711, -0.0466920006759583,
0.256672775663942, -0.0137954035992047, 0.17957481447807, -0.0303657675236596,
0.518263963411537, 0.344005787563606, -0.0655688570898937, -0.0265294401946153,
-0.0263107898868621, 0.289506920843548, 0.118475732210224, 0.053567958881615,
0.146877133183997, -0.0549414997788912, 0.143851895777107, 0.0428308701652828,
-0.348959761946987, -0.189096210288467, -0.00385035890156567,
0.150120708161381, 0.0607203081654835, 0.000166036942981724,
-0.0397011322296128, 0.0239760961564877, -0.00913095901818713,
-0.136862964262375, 0.102111106897839, 0.0687169707815706, 0.239013538410316,
-0.39892902681439, -0.197510750116376, 0.0499804963638917, 0.128640553281137,
0.110040614593457, -0.0490679379082568, -0.234025706976098, 0.157764576030734,
0.0571664700394519, -0.074307378291659, -0.231764546118876, 0.565447067892318,
-0.21480675567977, 0.0854469138131175, -0.0976097155414531, 0.160801495571792,
-0.0624041394929365, -0.0127140410117323, 0.196633195933416,
0.0340211274197625, 0.0195595932420065, 0.0964345475133984, -0.174817763577626,
0.118153342593374, 0.225094093283825, 0.0276798513722757, -0.39244132040106,
0.0738620568768489, 0.027031867335908, 0.0584738274201628, 0.00728266929277696,
-0.200928813049723, 0.100479151028423, 0.217133686900663, 0.152350478604359,
0.0798552081200005, 0.00566909653422267, 0.15071802028838, -0.0828967915619975,
0.0689991484295119, 0.118221935665031, 0.418906970577945, 0.161468821548893,
-0.0443917405359232, 0.127346300562372, 0.0854487046042784, 0.0086243432217815,
0.0186528057922736, 0.143224492276055, -0.113522100459258, 0.365748845830972,
-0.353026210924788, 0.0928434654809545, -0.217256921150109, 0.0926292235900054,
-0.0360081503134767, -0.0761247497474667, 0.0137710983238269,
0.135604749840715, -0.366785665744512, 0.174928851514231, 0.0364877873595186,
0.0808239023932249, 0.057715463934493, 0.103601691734105, -0.109666857605533,
0.38393023627746, -0.117248332196572, 0.134270206368149, 0.0580313640704774,
0.0649484539445183, 0.215353645432973, 0.0977108936702795, 0.16612143102929,
0.152770485581267, -0.0516344648811396, -0.0620940862015108,
0.114473317921704, -0.0383202829927206, 0.0820220075422196, 0.0556449561108403,
0.0053103511581772, 0.141569483443786, 0.264761186392854, 0.231379833347928,
-0.186458908266326, -0.280612868599116, -0.0134977078164976,
-0.190682413873154, 0.103622962625572, 0.048589128670959, 0.189228510250879,
-0.267141675131746, 0.24968486643315, 0.000515248155113446, 0.0518714761513495,
-0.0123619986636973, -0.0400774164248301, 0.14696585867848, 0.00893605318819822,
-0.115310054522583, 0.0730556770081751, -0.0415182843892857,
-0.100197819082248, 0.366565649542296, -0.280217314004845, 0.0742548639941826,
-0.0598573375691124, 0.0773367591528449, 0.00440008401952238,
-0.133823453930746, 0.0129306082883093, 0.249237874757721, 0.178566150191566,
0.0236542331383419, -0.121983928027758, -0.407639692892733, 0.105625218150781,
0.0606170741355181, -0.205658012407281, 0.198411895098939, 0.314706002474467,
-0.0699572649574542, -0.256054196724344, -0.0597932960838045,
0.12552805883941, -0.0738282459049305, -0.270044343022259, -0.241030766471284,
0.101198016298546, 0.207020228203116, -0.105134856921501, -0.0677078010226698,
0.0597983546937891, -0.181549492585234, -0.0707807644693492,
-0.242992185702685, -0.164512180143508, 0.0345701932987703, -0.0663154906257285,
0.302765631613708, 0.118224308922645, 0.0673423264385151, 0.417740310978627,
0.111554431260226, 0.16022442648127, -0.25635936207313, -0.35265959952747,
0.0429263261414316, 0.140480243375922, -0.130382613873709, -0.0446328161712632,
0.120679204177165, 0.100894280068327, 0.102396715497024, 0.292226072514004,
0.0170232777619504, -0.0854499461046589, 0.150649869168952, 0.054457847943396,
-0.0755734422376126, -0.0485946974863497, -0.214957242429833,
-0.19078567042026, -0.265677083691519, 0.11169177584997, -0.0546945656068388,
-0.133918556644411, -0.0815433043760734, 0.0419081230722499,
-0.119806690064691, -0.129001645490559, 0.164330559962565, -0.494999436348284,
-0.0104711534954494, -0.151933262861035, -0.0616048245349729,
0.0510091356535412, -0.15286661063535, 0.286795952380893, -0.00227878893487643,
-0.121875652782209, -0.0463279998907995, -0.08440989195395, 0.0161463685432679,
0.283239464786081, -0.0997334879966379, -0.107077349937415, 0.0797083319878824,
-0.023817698507559, 0.0308411589066249, -0.33639040110823, -0.22283646210506,
-0.0472382156514798, -0.0383954704026199, -0.279873414947505,
-0.110928067466998, 0.0224738031700519, -0.240448693328791, -0.0234165327843327,
-0.164995870598194, 0.0704836439566211, -0.0341351365684308,
0.253109207656731, 0.0986224720533927, 0.0788051554263656, 0.0348921204456385,
0.179396594950779, 0.183681460022634, 0.165162541829685, -0.131056895026594,
-0.043658366747374, -0.164919051972395, 0.000438005379084683,
-0.203731301273092, 0.156795003278361, 0.147134057978626, 0.0674666995224469,
0.0387098969653998, 0.0780676163151537, -0.020902824954741, 0.0863172379869736,
0.0254543096586073, 0.221894385139484, 0.605679699321179, 0.00510726652451246,
0.0122597366937914, -0.177909018628657, 0.112879199323714, 0.00722763837901889,
-0.226515396833189, -0.179516219763039, 0.0427914553668244, -0.301499857490821,
0.07077374887633, 0.0684478824696676, 0.109600278015023, -0.246938356324243,
0.0361050298642269, -0.273671368850468, 0.0361740234532937, -0.0379154357295922,
-0.140858482198813, -0.210557939874765, -0.183530140411959, -0.170246755949232,
-0.153695213839514, 0.197257212733899, 0.176328880404244, 0.267335680405474,
0.0108203611164604, 0.420718967278865, 0.0610513794750232, -0.0695142190235678,
-0.0211301631659223, -0.109598478540236, 0.0168455051311258,
0.0297211637285332, 0.0641419705460361, 0.196768178957862, -0.101223881022882,
0.156790420489079, -0.248396712859248, -0.0324362090799154, 0.116497846273851,
0.206631759837322, -0.26949738606709, 0.0523825016986687, 0.273991705979531,
-0.211717836239047, 0.343025575540513, 0.123225187210276, -0.130175293604759,
0.383814266477628, -0.0425846714760806, -0.120958839664608, -0.222129739206683,
0.0129931836329733, 0.144776049791581, -0.162517014653887, -0.0859042045925978,
-0.181054333724447, 0.0216585016380889, -0.0923250223535876,
-0.103640362754872, -0.223956862384563, 0.213416939275391, -0.21381164272001,
-0.235056303853187, -0.0630316125230271, -0.105100763021652,
-0.0360147146171049, -0.0709796908578211, 0.113552355258653,
-0.00724023466942227, -0.0325253318186826, -0.0460572605581843,
0.362655177721721, -0.102542875980008, -0.0801797191999012, 0.107198034030814,
0.183373945987406, 0.0309647928318137, -0.236970374446373, 0.0520664942182686,
-0.0402703424381589, 0.0504291632173252, -0.158130484290709,
-0.112283134517499, -0.300637215703608, -0.231320162708774, 0.0785169224262154,
0.23958352054759, 0.426485005426312, -0.0815406319434192, 0.00340039424643938,
-0.0375428689912434, 0.33351700972973, -0.0800149829632403, 0.140498383489292,
0.167368656035586, -0.0844117015281891, 0.0785085162751926, 0.0489486062002369,
-0.0561511863757523, 0.234387154088994, 0.0481142285230063, 0.0705808780719704,
0.221875388986379, -0.148031374880166, -0.0894717302805895, 0.231743942045981,
-0.210616362796393, -0.0812013243962482, -0.185771800435443,
-0.0438135376399639, 0.218374086144347, 0.121623152294345, -0.170058260806661
), .Dim = c(35L, 21L), .Dimnames = list(c("TU35976", "TU38792",
"TU35975", "TU4897", "TU9262", "TU18312", "TU38793", "TU30299",
"TU38794", "TU16422", "TU32068", "TU12311", "TU18325", "TU22117",
"TU20746", "TU19660", "TU41790", "TU43092", "TU18309", "TU19659",
"TU16277", "TU34798", "TU10953", "TU18317", "TU18307", "TU9186",
"TU17864", "TU15658", "TU14030", "TU15669", "TU9890", "TU33617",
"TU16279", "TU27042", "TU17167"), c("PC1", "PC2", "PC3", "PC4",
"PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13",
"PC14", "PC15", "PC16", "PC17", "PC18", "PC19", "PC20", "PC21"
))), center = c(TU35976 = 6.61238491831215, TU38792 = 10.2487864648085,
TU35975 = 7.41959195648095, TU4897 = 10.9311685931669, TU9262 = 11.0918083964267,
TU18312 = 11.7076238975148, TU38793 = 9.74398564779285, TU30299 = 12.892315214803,
TU38794 = 9.54139631961704, TU16422 = 12.3329627148834, TU32068 = 7.97610519995008,
TU12311 = 10.3617106799956, TU18325 = 7.59060411317826, TU22117 = 9.03799676912002,
TU20746 = 9.178102720165, TU19660 = 9.87502757868133, TU41790 = 8.9943466756264,
TU43092 = 10.9585816938684, TU18309 = 10.6298994150062, TU19659 = 10.3934726050624,
TU16277 = 8.32556725898017, TU34798 = 7.02103110645297, TU10953 = 7.01860382462013,
TU18317 = 7.36244270525821, TU18307 = 11.3778296252987, TU9186 = 10.7024172065364,
TU17864 = 8.2903853475227, TU15658 = 6.58819311715545, TU14030 = 8.134641008701,
TU15669 = 7.01449935590416, TU9890 = 8.13988320730633, TU33617 = 10.6809972208427,
TU16279 = 7.9614057227348, TU27042 = 7.34221912393268, TU17167 = 11.2592403834747
), scale = FALSE, x = structure(c(24.4897868475554, 12.4416010164283,
12.3200413661576, 6.91612686789472, 30.5655787046573, 33.5373707608136,
6.7521417841798, 31.2938791704631, 29.0635289584208, -23.3354523484558,
-15.6229701200559, 6.43010789907339, -24.9147092475567, -31.0094950116289,
-28.4137928961069, -21.5926413362042, -3.97585196983663, -20.8563124842282,
-0.593920033332157, -3.64572299218967, -19.8492949360489, -9.96693484414473,
-23.5449684594658, -18.996265716943, -23.7811581634436, 3.93738430048,
9.37353195322868, -19.423648038774, 7.87596964384287, -3.13661328005585,
-7.09016527838172, 3.71259770410569, 23.247076153704, -2.03249135782906,
-3.64325919770972, -6.94450353973124, 7.55306940052889, 31.346240781817,
-3.48931847017886, 29.4056029647248, 12.4861765573918, -6.8883231131661,
-6.8786118382072, 15.8325477899497, 15.3870141654559, -11.3237572934353,
-4.49560209730399, 1.115062768913, -20.2141393532659, 9.76193925462921,
-1.15731242202584, 6.22677163564855, 14.431909276018, -13.4812455995592,
-9.58096578254001, -10.0824168036361, -10.1417065317313, 6.11246229818054,
-4.84525793168699, 14.9352609583166, 16.1272133946181, -17.0836840355263,
9.35451814718846, -6.63382933222961, 5.79244304277846, 7.73028939318989,
-6.00113726185851, -8.57575275731579, -6.70414747438031, 11.0021295692077,
7.62205208005063, -6.03281844054887, -1.59444275830952, -7.70227835025931,
-6.4184560830441, -12.3696585650364, 1.42826497938592, 8.28315195406988,
-13.8464231033084, -6.95076374785849, 5.03179685038719, 16.6482451825695,
25.4557137741208, -6.16437895161065, -0.188023057317339, 3.51919999146276,
-3.06021456766217, 12.7300628490286, 0.340348842202129, -4.18342952961951,
9.91999265542052, -6.2673275997563, -6.19445525060979, -4.89432563084305,
13.3155996092707, -17.5672684031691, -11.0570104414685, -10.1512940397755,
-2.83422832939901, 11.2933772476208, 18.438427176494, -10.6101681685668,
2.08048057352476, 5.50745324586983, -0.13719717270706, -8.9884667602456,
-2.05928444313446, -0.305773393272364, 4.86554463593651, 3.76285186780856,
6.3828926870771, -9.3655246100571, 7.43651870615979, -1.67082019758757,
10.9895599029683, -13.9919213196391, -7.47010213808747, -5.18316808251628,
3.09935494483666, 0.0636557688816208, -1.54858827353552, 5.76445544260896,
-7.0244817763404, -6.91485718432494, 6.12343812013661, 16.0347161023267,
-6.04452306419056, 0.503323158087318, 1.11905480618314, -3.32310396567328,
3.1274151532053, -1.0139189902977, -2.77210893619864, 5.73300675328722,
-2.20016077060467, 6.88733384115661, 9.29615931028018, 7.89283806484175,
-0.0231784873612931, -13.6472361241707, 8.57047305874539, 9.82836851225084,
-12.0042402273719, -9.50514572716062, -7.91330903314343, 8.52172081325052,
-3.03276814511544, -8.49580406093405, -2.33842120098311, -0.32804627167184,
-3.21259723306479, 11.1229701308803, 0.598883041283415, 5.30460923308376,
1.00174438392002, -1.97289932239362, -10.2991918599681, -3.87835358264123,
-2.25659286308468, -0.166946108131337, -4.78949081440092, 3.19183354598423,
4.8383258847991, 0.890821633270318, 14.2375666218091, -6.1498396420083,
0.00274092818159516, 2.69868755607018, -6.72994548395586, -2.87563409646143,
6.39162216555694, -1.86430696261611, 1.49349337044142, -0.729377873822674,
3.91976580406387, -4.55169784656593, 4.01470477896383, 9.45815735561592,
3.87143750044459, 2.8485319829077, -3.54554995799273, 2.1592779575771,
-10.2265407210419, -2.57734842434015, 3.85728531842232, 3.91861430861892,
-6.08938026261039, 2.90775931244037, -5.65086822564584, -7.43442226552497,
-0.28834246695089, 4.46777893840091, 1.61867182502613, -1.24379496084697,
3.09330484415506, 4.6129428255061, 4.21327794340158, -2.73480960596815,
-1.34501116390485, -4.95417459779772, -1.50853746838879, 4.27315750243976,
5.82184171959861, -3.417633941994, 9.09574374372561, -2.51371486672449,
-5.3839624715871, 4.02549123440248, -4.25205519103745, -6.14575157593085,
3.39653326861517, 2.02195972923006, 0.737129651195039, -3.82060608464456,
-5.8916049884138, -1.48103866101421, -4.15462594283813, 2.85762680978641,
8.01848063520863, -0.33318325779775, -4.11692676832453, -3.14609004733945,
-3.87716607273847, 2.15863837910027, 5.89633795035078, 6.78408908767204,
5.31335299395838, 2.26271596099398, -6.04004269690954, 0.66943773718038,
-7.25501768327073, -1.85352333808763, 0.881321761644734, -3.37300816578494,
1.72336449307423, -1.12738959732561, -1.00315691989581, 1.22856047955961,
-5.49078567616185, 7.36566150881169, 1.5098504796481, -4.40047569826546,
1.27392003732061, -1.32431052177641, -3.49056795319117, -1.81317399652518,
4.21470358856118, -3.35477920804357, 0.76847614798403, 4.53289945581295,
1.08860795433414, 2.64380516830634, -3.5282442958868, 0.44695028657078,
6.40236529107031, 1.40990912221294, -0.646731159533322, -0.886819655598922,
-0.75355529529178, -3.22681748481868, 1.14443040171423, -1.01721629940821,
-1.91406441412825, 2.79795257160194, 1.42125707801834, -3.78513731974819,
5.22015934186783, -3.11038146921718, 4.2502371748613, -2.23573426796635,
1.2890326250481, -3.2044887828359, -0.0731034485321765, 1.00689042463065,
3.10770789167095, 0.653717111815948, 2.0046773828616, -5.05502285926648,
0.670269628945531, -0.0735066911646989, 0.567378074513561, -4.12216401435608,
-1.34361612453716, -2.31031886740573, 4.81653041064168, 0.0225272846463933,
-2.29390683891735, -3.34883149458521, 1.62567523985947, 1.46413728406672,
2.19861127383831, -2.2813563892377, 1.48246659900362, 1.20813467297598,
4.19016124903691, -3.8965814643401, 3.56184752348759, -1.3878373295987,
1.21458977444305, -0.654562661488364, 0.95632241225039, -1.55232118983605,
-2.44238882925152, 1.13264815277383, -1.78862294430386, 0.991256365490394,
-3.88951966260596, 0.202107196565979, 0.551090451321218, 2.66348016156913,
-0.854309938495967, -0.232716071672556, 0.851674118269924, -0.985653498045505,
1.36933618443016, -0.586856938122795, -4.1119301713715, 1.0178280457984,
0.338189042904915, -3.94726389810293, 1.81377558126379, 1.58372328030388,
1.72308989346244, 2.19193280022478, -1.61256462530986, 1.96795000825428,
-0.618527965915178, 0.0756192601567935, -0.659358025397941, 0.0429550715360451,
-0.381324238450748, -0.652905276182954, 0.170764900323459, -0.641706794178386,
-0.0221222785810836, 2.30873232738461, 1.27649223277723, 0.0239704300112933,
1.61258498499148, -2.05589657580369, 0.0265571467877399, 1.25029287962319,
-0.571431828720408, -1.73619374916576, -0.0382088144200337, -0.321239936961026,
-0.611330806517872, -2.02090803294801, 3.14396363436869, -1.10262030332252,
-1.04168768271449, 0.37429480503427, 0.104514606536275, -0.478767952336214,
-0.192546893385304, 2.1627661920923, 0.195395664072845, -0.782469508379251,
2.08546244595102, -0.0517755897340584, -2.39907743930418, -0.211807017194547,
1.71381905614487, 0.83072521628824, -1.60469551897193, 0.245800797687136,
-1.46819802906202, 0.849407708022543, 0.917523253251796, -1.60319562494994,
1.89391093257302, 0.378604048008997, 0.14292959825461, -0.126413703865446,
-1.54645185235878, -0.749700454486876, -0.0658077625468692, 1.55140944467166,
0.302322289091245, 0.458890126236888, -0.788003883776506, -1.8522098865949,
-0.303600234099745, -0.869244048674518, 2.09285131170145, 1.13594169034256,
0.00257581110260907, 1.28821287823238, -0.603719944771219, -0.0929817189825319,
0.646083878133434, -0.997976432253114, -0.0887921104756663, -0.252335674196718,
0.885171983511843, -0.455664633944459, -0.080944547822266, -1.11153038212543,
0.684953529364659, 0.00107091275654292, -0.0523472212020604,
-0.722665903230519, 0.112695429436832, -0.431332703576418, 2.28632079906497,
0.389976510624337, -0.672770348738164, -0.710872748519771, 1.11097033239239,
-0.117525841496901, -0.38659967304807, -0.311519238694312, -0.58769206070627,
0.880912821150173, -0.223180949008615, -0.0563287542495416, 0.677577799103385,
0.174786309548343, -0.486054451272286, -0.875421020334039, -1.99840144432528e-15,
-2.19269047363468e-15, -2.80331313717852e-15, 3.39658856596259e-15,
4.44089209850063e-16, 4.44089209850063e-16, -2.44249065417534e-15,
1.11022302462516e-15, -6.66133814775094e-16, -4.44089209850063e-15,
-3.5527136788005e-15, -2.33146835171283e-15, -6.43929354282591e-15,
2.44249065417534e-15, -1.4432899320127e-15, -2.19269047363468e-15,
1.0547118733939e-15, -1.11022302462516e-15, -9.99200722162641e-16,
1.33226762955019e-15, -1.55431223447522e-15), .Dim = c(21L, 21L
), .Dimnames = list(c("EDA_01", "EDA_02", "EDA_03", "EDA_04",
"EDA_05", "EDA_06", "EDA_07", "EDA_08", "EDA_09", "NDA_01", "NDA_02",
"NDA_03", "NDA_04", "NDA_05", "NDA_06", "NDA_08", "NDA_09", "NDA_10",
"NDA_11", "NDA_12", "NDA_13"), c("PC1", "PC2", "PC3", "PC4",
"PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13",
"PC14", "PC15", "PC16", "PC17", "PC18", "PC19", "PC20", "PC21"
)))), class = "prcomp")
Here is the minimal code to reproduce this problem:
library(factoextra)
library(tidyverse)
# create a named factor for coding the coloration of the variables in the plot
markers <- facto_summarize(pca,
element = "var",
result = "contrib",
axes = c(1, 2)) %>%
mutate(candidate = ifelse(name == "TU35976" | name == "TU18317" | name == "TU12311" | name == "TU3565" | name == "TU9890" | name == "TU18316", "1", "0")) %>%
select(name, candidate)
markers_vec <- as.factor(markers$candidate)
names(markers_vec) <- markers$name
(var_cluster_PC12 <- fviz_pca_var(pca,
col.var = markers_vec,
axes = c(1,2),
select.var = list(contrib = 200),
palette = c(
"grey90",
"black"),
label = "none",
) +
theme_bw()
)
Which produces this plot:
This image doesn't quite do it justice, so here is a plot of the full data set that shows how bad the overlap is:
Probably the simplest method, given your particular colour scheme, is to make the arrows all black but use the alpha channel to make the gray ones gray. This means the black arrows will still be completely black even if other arrows are drawn over the top:
fviz_pca_var(pca,
axes = c(1,2),
select.var = list(contrib = 200),
alpha.var = ifelse(markers_vec == 0, 0.2, 1),
label = "none") +
theme_bw()

GSVA function to calculate ssGSEA score

I'm trying to run an R code for calculating the ssGSEA score between a gene expression dataset and a gene list.
The function I'm trying to run is:
GSVAtumor_UCS_Epi<-gsva(file, EM_gene_signature_tumor_KS_Epi_list, method=c("gsva", "ssgsea", "zscore", "plage"))
I'm facing the same error and two warning messages every time I run the code and there is not much information available for it over the internet for the same:
Error in relist(v, part) :
shape of 'skeleton' is not compatible with 'NROW(flesh)'
In addition: Warning messages:
1: In .filterFeatures(expr, method) :
6171 genes with constant expression values throuhgout the samples.
2: In .filterFeatures(expr, method) :
Since argument method!="ssgsea", genes with constant expression values are discarded.
Here EM_gene_signature_tumor_KS_Epi_list is
list(structure(list(...1 = c("KRT19", "AGR2", "RAB25", "CDH1",
"ERBB3", "FXYD3", "SLC44A4", "S100P", "SCNN1A", "GALNT3", "PRSS8",
"ELF3", "CEACAM6", "TMPRSS4", "CLDN7", "TACSTD2", "CLDN3", "EPCAM",
"SPINT1", "TSPAN1", "PLS1", "TMEM30B", "PRR15L", "KRT8", "ST14",
NA, "RBM47", "S100A14", "C1orf106", "NQO1", "TOX3", "PTK6", "TFF1",
"CLDN4", "GPRC5A", "TJP3", "KRT18", "MAP7", "CKMT1A", "ESRP1",
"MUC1", "SPINT2", "ESRP2", "CDS1", "PPAP2C", "CEACAM7", "TTC39A",
"OVOL2", "EHF", "AP1M2", "CEACAM5", "LAD1", "ARHGAP8", "TFF3",
"JUP", "CD24", "TMC5", "MLPH", "ELMO3", "ERBB2", "LLGL2", "DDR1",
"FA2H", "CBLC", "TMPRSS2", "LSR", "PERP", "POF1B", "MYO5C", "RAB11FIP1",
"MAPK13", "KRT7", "CEACAM1", "CXADR", "ATP2C2", "RNF128", "MPZL2",
"EPS8L1", "GALNT7", "CORO2A", "BCAS1", "TPD52", "ARHGAP32", "FUT2",
"OR7E14P", "GALE", "GRHL2", "BIK", "RAPGEFL1", "STYK1", "F11R",
"PKP3", "CYB561", "SH3YL1", "GDF15", "PSCA", "EZR", "TJP2", "FGFR3",
"FUT3", "BSPRY", "TOM1L1", "IRF6", "EPB41L4B", "OCLN", "LRRC1",
"C19orf21", "ABHD11", "EPS8L2", "MYO6", "TSPAN8", "MST1R", "SLC16A5",
"GPR56", "AZGP1", "TOB1", "SLC35A3", "TRPM4", "PHLDA2", "VAMP8",
"SLC22A18", "AKR1B10", "VAV3", "SPAG1", "ABCC3", "SYNGR2", "STAP2",
"C4orf19", "PPL", "PLLP", "DSG2", "HDHD3", "CD2AP", "MANSC1",
"DHCR24", "EPN3", "TUFT1", "GMDS", "EXPH5", "DSP", "SDC4", "IL20RA",
"FAM174B", "PTPRF", "SORD")), row.names = c(NA, -145L), class = c("tbl_df",
"tbl", "data.frame")))
And file is
new("ExpressionSet", experimentData = new("MIAME", name = "",
lab = "", contact = "", title = "", abstract = "", url = "",
pubMedIds = "", samples = list(), hybridizations = list(),
normControls = list(), preprocessing = list(), other = list(),
.__classVersion__ = new("Versions", .Data = list(c(1L, 0L,
0L), c(1L, 1L, 0L)))), assayData = <environment>, phenoData = new("AnnotatedDataFrame",
varMetadata = structure(list(labelDescription = "state"), row.names = "state", class = "data.frame"),
data = structure(list(state = c("TCGA-N6-A4V9-01A", "TCGA-QM-A5NM-01A",
"TCGA-N8-A4PM-01A", "TCGA-NG-A4VU-01A", "TCGA-NG-A4VW-01A",
"TCGA-N8-A4PN-01A", "TCGA-N5-A4RA-01A", "TCGA-N6-A4VD-01A",
"TCGA-N7-A4Y8-01A", "TCGA-N6-A4VE-01A", "TCGA-N5-A59F-01A",
"TCGA-N9-A4PZ-01A", "TCGA-N6-A4VF-01A", "TCGA-NF-A5CP-01A",
"TCGA-N6-A4VC-01A", "TCGA-N5-A4RF-01A", "TCGA-N8-A4PL-01A",
"TCGA-ND-A4WA-01A", "TCGA-N5-A4RU-01A", "TCGA-N9-A4Q3-01A",
"TCGA-NA-A4R1-01A", "TCGA-N7-A4Y5-01A", "TCGA-N5-A4RV-01A",
"TCGA-QN-A5NN-01A", "TCGA-N9-A4Q1-01A", "TCGA-N5-A59E-01A",
"TCGA-NA-A4QW-01A", "TCGA-N5-A4RM-01A", "TCGA-NF-A4X2-01A",
"TCGA-N5-A4RN-01A", "TCGA-N5-A4RS-01A", "TCGA-N8-A4PQ-01A",
"TCGA-N9-A4Q4-01A", "TCGA-NA-A4QY-01A", "TCGA-N5-A4RJ-01A",
"TCGA-N5-A4RD-01A", "TCGA-NA-A5I1-01A", "TCGA-NA-A4R0-01A",
"TCGA-NA-A4QV-01A", "TCGA-N7-A4Y0-01A", "TCGA-N5-A4R8-01A",
"TCGA-NF-A4WU-01A", "TCGA-N6-A4VG-01A", "TCGA-N8-A4PI-01A",
"TCGA-N8-A4PO-01A", "TCGA-N8-A4PP-01A", "TCGA-ND-A4WF-01A",
"TCGA-NA-A4QX-01A", "TCGA-N9-A4Q7-01A", "TCGA-N5-A4RO-01A",
"TCGA-N5-A4RT-01A", "TCGA-NF-A4WX-01A", "TCGA-N7-A59B-01A",
"TCGA-ND-A4W6-01A", "TCGA-N8-A56S-01A", "TCGA-ND-A4WC-01A"
)), row.names = c("TCGA-N6-A4V9-01A", "TCGA-QM-A5NM-01A",
"TCGA-N8-A4PM-01A", "TCGA-NG-A4VU-01A", "TCGA-NG-A4VW-01A",
"TCGA-N8-A4PN-01A", "TCGA-N5-A4RA-01A", "TCGA-N6-A4VD-01A",
"TCGA-N7-A4Y8-01A", "TCGA-N6-A4VE-01A", "TCGA-N5-A59F-01A",
"TCGA-N9-A4PZ-01A", "TCGA-N6-A4VF-01A", "TCGA-NF-A5CP-01A",
"TCGA-N6-A4VC-01A", "TCGA-N5-A4RF-01A", "TCGA-N8-A4PL-01A",
"TCGA-ND-A4WA-01A", "TCGA-N5-A4RU-01A", "TCGA-N9-A4Q3-01A",
"TCGA-NA-A4R1-01A", "TCGA-N7-A4Y5-01A", "TCGA-N5-A4RV-01A",
"TCGA-QN-A5NN-01A", "TCGA-N9-A4Q1-01A", "TCGA-N5-A59E-01A",
"TCGA-NA-A4QW-01A", "TCGA-N5-A4RM-01A", "TCGA-NF-A4X2-01A",
"TCGA-N5-A4RN-01A", "TCGA-N5-A4RS-01A", "TCGA-N8-A4PQ-01A",
"TCGA-N9-A4Q4-01A", "TCGA-NA-A4QY-01A", "TCGA-N5-A4RJ-01A",
"TCGA-N5-A4RD-01A", "TCGA-NA-A5I1-01A", "TCGA-NA-A4R0-01A",
"TCGA-NA-A4QV-01A", "TCGA-N7-A4Y0-01A", "TCGA-N5-A4R8-01A",
"TCGA-NF-A4WU-01A", "TCGA-N6-A4VG-01A", "TCGA-N8-A4PI-01A",
"TCGA-N8-A4PO-01A", "TCGA-N8-A4PP-01A", "TCGA-ND-A4WF-01A",
"TCGA-NA-A4QX-01A", "TCGA-N9-A4Q7-01A", "TCGA-N5-A4RO-01A",
"TCGA-N5-A4RT-01A", "TCGA-NF-A4WX-01A", "TCGA-N7-A59B-01A",
"TCGA-ND-A4W6-01A", "TCGA-N8-A56S-01A", "TCGA-ND-A4WC-01A"
), class = "data.frame"), dimLabels = c("sampleNames", "sampleColumns"
), .__classVersion__ = new("Versions", .Data = list(c(1L,
1L, 0L)))), featureData = new("AnnotatedDataFrame", varMetadata = structure(list(
labelDescription = character(0)), row.names = character(0), class = "data.frame"),
data = structure(list(), .Names = character(0), class = "data.frame", row.names = c("5_8S_rRNA",
"5S_rRNA", "7SK", "A1BG", "A1BG-AS1", "A1CF", "A2M", "A2M-AS1",
"A2ML1", "A2ML1-AS1", "A2ML1-AS2", "A2MP1", "A3GALT2", "A4GALT",
"A4GNT", "AA06", "AAAS", "AACS", "AACSP1", "AADAC", "AADACL2",
"AADACL2-AS1", "AADACL3", "AADACL4", "AADACP1", "AADAT",
"AAED1", "AAGAB", "AAK1", "AAMDC", "AAMP", "AANAT", "AAR2",
"AARD", "AARS", "AARS2", "AARSD1", "AARSP1", "AASDH", "AASDHPPT",
"AASS", "AATBC", "AATF", "AATK", "AATK-AS1", "AB015752.3",
"AB019438.66", "AB019440.50", "AB019441.29", "ABALON", "ABAT",
"ABBA01017803.1", "ABC12-47043100G14.2", "ABC12-47964100C23.1",
"ABC12-49244600F4.4", "ABC14-1080714F14.1", "ABC7-42391500H16.2",
"ABC7-42418200C9.1", "ABC7-43041300I9.1", "ABC7-481722F1.1",
"ABCA1", "ABCA10", "ABCA11P", "ABCA12", "ABCA13", "ABCA17P",
"ABCA2", "ABCA3", "ABCA4", "ABCA5", "ABCA6", "ABCA7", "ABCA8",
"ABCA9", "ABCA9-AS1", "ABCB1", "ABCB10", "ABCB10P1", "ABCB10P3",
"ABCB10P4", "ABCB11", "ABCB4", "ABCB5", "ABCB6", "ABCB7",
"ABCB8", "ABCB9", "ABCC1", "ABCC10", "ABCC11", "ABCC12",
"ABCC13", "ABCC2", "ABCC3", "ABCC4", "ABCC5", "ABCC5-AS1",
"ABCC6", "ABCC6P1", "ABCC6P2", "ABCC8", "ABCC9", "ABCD1",
"ABCD1P2", "ABCD1P3", "ABCD1P4", "ABCD1P5", "ABCD2", "ABCD3",
"ABCD4", "ABCE1", "ABCF1", "ABCF2", "ABCF2P1", "ABCF2P2",
"ABCF3", "ABCG1", "ABCG2", "ABCG4", "ABCG5", "ABCG8", "ABHD1",
"ABHD10", "ABHD11", "ABHD11-AS1", "ABHD12", "ABHD12B", "ABHD13",
"ABHD14A", "ABHD14A-ACY1", "ABHD14B", "ABHD15", "ABHD15-AS1",
"ABHD16A", "ABHD16B", "ABHD17A", "ABHD17AP1", "ABHD17AP3",
"ABHD17AP4", "ABHD17AP6", "ABHD17AP9", "ABHD17B", "ABHD17C",
"ABHD2", "ABHD3", "ABHD4", "ABHD5", "ABHD6", "ABHD8", "ABI1",
"ABI2", "ABI3", "ABI3BP", "ABL1", "ABL2", "ABLIM1", "ABLIM2",
"ABLIM3", "ABO", "ABR", "ABRA", "ABRACL", "ABT1", "ABT1P1",
"ABTB1", "ABTB2", "AC000003.1", "AC000029.1", "AC000032.2",
"AC000036.4", "AC000041.10", "AC000041.8", "AC000067.1",
"AC000068.10", "AC000068.5", "AC000068.9", "AC000077.2",
"AC000078.5", "AC000081.2", "AC000089.3", "AC000095.11",
"AC000095.9", "AC000099.1", "AC000110.1", "AC000111.3", "AC000111.4",
"AC000111.5", "AC000111.6", "AC000120.7", "AC000123.2", "AC000123.3",
"AC000123.4", "AC000124.1", "AC000354.1", "AC000362.1", "AC000367.1",
"AC000370.2", "AC000374.1", "AC000403.1", "AC000403.4", "AC001226.7",
"AC002044.1", "AC002044.3", "AC002044.4", "AC002056.3", "AC002056.5",
"AC002059.10", "AC002064.4", "AC002064.5", "AC002064.7",
"AC002066.1", "AC002069.5", "AC002069.6", "AC002070.1", "AC002072.1",
"AC002075.3", "AC002075.4", "AC002076.10", "AC002115.5",
"AC002115.9", "AC002116.7", "AC002116.8", "AC002117.1", "AC002127.2",
"AC002127.4", "AC002128.5", "AC002306.1", "AC002310.10",
"AC002310.12", "AC002310.13", "AC002310.14", "AC002310.17",
"AC002310.7", "AC002314.4", "AC002331.1", "AC002365.5", "AC002366.1",
"AC002366.3", "AC002368.4", "AC002383.2", "AC002386.1", "AC002389.1",
"AC002395.1", "AC002398.11", "AC002398.12", "AC002398.13",
"AC002398.9", "AC002400.1", "AC002401.1", "AC002407.1", "AC002429.1",
"AC002429.4", "AC002429.5", "AC002451.3", "AC002454.1", "AC002456.2",
"AC002463.3", "AC002464.1", "AC002465.2", "AC002467.7", "AC002472.11",
"AC002480.2", "AC002480.3", "AC002480.4", "AC002480.5", "AC002486.2",
"AC002486.3", "AC002511.2", "AC002511.3", "AC002519.6", "AC002519.8",
"AC002523.1", "AC002530.1", "AC002539.1", "AC002539.2", "AC002542.2",
"AC002543.2", "AC002550.5", "AC002550.6", "AC002551.1", "AC002553.4",
"AC002558.1", "AC002978.1", "AC002979.1", "AC002981.1", "AC002984.2",
"AC002985.3", "AC003001.1", "AC003002.4", "AC003002.6", "AC003003.5",
"AC003005.2", "AC003005.4", "AC003006.1", "AC003006.7", "AC003009.1",
"AC003045.1", "AC003075.4", "AC003080.4", "AC003084.2", "AC003088.1",
"AC003090.1", "AC003092.1", "AC003092.2", "AC003101.1", "AC003104.1",
"AC003658.1", "AC003664.1", "AC003666.1", "AC003681.1", "AC003682.16",
"AC003682.17", "AC003688.1", "AC003956.1", "AC003958.2",
"AC003958.6", "AC003968.1", "AC003973.1", "AC003973.3", "AC003973.4",
"AC003973.5", "AC003984.1", "AC003985.1", "AC003986.5", "AC003986.6",
"AC003986.7", "AC003988.1", "AC003989.3", "AC003989.4", "AC003991.3",
"AC004000.1", "AC004000.2", "AC004004.2", "AC004006.2", "AC004009.1",
"AC004009.2", "AC004009.3", "AC004012.1", "AC004014.3", "AC004014.4",
"AC004016.1", "AC004019.10", "AC004019.13", "AC004022.7",
"AC004022.8", "AC004041.2", "AC004051.2", "AC004052.1", "AC004053.1",
"AC004053.2", "AC004054.1", "AC004057.1", "AC004062.2", "AC004063.1",
"AC004066.2", "AC004066.3", "AC004067.5", "AC004069.1", "AC004069.2",
"AC004070.1", "AC004074.4", "AC004076.5", "AC004076.7", "AC004076.9",
"AC004079.1", "AC004108.1", "AC004112.4", "AC004112.5", "AC004112.7",
"AC004125.3", "AC004129.7", "AC004129.9", "AC004156.3", "AC004158.1",
"AC004158.3", "AC004159.1", "AC004160.4", "AC004166.6", "AC004221.2",
"AC004231.2", "AC004237.1", "AC004257.1", "AC004381.6", "AC004381.7",
"AC004383.3", "AC004386.3", "AC004386.4", "AC004447.2", "AC004448.2",
"AC004448.5", "AC004449.6", "AC004453.1", "AC004453.8", "AC004458.1",
"AC004460.1", "AC004461.4", "AC004470.1", "AC004471.10",
"AC004471.9", "AC004477.1", "AC004485.3", "AC004490.1", "AC004492.1",
"AC004510.3", "AC004520.1", "AC004535.2", "AC004538.3", "AC004540.4",
"AC004540.5", "AC004541.1", "AC004543.1", "AC004543.2", "AC004549.6",
"AC004552.1", "AC004593.3", "AC004595.1", "AC004603.4", "AC004623.2",
"AC004623.3", "AC004637.1", "AC004655.1", "AC004656.1", "AC004673.1",
"AC004687.1", "AC004691.1", "AC004691.5", "AC004692.4", "AC004692.5",
"AC004699.1", "AC004702.2", "AC004744.3", "AC004745.1", "AC004754.3",
"AC004769.1", "AC004775.5", "AC004791.2", "AC004812.1", "AC004813.1",
"AC004816.1", "AC004819.1", "AC004824.1", "AC004824.2", "AC004832.1",
"AC004837.1", "AC004837.3", "AC004837.4", "AC004837.5", "AC004840.8",
"AC004846.1", "AC004850.1", "AC004854.4", "AC004854.5", "AC004862.6",
"AC004866.1", "AC004866.3", "AC004869.2", "AC004869.3", "AC004870.3",
"AC004870.4", "AC004870.5", "AC004875.1", "AC004878.2", "AC004878.8",
"AC004893.10", "AC004893.11", "AC004895.1", "AC004895.4",
"AC004899.3", "AC004901.1", "AC004906.3", "AC004911.2", "AC004915.1",
"AC004920.2", "AC004920.3", "AC004924.1", "AC004932.1", "AC004938.5",
"AC004941.3", "AC004941.5", "AC004943.1", "AC004945.1", "AC004946.1",
"AC004947.2", "AC004951.5", "AC004951.6", "AC004953.1", "AC004967.7",
"AC004969.1", "AC004980.1", "AC004980.10", "AC004980.11",
"AC004980.7", "AC004980.8", "AC004980.9", "AC004984.1", "AC004985.12",
"AC004987.10", "AC004987.9", "AC004988.1", "AC005000.1",
"AC005007.3", "AC005008.2", "AC005008.3", "AC005009.1", "AC005009.2",
"AC005013.5", "AC005014.5", "AC005017.2", "AC005019.2", "AC005019.3",
"AC005020.1", "AC005024.1", "AC005027.3", "AC005033.6", "AC005034.2",
"AC005037.1", "AC005037.3", "AC005037.4", "AC005037.6", "AC005040.3",
"AC005041.11", "AC005042.1", "AC005042.2", "AC005042.3",
"AC005042.4", "AC005042.5", "AC005048.1", "AC005052.1", "AC005062.2",
"AC005071.1", "AC005071.2", "AC005071.3", "AC005071.4", "AC005076.5",
"AC005077.12", "AC005077.14", "AC005077.5", "AC005077.7",
"AC005077.8", "AC005077.9", "AC005082.1", "AC005082.12",
"AC005083.1", "AC005086.1", "AC005086.2", "AC005086.3", "AC005088.1",
"AC005094.2", "AC005102.1", "AC005104.3", "AC005105.2", "AC005150.1",
"AC005150.2", "AC005150.3", "AC005152.3", "AC005154.6", "AC005154.7",
"AC005154.8", "AC005158.1", "AC005159.1", "AC005160.3", "AC005162.4",
"AC005162.5", "AC005176.1", "AC005176.2", "AC005176.3", "AC005178.1",
"AC005187.1", "AC005189.6", "AC005197.2", "AC005204.1", "AC005215.1",
"AC005220.3", "AC005224.2", "AC005227.1", "AC005229.1", "AC005229.5",
"AC005229.7", "AC005235.1", "AC005237.2", "AC005237.4", "AC005251.3",
"AC005253.2", "AC005253.4", "AC005255.3", "AC005255.5", "AC005255.6",
"AC005256.1", "AC005262.2", "AC005262.3", "AC005262.4", "AC005264.2",
"AC005276.1", "AC005281.1", "AC005281.2", "AC005284.1", "AC005284.2",
"AC005288.1", "AC005300.5", "AC005301.8", "AC005304.1", "AC005306.3",
"AC005307.1", "AC005307.3", "AC005324.6", "AC005324.7", "AC005329.7",
"AC005330.2", "AC005336.4", "AC005336.5", "AC005339.1", "AC005339.2",
"AC005351.1", "AC005355.1", "AC005355.2", "AC005355.3", "AC005357.1",
"AC005358.3", "AC005363.11", "AC005363.9", "AC005371.1",
"AC005375.1", "AC005387.2", "AC005387.3", "AC005391.2", "AC005392.13",
"AC005394.1", "AC005412.1", "AC005477.1", "AC005480.1", "AC005481.5",
"AC005487.2", "AC005488.11", "AC005498.1", "AC005498.3",
"AC005498.4", "AC005510.3", "AC005513.1", "AC005514.2", "AC005517.3",
"AC005518.2", "AC005519.4", "AC005522.6", "AC005522.7", "AC005523.2",
"AC005523.3", "AC005532.5", "AC005534.6", "AC005534.8", "AC005537.2",
"AC005538.1", "AC005538.3", "AC005538.5", "AC005539.2", "AC005540.1",
"AC005540.3", "AC005546.2", "AC005549.1", "AC005549.2", "AC005550.3",
"AC005550.5", "AC005559.3", "AC005562.1", "AC005562.2", "AC005578.3",
"AC005588.2", "AC005592.1", "AC005592.2", "AC005592.3", "AC005593.2",
"AC005597.1", "AC005599.1", "AC005606.14", "AC005606.15",
"AC005609.16", "AC005609.17", "AC005609.18", "AC005609.19",
"AC005609.2", "AC005609.20", "AC005614.3", "AC005614.5",
"AC005616.1", "AC005616.2", "AC005618.6", "AC005618.8", "AC005618.9",
"AC005621.1", "AC005624.2", "AC005625.1", "AC005626.3", "AC005631.1",
"AC005668.1", "AC005682.5", "AC005682.6", "AC005682.7", "AC005686.1",
"AC005701.1", "AC005702.1", "AC005702.2", "AC005702.3", "AC005702.4",
"AC005703.2", "AC005703.3", "AC005722.4", "AC005725.1", "AC005730.2",
"AC005740.3", "AC005740.4", "AC005740.5", "AC005740.6", "AC005741.2",
"AC005752.10", "AC005753.1", "AC005754.7", "AC005754.8",
"AC005757.6", "AC005757.7", "AC005758.1", "AC005772.2", "AC005775.2",
"AC005776.1", "AC005777.3", "AC005779.2", "AC005780.1", "AC005783.1",
"AC005785.2", "AC005785.5", "AC005786.3", "AC005786.5", "AC005786.6",
"AC005786.7", "AC005789.9", "AC005794.1", "AC005795.1", "AC005796.2",
"AC005808.3", "AC005822.1", "AC005828.1", "AC005838.2", "AC005863.1",
"AC005863.2", "AC005884.1", "AC005901.1", "AC005915.1", "AC005926.1",
"AC005932.1", "AC005943.6", "AC005944.2", "AC005954.3", "AC005954.4",
"AC006000.5", "AC006003.3", "AC006004.1", "AC006007.1", "AC006011.4",
"AC006014.7", "AC006014.8", "AC006019.1", "AC006019.3", "AC006019.4",
"AC006022.4", "AC006026.1", "AC006026.10", "AC006026.12",
"AC006026.13", "AC006026.9", "AC006028.11", "AC006033.22",
"AC006037.2", "AC006041.1", "AC006042.6", "AC006042.7", "AC006042.8",
"AC006050.2", "AC006070.12", "AC006076.1", "AC006077.3",
"AC006077.4", "AC006088.1", "AC006115.1", "AC006115.6", "AC006116.1",
"AC006116.12", "AC006116.13", "AC006116.14", "AC006116.15",
"AC006116.17", "AC006116.19", "AC006116.20", "AC006116.21",
"AC006116.22", "AC006116.24", "AC006116.27", "AC006126.3",
"AC006126.4", "AC006128.2", "AC006129.1", "AC006129.2", "AC006129.3",
"AC006130.1", "AC006130.3", "AC006130.4", "AC006133.3", "AC006133.7",
"AC006145.1", "AC006145.4", "AC006150.1", "AC006150.2", "AC006153.3",
"AC006156.2", "AC006159.4", "AC006159.5", "AC006160.5", "AC006195.2",
"AC006196.1", "AC006227.1", "AC006262.10", "AC006262.11",
"AC006262.4", "AC006262.5", "AC006272.1", "AC006272.2", "AC006273.4",
"AC006273.5", "AC006277.2", "AC006277.3", "AC006288.1", "AC006296.1",
"AC006296.2", "AC006322.1", "AC006326.3", "AC006326.5", "AC006328.1",
"AC006328.2", "AC006328.3", "AC006328.4", "AC006328.9", "AC006335.10",
"AC006335.11", "AC006335.2", "AC006335.6", "AC006355.3",
"AC006366.3", "AC006369.2", "AC006369.3", "AC006371.1", "AC006372.4",
"AC006372.5", "AC006372.6", "AC006373.1", "AC006377.1", "AC006378.2",
"AC006380.1", "AC006380.3", "AC006386.1", "AC006390.4", "AC006427.2",
"AC006445.1", "AC006445.6", "AC006445.7", "AC006449.2", "AC006452.1",
"AC006452.2", "AC006458.3", "AC006460.2", "AC006461.1", "AC006461.2",
"AC006466.5", "AC006478.1", "AC006480.1", "AC006482.1", "AC006483.1",
"AC006483.5", "AC006486.10", "AC006486.9", "AC006487.1",
"AC006499.1", "AC006499.2", "AC006499.3", "AC006499.4", "AC006499.5",
"AC006499.6", "AC006499.7", "AC006499.9", "AC006509.4", "AC006509.7",
"AC006534.1", "AC006534.2", "AC006534.3", "AC006538.1", "AC006538.4",
"AC006538.8", "AC006539.1", "AC006539.2", "AC006539.3", "AC006539.6",
"AC006547.13", "AC006547.14", "AC006547.15", "AC006547.8",
"AC006548.19", "AC006548.26", "AC006548.28", "AC006552.1",
"AC006557.1", "AC006840.1", "AC006925.1", "AC006926.1", "AC006942.4",
"AC006946.12", "AC006946.15", "AC006946.16", "AC006946.17",
"AC006947.1", "AC006960.5", "AC006960.7", "AC006978.6", "AC006987.4",
"AC006987.5", "AC006987.6", "AC006987.7", "AC006988.1", "AC006989.2",
"AC006994.1", "AC006994.2", "AC006994.3", "AC006995.8", "AC007000.10",
"AC007000.11", "AC007000.12", "AC007003.1", "AC007006.1",
"AC007009.1", "AC007009.2", "AC007016.3", "AC007036.4", "AC007036.5",
"AC007036.6", "AC007038.7", "AC007040.1", "AC007040.11",
"AC007040.2", "AC007040.3", "AC007040.6", "AC007040.8", "AC007041.1",
"AC007041.2", "AC007050.1", "AC007050.17", "AC007050.18",
"AC007056.1", "AC007064.22", "AC007064.24", "AC007064.25",
"AC007078.4", "AC007091.1", "AC007096.1", "AC007098.1", "AC007099.1",
"AC007099.2", "AC007106.1", "AC007115.3", "AC007126.1", "AC007128.1",
"AC007131.1", "AC007131.2", "AC007131.3", "AC007136.1", "AC007161.5",
"AC007163.1", "AC007163.10", "AC007163.11", "AC007163.2",
"AC007163.3", "AC007163.6", "AC007163.8", "AC007163.9", "AC007179.1",
"AC007179.2", "AC007182.6", "AC007191.4", "AC007192.6", "AC007193.10",
"AC007193.6", "AC007193.8", "AC007193.9", "AC007204.2", "AC007204.3",
"AC007216.1", "AC007224.1", "AC007228.11", "AC007228.5",
"AC007228.8", "AC007228.9", "AC007229.3", "AC007237.2", "AC007238.1",
"AC007241.1", "AC007242.1")), dimLabels = c("featureNames",
"featureColumns"), .__classVersion__ = new("Versions", .Data = list(
c(1L, 1L, 0L)))), annotation = character(0), protocolData = new("AnnotatedDataFrame",
varMetadata = structure(list(labelDescription = character(0)), row.names = character(0), class = "data.frame"),
data = structure(list(), .Names = character(0), class = "data.frame", row.names = c("TCGA-N6-A4V9-01A",
"TCGA-QM-A5NM-01A", "TCGA-N8-A4PM-01A", "TCGA-NG-A4VU-01A",
"TCGA-NG-A4VW-01A", "TCGA-N8-A4PN-01A", "TCGA-N5-A4RA-01A",
"TCGA-N6-A4VD-01A", "TCGA-N7-A4Y8-01A", "TCGA-N6-A4VE-01A",
"TCGA-N5-A59F-01A", "TCGA-N9-A4PZ-01A", "TCGA-N6-A4VF-01A",
"TCGA-NF-A5CP-01A", "TCGA-N6-A4VC-01A", "TCGA-N5-A4RF-01A",
"TCGA-N8-A4PL-01A", "TCGA-ND-A4WA-01A", "TCGA-N5-A4RU-01A",
"TCGA-N9-A4Q3-01A", "TCGA-NA-A4R1-01A", "TCGA-N7-A4Y5-01A",
"TCGA-N5-A4RV-01A", "TCGA-QN-A5NN-01A", "TCGA-N9-A4Q1-01A",
"TCGA-N5-A59E-01A", "TCGA-NA-A4QW-01A", "TCGA-N5-A4RM-01A",
"TCGA-NF-A4X2-01A", "TCGA-N5-A4RN-01A", "TCGA-N5-A4RS-01A",
"TCGA-N8-A4PQ-01A", "TCGA-N9-A4Q4-01A", "TCGA-NA-A4QY-01A",
"TCGA-N5-A4RJ-01A", "TCGA-N5-A4RD-01A", "TCGA-NA-A5I1-01A",
"TCGA-NA-A4R0-01A", "TCGA-NA-A4QV-01A", "TCGA-N7-A4Y0-01A",
"TCGA-N5-A4R8-01A", "TCGA-NF-A4WU-01A", "TCGA-N6-A4VG-01A",
"TCGA-N8-A4PI-01A", "TCGA-N8-A4PO-01A", "TCGA-N8-A4PP-01A",
"TCGA-ND-A4WF-01A", "TCGA-NA-A4QX-01A", "TCGA-N9-A4Q7-01A",
"TCGA-N5-A4RO-01A", "TCGA-N5-A4RT-01A", "TCGA-NF-A4WX-01A",
"TCGA-N7-A59B-01A", "TCGA-ND-A4W6-01A", "TCGA-N8-A56S-01A",
"TCGA-ND-A4WC-01A")), dimLabels = c("sampleNames", "sampleColumns"
), .__classVersion__ = new("Versions", .Data = list(c(1L,
1L, 0L)))), .__classVersion__ = new("Versions", .Data = list(
c(4L, 1L, 2L), c(2L, 54L, 0L), c(1L, 3L, 0L), c(1L, 0L, 0L
))))
All suggestions shall be helpful.

Svm Multi-Classification in R

I am using the SVM model for the classification of the data given below, but I don't know why I am getting this error. I have tried using two methods but both are not working. Please help me I am stuck for a very long. I have seen many posts here and tried to specify my model for classification but no results.
My data:
structure(list(pCAMKII_N = c(-0.145868903106222, -0.0757245672281776,
0.23642582674556, 0.148460249143042, -0.00305230227892469, 0.0585561745843138,
-0.148682825543474, -0.21730129212525, 0.459967321113158, 0.422894418061546,
-0.0575744512697957, -0.127564153510276, -0.242697988154887,
-0.095402375827381, 0.0140296834402993, -0.0497934688280284),
pCREB_N = c(-0.0825121744625299, -0.026500034184616, 0.0674710705932882,
-0.171872159375326, 0.0599673008600893, 0.20274815322096,
-0.138321776880784, -0.179229652914255, -0.031683391484602,
-0.107073356219089, 0.0795112065683711, 0.0230878800052553,
-0.101810049763974, 0.141596706516054, 0.175052271845758,
0.0962492148671607), pMEK_N = c(-0.011827795918493, 0.0651085636651456,
0.0372073300493682, -0.0758375679929981, 0.038855171657283,
0.162735732819232, -0.129245969397597, -0.10183076411972,
-0.030313508584495, -0.0402009321267793, 0.0265091904210039,
0.0384635318143068, -0.145082961476379, -0.00383809286152744,
0.00274224616628268, 0.0325875706999738), pNR2A_N = c(-0.040694436939677,
-0.126422726919893, 0.327029496785507, 0.11289764061805,
0.00949037400844992, -0.0370143413154391, -0.0445050341199518,
-0.0875679863319538, -0.0318024269145471, -0.0990796159280345,
0.114103842731325, 0.0684955162565601, -0.0517765103296767,
0.0262937180568668, 0.0186704564656926, -0.069607116867091
), pPKCAB_N = c(-0.0732668154024626, 0.259508683035786, -0.156388727351903,
-0.128555140589917, 0.233485439385613, -0.109922421599626,
-0.230899862755971, -0.275680739843144, 0.202586893320354,
0.128569221313288, -0.187404269824716, -0.123823456903658,
-0.0510954627942524, 0.224263475958852, -0.110903224987034,
-0.0622911739357286), pRSK_N = c(-0.0830647198678661, 0.171345235902955,
-0.00771685629829743, -0.153792422272828, 0.0775638466765593,
0.0562653498716256, -0.138802407016646, -0.115702091265824,
0.161592613345935, 0.120453263851679, -0.0389173648044295,
-0.0711265266002543, -0.207578315767319, -0.0270749356104633,
0.0589442953743869, 0.0144541906539012), AKT_N = c(0.0481798874438209,
-0.0923315388558725, -0.108885641561443, -0.105416833062579,
0.144880510212411, 0.00523331467580219, 0.0328578246677392,
0.0571445022606188, -0.0209256486347021, -0.0730029998614634,
0.0440023583125468, 0.0717278333163182, 0.0196560602422922,
0.0988713938163715, 0.0527286790966814, 0.0229037502299382
), BRAF_N = c(-0.00321939692704801, 0.0962073093317588, -0.0677402898524546,
-0.067209980101031, -0.0192180601759131, 0.0499710838529006,
-0.0685860451987449, -0.0621210254646294, 0.0464452196252293,
0.0717595906404571, -0.0808646010953599, -0.070139309127312,
0.0260226905885634, 0.0307477583500104, -0.0495839406552054,
-0.0605696564634389), CREB_N = c(0.0633377024959499, 0.0719351180508572,
0.0554860017614535, -0.0754709592333137, -0.051730811130647,
0.0770585706175764, -0.119490365368989, -0.101979827161643,
0.0390935428793637, 0.0334190803939948, -0.0231648718807617,
0.175244016989004, -0.199464488371739, -0.0830526740916612,
-0.0236000029056659, -0.0555939459680455), ERK_N = c(0.113758147959477,
-0.0935376622896181, -0.194533549084613, -0.202343017546552,
0.368811506067506, 0.0211924441765911, -0.166177103411079,
-0.239377414372715, 0.0512242092661902, -0.030723497203822,
0.00664926832340125, -0.105494671248667, 0.143740808738886,
0.306473059519756, 0.068383724577022, 0.0171957013321164),
GSK3B_N = c(0.0496851372868314, 0.0965673122890421, -0.122194260011564,
-0.113614901308566, 0.147165890990766, -0.0568100186969033,
-0.150554531109297, -0.188598927874271, 0.0729314311629536,
0.0534454310403283, -0.0530979322493377, -0.108715383018256,
0.0774398337859832, 0.133178525946526, 0.00917139328707758,
0.00415362892452407), JNK_N = c(0.084671436503407, 0.091451395958942,
-0.0735719764555032, -0.128089296490928, 0.0482424225269525,
0.136559678562216, -0.0983547253737015, -0.0994914255127194,
0.00287013911408683, -0.0207264777165356, -0.0425235674499462,
-0.0328911666055918, -0.102415581508767, 0.0426548346554378,
-0.0453706640514963, 0.0837146521123543), MEK_N = c(0.0415145904202766,
0.000112891679066114, -0.0947656593375573, -0.161573116350825,
0.217458153608386, 0.132508968100251, -0.177468380610068,
-0.18842935475728, 0.00445721815704893, -0.0539245065836939,
-0.00307155552655238, 0.0116656936964918, -0.100533579935951,
0.19149971269713, 0.15252996223312, 0.0956503457831564),
RSK_N = c(0.0191395815813382, 0.0714942086955356, 0.0161998863368589,
-0.184560332102979, -0.0264979202843543, 0.298908704096619,
-0.0968942910305665, -0.0189051673871464, 0.0861641375591587,
0.0160470100470935, -0.0682290713635209, -0.0518589639648677,
-0.23241046414349, -0.0542963774080875, -0.0873418795312474,
0.0210347924349621), APP_N = c(-0.0806791681338731, -0.0704201146133004,
-0.190200351582733, -0.162718360121692, 0.0303369406177179,
-0.0860104704967967, -0.162468694656265, -0.186756215303488,
0.149403011555697, 0.0234829670280346, 0.0759128457278766,
0.0934903179979386, 0.105907786308873, 0.361038543968712,
0.0786334044736174, 0.0784404724592734), Bcatenin_N = c(-0.0609377198837611,
-0.111471497502357, -0.0866850028872295, -0.134271109042703,
0.197879694030571, -0.025717790316679, -0.114779722205815,
-0.215166874658, 0.093663448787465, -0.0106410825979063,
0.0856165346234392, -0.0915811784652404, -0.0313801262102451,
0.220238809782054, 0.13789742580927, 0.141644968613549),
SOD1_N = c(-0.123838690502292, -0.144130158837663, 0.0727560720797953,
-0.0681671745118475, -0.123567494179754, -0.117023734873497,
0.253293745880715, 0.185224720298962, -0.11802985927293,
-0.143547249900102, 0.47503997511273, 0.434217391632064,
-0.15212803487222, -0.106940962031447, 0.100783205025425,
0.363303202025603), P38_N = c(0.0135880916776172, -0.0645721208196919,
0.0948843285406695, 0.159312513843406, -0.0770493007707386,
-0.107486334544236, 0.150819778231829, 0.217491472288877,
-0.121236098381148, -0.130587965985436, 0.0116164053669351,
0.144776197754908, -0.158244000282848, -0.13848656873568,
0.0539113322660321, -0.0721957070846476), DSCR1_N = c(0.0873105225377593,
-0.0399938541478373, -0.0423959808617725, 0.0615326056646092,
-0.0290529787358271, 0.0522204008570095, -0.0475227862097225,
0.0308446987929902, -0.0305665225181376, -0.0607456490874483,
0.0279790218604084, 0.100583918291236, -0.0206748799372295,
0.010415281028328, -0.0414425004790977, -0.0489198196614915
), NR2B_N = c(0.106299550498296, -0.0381078612482542, -0.00101679889831333,
0.0267320329216243, 0.112439396399247, -0.064052196844109,
-0.00641666140192624, 0.0613191854808411, 0.0168607292707449,
-0.0487573287523953, -0.0439584530719966, 0.00809905456774659,
-0.0667726467406412, 0.0694971401183639, -0.000212905759537097,
0.0163350414150324), pNUMB_N = c(0.202564418361944, -0.00200124352888242,
-0.0998561853278869, 0.037524195854859, 0.149886434896155,
0.195128273020257, -0.195094705493063, -0.140281085662283,
0.0590093896988644, 0.00582004770130322, -0.0546687365873218,
0.0551625036706637, 0.0777195935539914, 0.036101539026412,
0.0107519309923, -0.103469871374173), TIAM1_N = c(0.058847821102376,
-0.159760016471791, -0.0979806570256097, 0.0531257042802172,
0.103564419565561, -0.0238368367628548, -0.0729210307202995,
-0.06325777516333, -0.0281144756311353, -0.0884600747007959,
0.00512281704622422, 0.0615056543435742, -0.00313409869767671,
0.0899369569840853, 0.120845861658354, -0.00443043623680605
), pP70S6_N = c(-0.217859954507296, 0.243521933127221, 0.0425412592499045,
0.0832466388027541, -0.0874992096268626, -0.14876403578688,
-0.00476984544201101, 0.0106283984338779, 0.114328759061199,
0.125171996276406, -0.0925437220067121, -0.0570200090555343,
-0.252313164764891, -0.183959220656612, 0.189234923062614,
0.179602221371295), NUMB_N = c(0.0507161136495314, -0.0428893884462266,
-0.0737803369486708, -0.125816787402445, 0.157329290628144,
-0.0618269592229841, -0.121271771020323, -0.208391773663935,
0.0398518709801874, -0.015557253715229, -0.0686033888733257,
-0.146899366608736, 0.229868831769603, 0.328004434107362,
0.262082754277244, 0.270980403077601), P70S6_N = c(-0.0467645544881666,
-0.0513422563937406, 0.0806193466797829, -0.097604174996586,
0.169381505159102, -0.10953472581413, -0.0762873839439222,
-0.137957724239911, -0.0404929923772219, -0.112679782727059,
0.0478687778434949, -0.135047834380878, 0.235505540876976,
0.101996139976229, 0.0881984401256723, 0.0308682316870565
), pGSK3B_N = c(0.0726318660370534, 0.0113934692941635, -0.0784493639363762,
-0.129201494480153, 0.157796847802845, 0.23002474684606,
-0.156189105610425, -0.139272331325838, 0.118225045060094,
0.100304800513178, -0.0300757618933809, 0.0285299986456296,
-0.0120541561865572, 0.0908216848045133, -0.0023908457607024,
0.0089400750177918), pPKCG_N = c(-0.286386712047411, 0.265957237376396,
0.0737964172058239, -0.0759384400199, -0.0177238455253068,
-0.261634570955355, -0.253741047251584, -0.256650485194398,
0.134270402692566, 0.120849091119421, -0.146949388514596,
-0.142381255596242, -0.324527167558674, 0.195095873727953,
0.208752130225386, 0.246345320116692), CDK5_N = c(0.0835756577065185,
0.00364250782584705, -0.0635878598042922, -0.0665527642492147,
0.0498548879577531, -0.0037462363944042, -0.0709716342392349,
-0.109665096982383, -0.00693856902849091, 0.0043142382793781,
-0.00379427922410826, 0.0233969910641444, -0.000723497291038827,
0.106033840892453, 0.029827781661049, 0.0297508490072604),
S6_N = c(0.168888926042562, 0.230803056253277, -0.154902829994192,
-0.269491504226569, 0.142290171760069, 0.252241256219668,
-0.23854742286132, -0.264415247456924, 0.290083441282089,
0.238143298906295, -0.198459186518937, -0.263240335960755,
0.238832926146062, 0.35530004861393, 0.427790444668465, 0.360513465094153
), ADARB1_N = c(0.224098318811728, 0.0338977810779033, 0.116024199822639,
-0.00457055801051897, 0.530704385640093, -0.178020136682188,
-0.113465216543545, -0.173452014027142, 0.00633272386184758,
-0.0237300986226981, 0.139970553648416, 0.00713778435199307,
0.356303393951797, 0.328108176871799, -0.103822560250247,
-0.160096407917707), RRP1_N = c(0.00159121579454942, -0.0299422881516384,
0.0173826784335047, 0.0386298578057867, -0.022152469642015,
0.0369774839239829, -0.0197907278638186, -0.0201116884888817,
-0.016726870724063, -0.0138128805216459, 0.00747529027834608,
0.0385018374429109, -0.0165448322480326, -0.00614007382478539,
-0.00733137421781927, 0.0183421735187617), BAX_N = c(0.0348507900184639,
-0.169715973558917, 0.0312101948023616, 0.0728175524004573,
0.179257945173096, -0.00628218585999311, -0.114699647957541,
-0.213302817321221, -0.0219721111119517, -0.0411959352332957,
0.0140823449452806, 0.00562779088047583, -0.0465748954281123,
0.166914376799791, 0.121181906942324, 0.0465930748380351),
ERBB4_N = c(0.226825268882082, -0.124939501170309, -0.0779332590062461,
-0.18657539448526, 0.186503290026721, -0.209722491963456,
-0.0376960514068148, 0.0222951541745705, -0.058799632488138,
-0.106621802599657, 0.037095159045507, -0.0713172478048624,
0.0826014680466721, 0.0644672868926184, -0.022902877277575,
0.0811348220744181), nNOS_N = c(-0.0597607386610167, 0.0694317666060796,
0.0267840157110256, -0.0466611419857235, -0.0427174888142891,
-0.312236651256378, -0.010954182164099, -0.152991551731999,
-0.0500742377998905, -0.112776761155327, -0.0702701990622843,
-0.158725995917858, -0.170582110044521, -0.195995554048211,
0.270601021309697, 0.164312802991015), Tau_N = c(-0.0295470448997678,
-0.0135843635099774, -0.0532058617661047, -0.0555870385379599,
0.0413976507530296, -0.134898190226349, -0.0588315550075754,
-0.0795207957893949, -0.00171411389248874, -0.0482028991095779,
-0.132181492884161, -0.16272346727488, 0.0684355887357164,
0.0845081538871629, 0.17928411442039, 0.399425311619017),
GFAP_N = c(0.1022369732202, -0.0375872399271431, 0.0389750353783662,
-0.0504675751546967, 0.0274358635290079, 0.1734228779599,
-0.0412006018348187, -0.0716080720004096, 0.00463136477041947,
0.0395185137074335, -0.0488608095557386, 0.133429595736969,
-0.0456410825935039, -0.0308800819276867, -0.0205041295367554,
0.00291773400108061), GluR3_N = c(-0.030610619693228, -0.0419884945813332,
-0.0215878967844794, 0.13788987742286, 0.0097421522245054,
-0.185481343626263, 0.039394235524668, -0.0423606094227236,
-0.0300386175931323, -0.0704781156851588, 0.149635559983053,
0.194784934048682, 0.0579351879333201, -0.029201096262343,
0.035471474252518, 0.0130390262499429), GluR4_N = c(-0.0645767955225773,
-0.051538941109314, -0.0313732251039657, -0.0141460065921882,
-0.00417582031288004, -0.029593478043205, -0.0337244128285424,
-0.0473718497413239, -0.0076614057457667, -0.0274641649555311,
0.0567450285050144, 0.131417882380042, 0.0167002653120917,
0.0102756570041332, 0.0589477012145904, 0.0282615479355968
), IL1B_N = c(0.0271273847003715, -0.105491449847318, 0.0437609140660753,
-0.100682647720751, -0.0220718458071589, -0.255060461104892,
0.136556106808522, 0.171611061468201, -0.107978458154497,
-0.138468912721386, 0.0906412612736424, 0.103367168201442,
-0.0471777535915392, -0.0996457367924041, -0.0253085398636734,
0.0972606458616279), P3525_N = c(0.282068129966564, -0.00165311433635766,
-0.0922619335624527, -0.153415327839175, 0.123335275814776,
-0.217141845924011, -0.0794347237762894, -0.0633312926140292,
-0.0550134841848069, -0.0335943662560428, -0.172561096964795,
-0.0591245566896425, -0.0903407471772672, 0.0672553394698634,
0.277963667780744, 0.280422376361652), pCASP9_N = c(-0.0809064432825608,
-0.0137019165208861, 0.177743120582825, -0.0475158803923548,
0.193740256728041, -0.234087587902465, -0.13810712700627,
-0.123144569174683, -0.159086554429722, -0.196839206663645,
0.272409729812092, 0.163528529740624, 0.094264422008515,
0.0323567060275672, 0.132123054461642, -0.0232714678908218
), PSD95_N = c(0.0540563342629853, -0.0442860567878406, 0.192681249153854,
-0.0499306400945902, -0.0256836260381356, -0.130320516544179,
-0.0318622026430037, -0.05550691698767, -0.0550237612521986,
-0.0975383913984803, 0.0610109420236561, -0.016528638117965,
-0.0355453200230897, 0.0361199546017388, -0.0438265148666351,
0.15961796487275), SNCA_N = c(0.10038812821577, -0.203187652543977,
0.132600250445984, 0.0870009029169576, -0.16121896139518,
0.00675222688338345, 0.201408060453561, 0.166171601944603,
-0.244202510820346, -0.184881118438059, 0.0158087569191595,
0.163733417301441, -0.19931602328197, -0.0822025824650802,
0.0270161636801945, -0.0311533368903992), Ubiquitin_N = c(0.113890598772724,
-0.0571595522614428, 0.251655448625955, 0.0290662757157521,
-0.113226757122626, -0.118822873950306, -0.0895156964787369,
-0.115101576386724, -0.0883300072975741, -0.0451690155410069,
0.0356232623609365, 0.10502000854939, -0.242738889727437,
-0.000642607498821009, 0.023342908881478, -0.000996135171924353
), pGSK3B_Tyr216_N = c(0.171426581336935, 0.21964402951554,
-0.146777292906524, -0.180066591627815, 0.0607373096178199,
-0.338285372919054, -0.192946966367207, -0.179745246639312,
-0.0202782074462171, -0.0754752662878523, -0.0458616948609926,
-0.0702022161357589, -0.0329854942199789, 0.103988666502327,
0.160536360262989, 0.130136693548004), SHH_N = c(0.167413839912217,
0.177150215231475, -0.11706030681231, -0.103724722509818,
-0.105962891517635, -0.163445660332417, 0.26057121922903,
0.323113244273389, -0.154575367677723, -0.203841975554592,
-0.196762498711561, -0.0810430316565208, -0.164628664080618,
-0.0670952384804719, 0.0701383687380666, 0.0664763199521191
), BAD_N = c(1.38627815493717e-17, 0.108885085055258, 1.38627815493717e-17,
0.204958164782363, -0.109706654809739, 1.38627815493717e-17,
-0.0384428632142642, 0.113022480455563, -0.0230560609956582,
0.00709971300305052, 0.0944175354012559, 0.258234547510358,
-0.172555989304076, -0.115571199147466, -0.0361880642339753,
0.0555296363853341), BCL2_N = c(0.174830527318015, -0.0351916650236411,
4.47594455930353e-17, 0.16122241936817, -0.153630588784925,
4.47594455930353e-17, 0.0259483341117695, 0.10217304978238,
-0.113426224559798, -0.0493655879422875, 4.47594455930353e-17,
4.47594455930353e-17, -0.176439561319639, 0.00332642384209326,
-0.112281307284837, 4.47594455930353e-17), pS6_N = c(0.0544957045743841,
-0.215498231280905, 0.176330539472927, -0.0180427806336791,
0.0405134698307664, -0.196511194503692, 0.0896380150212792,
-0.00178437398723737, -0.111094705650147, -0.164447287557879,
0.0171495879982054, 0.17357748138507, -0.0854290326165926,
-0.136862309389642, 0.0486149936008245, 0.0468734606012612
), pCFOS_N = c(-3.94541709971541e-17, 0.144688662108845,
-0.0523244997808654, 0.183632906884199, -0.0943286515483249,
-0.154870867441355, 0.0273962871834048, -0.0446413560661544,
-0.151142681858317, -0.142540841364996, -0.0409951996945863,
0.209594994520851, -0.07067492413067, -0.0951447007727713,
0.0510274910486943, -0.10813485862325), SYP_N = c(0.1699192032091,
-0.007408249850341, 0.105706192867166, 0.030169211570003,
0.264311270468507, -0.174104272666862, -0.0320510372603059,
-0.146577591364027, 0.0748281855773365, 0.0921704540339964,
0.125632959616699, 0.101821683371461, -0.0991623357830543,
0.24508774982114, -0.0514314977651764, -0.0356173972612358
), H3AcK18_N = c(0.00318526058246947, 0.030516867974744,
0.0458325444094067, 0.0823406614957822, 0.0655800040015427,
1.34928358031281e-17, -0.066090760307071, -0.0164952261270702,
0.0193438095162109, 0.0214199163861949, 1.34928358031281e-17,
1.34928358031281e-17, -0.18204363595328, 0.0122967495407723,
-0.0057641327038032, 0.315397204575443), EGR1_N = c(0.22091436521792,
-0.0418899558545117, 4.08083728048395e-18, 4.08083728048395e-18,
-0.132192787939268, 4.08083728048395e-18, 0.170088635236541,
0.14416021675064, -0.136632103055064, -0.105975572333308,
0.157046871143272, 0.390639305517813, -0.135156681648399,
-0.14858326296597, -0.0787741349821091, -0.00864723924102435
), H3MeK4_N = c(2.39945987461847e-17, 2.39945987461847e-17,
2.39945987461847e-17, 0.0613111993676987, -0.0735063751409676,
2.39945987461847e-17, -0.0518102234068636, -0.0134739460741966,
-0.0578126454640219, 0.0237615758984536, 2.39945987461847e-17,
2.39945987461847e-17, -0.176488012336739, -0.119630246017519,
-0.139100793400124, 0.159811180815282), CaNA_N = c(0.228323127723045,
0.156499372224674, -0.218869345925655, -0.347696517405393,
0.258547187716627, 0.0491641323435211, -0.275043873926982,
-0.280621847419711, 0.221404071790851, 0.213771806346338,
-0.138770962441139, -0.179432243201944, 0.104799593812621,
0.247597575511052, -0.0575169171888767, 0.0268368286591718
), class = c("c-CS-m", "c-CS-m", "c-SC-m", "c-SC-m", "c-CS-s",
"c-CS-s", "c-SC-s", "c-SC-s", "t-CS-m", "t-CS-m", "t-SC-m",
"t-SC-m", "t-CS-s", "t-CS-s", "t-SC-s", "t-SC-s")), row.names = c(NA,
-16L), class = c("tbl_df", "tbl", "data.frame"))
my code:
# Splitting the data
trainX <- createDataPartition(np_2$class ,p=0.8,list=FALSE)
train <- np_2[trainX,]
test <- np_2[-trainX,]
Model 1:
svm1 <- svm(class~., data = train, type = "C", kernal="radial",
gamma=0.1, cost=10)
Model 2:
x <- subset(np_2, select = -class)
y <- np_2$class
model <- svm(x, y, probability = TRUE)
pred_prob <- predict(model, x, decision.values = TRUE, probability = TRUE)
Error:
Error in svm.default(x, y, probability = TRUE) :
Need numeric dependent variable for regression.
Here you go. Next time try to include the libraries:
Just transform your class to a factor. In that case, the svm will convert it to numeric for you:
np_2 <- transform(np_2, class = factor(class))
trainX <- caret::createDataPartition(np_2$class ,p=0.8,list=FALSE)
train <- np_2[trainX,]
test <- np_2[-trainX,]
e1071::svm(class~.,data =train, type = "C", kernal="radial",gamma=0.1,cost=10)
which outputs:
Call:
svm(formula = class ~ ., data = train, type = "C", kernal = "radial", gamma = 0.1, cost = 10)
Parameters:
SVM-Type: C-classification
SVM-Kernel: radial
cost: 10
Number of Support Vectors: 16

compare multiple signals using FFT in R

I want to analyse multiple signals using Fast fourier transform and try to group the ones with similar patterns.
I'd like to know how to approach this problem.
A subset of my data:
df <- dput(tst1)
structure(list(var_1 = c(0.238942, 0.265, 0.190338, 0.245714,
0.208872, 0.266648, 0.1909, 0.291751, 0.259681, 0.270592), var_2 = c(0.236594,
0.262115, 0.188282, 0.243209, 0.206064, 0.26483, 0.187436, 0.289571,
0.256675, 0.268209), var_3 = c(0.234762, 0.260603, 0.188161,
0.240466, 0.204413, 0.262256, 0.1863, 0.288058, 0.254225, 0.266186
), var_4 = c(0.232489, 0.258214, 0.186727, 0.238468, 0.201748,
0.260584, 0.184533, 0.285398, 0.251934, 0.263722), var_5 = c(0.230015,
0.255756, 0.186592, 0.235875, 0.199746, 0.258097, 0.18314, 0.283392,
0.249769, 0.262319), var_6 = c(0.227892, 0.253624, 0.186194,
0.233518, 0.197826, 0.255778, 0.181736, 0.281578, 0.247566, 0.260859
), var_7 = c(0.225756, 0.251379, 0.185813, 0.231679, 0.195496,
0.253272, 0.180961, 0.27873, 0.244901, 0.259456), var_8 = c(0.223464,
0.249673, 0.185515, 0.229863, 0.193899, 0.251128, 0.180393, 0.276851,
0.243248, 0.257856), var_9 = c(0.221471, 0.24726, 0.184834, 0.227454,
0.191849, 0.248769, 0.179127, 0.273859, 0.240625, 0.255606),
var_10 = c(0.21952, 0.245511, 0.184278, 0.225988, 0.190593,
0.246434, 0.178072, 0.271144, 0.238321, 0.253885), var_11 = c(0.218228,
0.243789, 0.184485, 0.224337, 0.189168, 0.245093, 0.177002,
0.268688, 0.23696, 0.251804), var_12 = c(0.216438, 0.241876,
0.184569, 0.222695, 0.187973, 0.243475, 0.175195, 0.266073,
0.235168, 0.250305), var_13 = c(0.215116, 0.240005, 0.184283,
0.220832, 0.186319, 0.24159, 0.173557, 0.263756, 0.232819,
0.248114), var_14 = c(0.213016, 0.237224, 0.18444, 0.21831,
0.18518, 0.240112, 0.17209, 0.261131, 0.230609, 0.245875),
var_15 = c(0.211184, 0.23517, 0.18475, 0.216627, 0.183275,
0.238314, 0.171204, 0.258135, 0.228459, 0.243731), var_16 = c(0.208855,
0.232755, 0.184906, 0.215249, 0.181248, 0.236821, 0.169593,
0.256136, 0.226637, 0.241915), var_17 = c(0.207139, 0.230857,
0.185459, 0.21385, 0.180094, 0.235208, 0.168155, 0.254205,
0.22486, 0.240045), var_18 = c(0.205077, 0.228666, 0.185522,
0.211764, 0.178778, 0.233662, 0.166491, 0.251451, 0.222678,
0.237376), var_19 = c(0.203173, 0.226569, 0.185825, 0.209949,
0.176726, 0.231828, 0.165068, 0.248426, 0.220556, 0.235003
), var_20 = c(0.201251, 0.224366, 0.186176, 0.207974, 0.175703,
0.230081, 0.163141, 0.246262, 0.218654, 0.232062), var_21 = c(0.199265,
0.221885, 0.186458, 0.205793, 0.174502, 0.228247, 0.161569,
0.24376, 0.216408, 0.229642), var_22 = c(0.197004, 0.219585,
0.186486, 0.203886, 0.173065, 0.226032, 0.160078, 0.241633,
0.214141, 0.227404), var_23 = c(0.19512, 0.216987, 0.186782,
0.201754, 0.171262, 0.223991, 0.158268, 0.239415, 0.212232,
0.225068), var_24 = c(0.193056, 0.21441, 0.186593, 0.199443,
0.169317, 0.221896, 0.156727, 0.237254, 0.209865, 0.222927
), var_25 = c(0.190861, 0.211877, 0.186553, 0.19689, 0.168172,
0.219797, 0.155611, 0.235068, 0.207387, 0.220559)), row.names = c(22743L,
6535L, 59032L, 61113L, 16944L, 60773L, 3235L, 19567L, 20560L,
42516L), class = "data.frame")
Each row in the data is 1 signal and I'd like to group the signals with same patterns.
FFT on this data:
f <- apply(df, 1, function(x){abs(fft(x))})
How do I go about from here to finding similar patterns? Does removing the peaks and reconstructing the inverse FFT help here?

Linear Regression Analysis of population data with R

I have a homework assignment where I need to take a CSV file based around population data around the United States and do some data analysis on the data inside. I need to find the data that exists for my state and for starters run a Linear Regression Analysis to predict the size of the population.
I've been studying R for a few weeks now, went through a LinkedIn Learning training, as well as 2 different trainings on pluralsight about R. I have also tried searching for how to do a Linear Regression Analysis in R and I find plenty of examples for how to do it when the data is perfectly laid out in a table in just the right way to Analyze.
The CSV file is laid out so that each state is defined on a single line/row so I used the filter function to grab just the data for my State and put it into a variable.
Within that dataset the population data is defined across several columns with the most important data being the Population Estimates for each year from 2010 to 2018.
library(tidyverse)
population.data <- read_csv("nst-est2018-alldata.csv")
mn.state.data <- filter(population.data, NAME == "Minnesota")
I'm looking for some help to get headed in the right direction my thought is that I will need to create to containers of data 1 having each year from 2010 to 2018 and one that contains the population data for each of those years. And then use the xyplot function with those two containers? If you have some experience in this area please help me think this through I'm not looking for anybody to do the assignment for me just want some help trying to think it through.
Edit: Here is the results of the
dput(head(population.data))
command:
structure(list(SUMLEV = c("010", "020", "020", "020", "020",
"040"), REGION = c("0", "1", "2", "3", "4", "3"), DIVISION = c("0",
"0", "0", "0", "0", "6"), STATE = c("00", "00", "00", "00", "00",
"01"), NAME = c("United States", "Northeast Region", "Midwest Region",
"South Region", "West Region", "Alabama"), CENSUS2010POP = c(308745538L,
55317240L, 66927001L, 114555744L, 71945553L, 4779736L), ESTIMATESBASE2010
= c(308758105L,
55318430L, 66929743L, 114563045L, 71946887L, 4780138L), POPESTIMATE2010 =
c(309326085L,
55380645L, 66974749L, 114867066L, 72103625L, 4785448L), POPESTIMATE2011 =
c(311580009L,
55600532L, 67152631L, 116039399L, 72787447L, 4798834L), POPESTIMATE2012 =
c(313874218L,
55776729L, 67336937L, 117271075L, 73489477L, 4815564L), POPESTIMATE2013 =
c(316057727L,
55907823L, 67564135L, 118393244L, 74192525L, 4830460L), POPESTIMATE2014 =
c(318386421L,
56015864L, 67752238L, 119657737L, 74960582L, 4842481L), POPESTIMATE2015 =
c(320742673L,
56047587L, 67869139L, 121037542L, 75788405L, 4853160L), POPESTIMATE2016 =
c(323071342L,
56058789L, 67996917L, 122401186L, 76614450L, 4864745L), POPESTIMATE2017 =
c(325147121L,
56072676L, 68156035L, 123598424L, 77319986L, 4875120L), POPESTIMATE2018 =
c(327167434L,
56111079L, 68308744L, 124753948L, 77993663L, 4887871L), NPOPCHG_2010 =
c(567980L,
62215L, 45006L, 304021L, 156738L, 5310L), NPOPCHG_2011 = c(2253924L,
219887L, 177882L, 1172333L, 683822L, 13386L), NPOPCHG_2012 = c(2294209L,
176197L, 184306L, 1231676L, 702030L, 16730L), NPOPCHG_2013 = c(2183509L,
131094L, 227198L, 1122169L, 703048L, 14896L), NPOPCHG_2014 = c(2328694L,
108041L, 188103L, 1264493L, 768057L, 12021L), NPOPCHG_2015 = c(2356252L,
31723L, 116901L, 1379805L, 827823L, 10679L), NPOPCHG_2016 = c(2328669L,
11202L, 127778L, 1363644L, 826045L, 11585L), NPOPCHG_2017 = c(2075779L,
13887L, 159118L, 1197238L, 705536L, 10375L), NPOPCHG_2018 = c(2020313L,
38403L, 152709L, 1155524L, 673677L, 12751L), BIRTHS2010 = c(987836L,
163454L, 212614L, 368752L, 243016L, 14227L), BIRTHS2011 = c(3973485L,
646265L, 834909L, 1509597L, 982714L, 59689L), BIRTHS2012 = c(3936976L,
637904L, 830701L, 1504936L, 963435L, 59070L), BIRTHS2013 = c(3940576L,
635741L, 830869L, 1504799L, 969167L, 57936L), BIRTHS2014 = c(3963195L,
632433L, 836505L, 1525280L, 968977L, 58907L), BIRTHS2015 = c(3992376L,
634515L, 837968L, 1545722L, 974171L, 59637L), BIRTHS2016 = c(3962654L,
628039L, 831667L, 1541342L, 961606L, 59388L), BIRTHS2017 = c(3901982L,
616552L, 816177L, 1519944L, 949309L, 58259L), BIRTHS2018 = c(3855500L,
609336L, 804431L, 1499838L, 941895L, 57216L), DEATHS2010 = c(598691L,
110848L, 140785L, 228706L, 118352L, 11073L), DEATHS2011 = c(2512442L,
470816L, 586840L, 962751L, 492035L, 48818L), DEATHS2012 = c(2501531L,
460985L, 584817L, 960575L, 495154L, 48364L), DEATHS2013 = c(2608019L,
480032L, 605188L, 1011093L, 511706L, 50847L), DEATHS2014 = c(2582448L,
470196L, 597078L, 1006057L, 509117L, 49692L), DEATHS2015 = c(2699826L,
488881L, 626494L, 1052360L, 532091L, 51820L), DEATHS2016 = c(2703215L,
480331L, 619471L, 1058173L, 545240L, 51662L), DEATHS2017 = c(2779436L,
501022L, 620556L, 1092949L, 564909L, 53033L), DEATHS2018 = c(2814013L,
506909L, 621030L, 1109152L, 576922L, 53425L), NATURALINC2010 = c(389145L,
52606L, 71829L, 140046L, 124664L, 3154L), NATURALINC2011 = c(1461043L,
175449L, 248069L, 546846L, 490679L, 10871L), NATURALINC2012 = c(1435445L,
176919L, 245884L, 544361L, 468281L, 10706L), NATURALINC2013 = c(1332557L,
155709L, 225681L, 493706L, 457461L, 7089L), NATURALINC2014 = c(1380747L,
162237L, 239427L, 519223L, 459860L, 9215L), NATURALINC2015 = c(1292550L,
145634L, 211474L, 493362L, 442080L, 7817L), NATURALINC2016 = c(1259439L,
147708L, 212196L, 483169L, 416366L, 7726L), NATURALINC2017 = c(1122546L,
115530L, 195621L, 426995L, 384400L, 5226L), NATURALINC2018 = c(1041487L,
102427L, 183401L, 390686L, 364973L, 3791L), INTERNATIONALMIG2010 =
c(178835L,
45723L, 25158L, 68742L, 39212L, 928L), INTERNATIONALMIG2011 = c(792881L,
206686L, 116948L, 285343L, 183904L, 4716L), INTERNATIONALMIG2012 =
c(858764L,
207584L, 120995L, 344198L, 185987L, 5874L), INTERNATIONALMIG2013 =
c(850952L,
194103L, 126681L, 329897L, 200271L, 5111L), INTERNATIONALMIG2014 =
c(947947L,
222685L, 134310L, 365281L, 225671L, 3753L), INTERNATIONALMIG2015 =
c(1063702L,
227275L, 142759L, 429088L, 264580L, 4685L), INTERNATIONALMIG2016 =
c(1069230L,
236718L, 144859L, 436795L, 250858L, 5950L), INTERNATIONALMIG2017 =
c(953233L,
215872L, 126013L, 404582L, 206766L, 3190L), INTERNATIONALMIG2018 =
c(978826L,
229700L, 127583L, 418418L, 203125L, 3344L), DOMESTICMIG2010 = c(0L,
-32918L, -50873L, 90679L, -6888L, 1238L), DOMESTICMIG2011 = c(0L,
-159789L, -186896L, 335757L, 10928L, -2239L), DOMESTICMIG2012 = c(0L,
-205314L, -181285L, 336615L, 49984L, 59L), DOMESTICMIG2013 = c(0L,
-216273L, -123814L, 293443L, 46644L, 2641L), DOMESTICMIG2014 = c(0L,
-274391L, -182730L, 373439L, 83682L, -755L), DOMESTICMIG2015 = c(0L,
-339996L, -234823L, 452879L, 121940L, -1553L), DOMESTICMIG2016 = c(0L,
-372953L, -228200L, 442633L, 158520L, -1977L), DOMESTICMIG2017 = c(0L,
-316879L, -161387L, 364465L, 113801L, 2065L), DOMESTICMIG2018 = c(0L,
-292928L, -157048L, 345132L, 104844L, 5718L), NETMIG2010 = c(178835L,
12805L, -25715L, 159421L, 32324L, 2166L), NETMIG2011 = c(792881L,
46897L, -69948L, 621100L, 194832L, 2477L), NETMIG2012 = c(858764L,
2270L, -60290L, 680813L, 235971L, 5933L), NETMIG2013 = c(850952L,
-22170L, 2867L, 623340L, 246915L, 7752L), NETMIG2014 = c(947947L,
-51706L, -48420L, 738720L, 309353L, 2998L), NETMIG2015 = c(1063702L,
-112721L, -92064L, 881967L, 386520L, 3132L), NETMIG2016 = c(1069230L,
-136235L, -83341L, 879428L, 409378L, 3973L), NETMIG2017 = c(953233L,
-101007L, -35374L, 769047L, 320567L, 5255L), NETMIG2018 = c(978826L,
-63228L, -29465L, 763550L, 307969L, 9062L), RESIDUAL2010 = c(0L,
-3196L, -1108L, 4554L, -250L, -10L), RESIDUAL2011 = c(0L, -2459L,
-239L, 4387L, -1689L, 38L), RESIDUAL2012 = c(0L, -2992L, -1288L,
6502L, -2222L, 91L), RESIDUAL2013 = c(0L, -2445L, -1350L, 5123L,
-1328L, 55L), RESIDUAL2014 = c(0L, -2490L, -2904L, 6550L, -1156L,
-192L), RESIDUAL2015 = c(0L, -1190L, -2509L, 4476L, -777L, -270L
), RESIDUAL2016 = c(0L, -271L, -1077L, 1047L, 301L, -114L), RESIDUAL2017 =
c(0L,
-636L, -1129L, 1196L, 569L, -106L), RESIDUAL2018 = c(0L, -796L,
-1227L, 1288L, 735L, -102L), RBIRTH2011 = c(12.79898857, 11.646389369,
12.449493906, 13.0753983, 13.564866164, 12.455601786), RBIRTH2012 =
c(12.589173852,
11.454833676, 12.353389372, 12.900715293, 13.172754439, 12.287820829
), RBIRTH2013 = c(12.511116578, 11.384582534, 12.318197145, 12.770698648,
13.1250523, 12.012410502), RBIRTH2014 = c(12.493440163, 11.301146646,
12.363692308, 12.814734, 12.993051496, 12.179749675), RBIRTH2015 =
c(12.493175596,
11.324209532, 12.357461907, 12.843808208, 12.92441189, 12.301816868
), RBIRTH2016 = c(12.309933949, 11.20434042, 12.242454436, 12.663079639,
12.619264908, 12.222387438), RBIRTH2017 = c(12.039095529, 10.996948983,
11.989119413, 12.357287884, 12.333939366, 11.962999487), RBIRTH2018 =
c(11.820984126,
10.863177115, 11.789576855, 12.078306222, 12.128940451, 11.720998206
), RDEATH2011 = c(8.0928244199, 8.4846099623, 8.7504877826, 8.3388830191,
6.7917918366, 10.187095914), RDEATH2012 = c(7.9990857588, 8.2779015368,
8.6968381072, 8.2343067033, 6.7700904074, 10.060744313), RDEATH2013 =
c(8.2803198685,
8.5962112289, 8.9723230665, 8.5807898649, 6.9298356343, 10.542582104
), RDEATH2014 = c(8.1408206164, 8.4020820365, 8.8249187702, 8.4524499397,
6.8267702932, 10.274434632), RDEATH2015 = c(8.4484528254, 8.7250748685,
9.2388679994, 8.7443343664, 7.0592978512, 10.689339673), RDEATH2016 =
c(8.3975028099,
8.5692003816, 9.1188486402, 8.6935469035, 7.1552465339, 10.632332792
), RDEATH2017 = c(8.5756150392, 8.9363320099, 9.1155717285, 8.8857783149,
7.3396052849, 10.889883997), RDEATH2018 = c(8.6277792774, 9.0371195009,
9.1016891619, 8.9320830002, 7.4291216994, 10.944391939), RNATURALINC2011 =
c(4.7061641498,
3.161779407, 3.6990061239, 4.7365152812, 6.7730743272, 2.2685058724
), RNATURALINC2012 = c(4.5900880929, 3.1769321388, 3.656551265,
4.66640859, 6.402664032, 2.2270765159), RNATURALINC2013 = c(4.2307967093,
2.7883713049, 3.3458740787, 4.1899087829, 6.1952166656, 1.4698283977
), RNATURALINC2014 = c(4.3526195469, 2.89906461, 3.5387735378,
4.3622840605, 6.1662812026, 1.9053150433), RNATURALINC2015 =
c(4.0447227708,
2.5991346635, 3.1185939072, 4.0994738414, 5.8651140389, 1.6124771946
), RNATURALINC2016 = c(3.912431139, 2.6351400388, 3.123605796,
3.969532736, 5.4640183742, 1.5900546466), RNATURALINC2017 =
c(3.4634804902,
2.0606169731, 2.8735476848, 3.4715095687, 4.9943340813, 1.0731154898
), RNATURALINC2018 = c(3.1932048488, 1.8260576141, 2.687887693,
3.1462232219, 4.6998187519, 0.7766062675), RINTERNATIONALMIG2011 =
c(2.5539481982,
3.7247036946, 1.7438348531, 2.4715029092, 2.5385138982, 0.9841112772
), RINTERNATIONALMIG2012 = c(2.7460490726, 3.7275831375, 1.7993217139,
2.9505576333, 2.5429438207, 1.2219173785), RINTERNATIONALMIG2013 =
c(2.7017267715,
3.4759149144, 1.8781318506, 2.7997195452, 2.7121923767, 1.0597112344
), RINTERNATIONALMIG2014 = c(2.988275652, 3.9792291689, 1.9851256285,
3.0689308523, 3.0260314993, 0.7759790947), RINTERNATIONALMIG2015 =
c(3.3285982753,
4.0561842059, 2.1052580818, 3.5654043717, 3.5102060089, 0.9664136698
), RINTERNATIONALMIG2016 = c(3.3215493142, 4.2230961065, 2.1323795548,
3.5885415898, 3.2920380658, 1.2245437674), RINTERNATIONALMIG2017 =
c(2.9410856198,
3.8503376372, 1.8510505744, 3.2892897676, 2.6864164429, 0.6550398799
), RINTERNATIONALMIG2018 = c(3.0010858795, 4.0950670621, 1.8698304564,
3.3695510667, 2.6156748143, 0.685035969), RDOMESTICMIG2011 = c(0,
-2.879569389, -2.786843372, 2.9081645678, 0.1508443529, -0.467223314
), RDOMESTICMIG2012 = c(0, -3.686820778, -2.69589683, 2.8855541222,
0.6834160664, 0.0122732593), RDOMESTICMIG2013 = c(0, -3.872925953,
-1.835626629, 2.4903472978, 0.6316815776, 0.5475831286), RDOMESTICMIG2014
= c(0,
-4.903180146, -2.700781819, 3.1374707924, 1.1220952977, -0.156105573
), RDOMESTICMIG2015 = c(0, -6.067919504, -3.462920156, 3.7630900106,
1.6177886489, -0.320350145), RDOMESTICMIG2016 = c(0, -6.653555548,
-3.359190761, 3.6365043774, 2.0802759896, -0.40687782), RDOMESTICMIG2017 =
c(0,
-5.651919379, -2.370672066, 2.963134779, 1.4785645494, 0.4240305179
), RDOMESTICMIG2018 = c(0, -5.222289092, -2.301663494, 2.7793734944,
1.350093835, 1.1713623417), RNETMIG2011 = c(2.5539481982, 0.845134306,
-1.043008519, 5.379667477, 2.6893582511, 0.516887963), RNETMIG2012 =
c(2.7460490726,
0.0407623599, -0.896575116, 5.8361117555, 3.2263598871, 1.2341906378
), RNETMIG2013 = c(2.7017267715, -0.397011039, 0.0425052219,
5.2900668429, 3.3438739543, 1.6072943629), RNETMIG2014 = c(2.988275652,
-0.923950977, -0.71565619, 6.2064016447, 4.148126797, 0.6198735214
), RNETMIG2015 = c(3.3285982753, -2.011735298, -1.357662074,
7.3284943823, 5.1279946578, 0.6460635248), RNETMIG2016 = c(3.3215493142,
-2.430459441, -1.226811206, 7.2250459672, 5.3723140554, 0.8176659475
), RNETMIG2017 = c(2.9410856198, -1.801581742, -0.519621492,
6.2524245465, 4.1649809923, 1.0790703978), RNETMIG2018 = c(3.0010858795,
-1.12722203, -0.431833037, 6.1489245611, 3.9657686492, 1.8563983107
)), .Names = c("SUMLEV", "REGION", "DIVISION", "STATE", "NAME",
"CENSUS2010POP", "ESTIMATESBASE2010", "POPESTIMATE2010",
"POPESTIMATE2011",
"POPESTIMATE2012", "POPESTIMATE2013", "POPESTIMATE2014",
"POPESTIMATE2015",
"POPESTIMATE2016", "POPESTIMATE2017", "POPESTIMATE2018", "NPOPCHG_2010",
"NPOPCHG_2011", "NPOPCHG_2012", "NPOPCHG_2013", "NPOPCHG_2014",
"NPOPCHG_2015", "NPOPCHG_2016", "NPOPCHG_2017", "NPOPCHG_2018",
"BIRTHS2010", "BIRTHS2011", "BIRTHS2012", "BIRTHS2013", "BIRTHS2014",
"BIRTHS2015", "BIRTHS2016", "BIRTHS2017", "BIRTHS2018", "DEATHS2010",
"DEATHS2011", "DEATHS2012", "DEATHS2013", "DEATHS2014", "DEATHS2015",
"DEATHS2016", "DEATHS2017", "DEATHS2018", "NATURALINC2010",
"NATURALINC2011",
"NATURALINC2012", "NATURALINC2013", "NATURALINC2014", "NATURALINC2015",
"NATURALINC2016", "NATURALINC2017", "NATURALINC2018",
"INTERNATIONALMIG2010",
"INTERNATIONALMIG2011", "INTERNATIONALMIG2012", "INTERNATIONALMIG2013",
"INTERNATIONALMIG2014", "INTERNATIONALMIG2015", "INTERNATIONALMIG2016",
"INTERNATIONALMIG2017", "INTERNATIONALMIG2018", "DOMESTICMIG2010",
"DOMESTICMIG2011", "DOMESTICMIG2012", "DOMESTICMIG2013",
"DOMESTICMIG2014",
"DOMESTICMIG2015", "DOMESTICMIG2016", "DOMESTICMIG2017",
"DOMESTICMIG2018",
"NETMIG2010", "NETMIG2011", "NETMIG2012", "NETMIG2013", "NETMIG2014",
"NETMIG2015", "NETMIG2016", "NETMIG2017", "NETMIG2018", "RESIDUAL2010",
"RESIDUAL2011", "RESIDUAL2012", "RESIDUAL2013", "RESIDUAL2014",
"RESIDUAL2015", "RESIDUAL2016", "RESIDUAL2017", "RESIDUAL2018",
"RBIRTH2011", "RBIRTH2012", "RBIRTH2013", "RBIRTH2014", "RBIRTH2015",
"RBIRTH2016", "RBIRTH2017", "RBIRTH2018", "RDEATH2011", "RDEATH2012",
"RDEATH2013", "RDEATH2014", "RDEATH2015", "RDEATH2016", "RDEATH2017",
"RDEATH2018", "RNATURALINC2011", "RNATURALINC2012", "RNATURALINC2013",
"RNATURALINC2014", "RNATURALINC2015", "RNATURALINC2016",
"RNATURALINC2017",
"RNATURALINC2018", "RINTERNATIONALMIG2011", "RINTERNATIONALMIG2012",
"RINTERNATIONALMIG2013", "RINTERNATIONALMIG2014", "RINTERNATIONALMIG2015",
"RINTERNATIONALMIG2016", "RINTERNATIONALMIG2017", "RINTERNATIONALMIG2018",
"RDOMESTICMIG2011", "RDOMESTICMIG2012", "RDOMESTICMIG2013",
"RDOMESTICMIG2014",
"RDOMESTICMIG2015", "RDOMESTICMIG2016", "RDOMESTICMIG2017",
"RDOMESTICMIG2018",
"RNETMIG2011", "RNETMIG2012", "RNETMIG2013", "RNETMIG2014", "RNETMIG2015",
"RNETMIG2016", "RNETMIG2017", "RNETMIG2018"), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
In order to help you out, an example data using dput(head(population.data)) would be helpful. Based on your comments, your data is in what is called 'wide' format, meaning each observation is contained in a column, rather than a row (pupulation 2010, population 2011 etc.).
As i hinted in my comment, a sub-goal within statistical modelling is always to clean and reshape data to a proper format, that will work for running models. In this case the problem is that your format is in an incorrect shape. The most common is likely melting to long format via the reshape2 or data.table package as explained in this link. I personally prefer the data.table package, as it seems to have better large scale performance. Their usage however is identical.
Lets say you have a column 'NAME' for states and 9 columns for population estimates (2010 population estimates, 2011 population estimates and so on), we could then convert these columns into a long format, using melt from either of the two suggested packages (They are identical in use)
require(data.table)
value_columns <- paste(2010:2018, "Population Estimates")
population.data_long <- melt(population.data, id.vars = "NAME",
measure.vars = value_columns, #Columns containing values we (that are grouped by their column names)
variable.name = 'Year (Population Estimate)', #Name of the column which tells us [(Year) Population Estimate]
value.name = 'Population Estimate') #Name of the column with values
population.data_long$year <- as.integer(substr(population.data_long$`Year (Population Estimate)`, 1, 4)) #Create a year column in a bit of a hacky way
Note i have ignored any additional columns, and these should be included in your melt statement. From here on a linear regression should follow any standard example that you have found.

Resources