rlatticelevelplotcolorbrewer

An Error with levelplot RColorBrewer in R


I was trying to assign the "RdBu" coloring scheme to my levelplot, but I end up with the following error "Error: $ operator is invalid for atomic vectors" and am unable to determine what is causing it, as I am not even using a "$" in my function. Here is the command that I am using:

library(raster)
library(ncdf4)
library(maps)
library(maptools)
library(rasterVis)
library(ggplot2)
library(rgdal)
library(sp)
library(gridExtra)
library(grid)
library(RColorBrewer)

Plot8 <- levelplot(FDifference3, margin=F, at=c(seq(-50,150,10)), pretty=TRUE, 
par.settings=mapTheme, main="RCP 8.5", col=brewer.pal(n=10, name="RdBu"))

This leads to the error:

Error: $ operator is invalid for atomic vectors

Information concerning object "FDifference3" is shown below:

dput(FDifference3)


30.7598926100673, 21.0052776536913, 11.8866786982449, 15.3147044765961, 
12.6932819573239, 11.2721863067529, 10.2391980021838, 3.11715085056394, 
....
27.0691569868524, 25.1415816676223, 20.880095847263, 19.6974850946355, 
23.5259755607161, 27.7440843812122, 30.9747278163841, 29.0394481463338, 
26.9675393551183, 26.7646798621569, 25.6285840387309, 20.7192390016986, 
16.7966847027177, 17.7069170705893, 15.8895793812399, 15.2505243698323, 
14.1422859784594, 14.4755309330575, 14.3165433025574, 15.0875676078574, 
16.3470227237742, 16.554208349719, 13.3836108177406, 11.7051893761094, 
11.1451124744315, 11.273298760632, 9.85191749246744, 10.0866210045901, 
9.94936528099581, 11.9985798646938, 12.2608653844442, 14.2074403591832, 
15.3655123918465, 15.211768251312, 15.5189462014053, 14.8994504663946, 
14.7790035890605, 15.5271586624014, 16.5094311513978, 16.1415359640925, 
15.5956383068953, 16.5708660529359, 16.4506403404025, 16.403125595179, 
15.9572117378612, 17.3282908924681, 19.1332227110444, 19.8322765147813, 
19.62853572806, 18.9621533124947, 17.817528638863, 16.8144252957628, 
18.4406672155217, 20.8179929200158, 19.1136109778779, 16.532115102708, 
16.6306032873186, 17.9226485534435, 18.1136707406211, 18.0911035978719, 
17.2196626298856, 16.7558650622828, 16.6949881161678, 17.3503694802559, 
18.7955034040407, 19.4785867219218, 18.6851636306272, 18.6792054542026, 
21.4158980346929, 20.8702206463764, 20.2199899938662, 21.4661226043214, 
22.5351270506026, 21.0621123338387, 20.8524304065303, 20.2717716055352, 
20.4536002844644, 21.0648788367172, 21.3018326371524, 21.6333136726087, 
21.2060126490798, 21.9554017810587, 20.9871607833066, 18.4723555638202, 
17.0859053380392, 18.718442148524, 20.1020717613767, 20.98982096967, 
21.4590203710257, 22.1809485327572, 23.0662665128525, 23.5210619060359, 
23.5595893799475, 23.6680657003389, 24.4601583487742, 24.1493753260977, 
23.7082923912408, 21.9887962483903, 21.9761848044672, 22.3373853564425, 
21.3956801944065, 20.8852015839527, 20.863366028317, 22.4508678259056, 
23.22737426986, 23.7402578229229, 23.8335255489319, 23.1666058903137, 
6.32362645767485, 5.95645409152776, 4.14876921070133, 6.46478128119528, 
8.34627439756622, 7.12431690311901, 7.89893291937943, 10.0569594125092, 
9.35550633170214, 12.5339269137843, 14.0564221985725, 12.8206448284598, 
14.6253069449458, 10.8771913143907, 10.4567383903223, 12.349328153726, 
11.7515419205523, 10.0253337543859, 9.9821687761521, 8.19947437170902, 
9.33919698542525, 9.77667722811848, 12.0597581339938, 15.0006404000564, 
16.7751879299106, 17.7519004207721, 19.7631323001029, 21.736382751455, 
24.2694912581666, 22.3067817636855, 21.73888213522, 21.5017901878358, 
17.6398075816247, 16.310183436214, 15.6154380643947, 13.2667851391046, 
12.2083178845006, 12.8937885912829, 11.6344452129935, 11.0095614904777, 
12.2515746072861, 13.7207641019486, 11.5511067420945, 12.2243402605771, 
12.7313651172852, 12.8895218898292, 10.0941400229079, 9.35268369015973, 
9.31052974729709, 10.9377106951225, 10.1421423633809, 11.8874290635662, 
14.5702715354549, 17.1646420748623, 19.0943409620422, 19.2586146075085, 
17.673482528549, 16.9787905887255, 18.8877011298388, 19.4972088853251, 
20.8617885436554, 20.5290423209625, 18.245839680209, 17.6653921377295, 
29.6114817569658, 30.6231778083446, 31.9822110837964, 33.311591882779, 
35.2498477344764, 35.8683379183303, 34.6836834602678, 33.210247777414, 
33.5086249524837, 34.8374850363373, 32.9752439131176, 31.0149312885193, 
31.3396302480749, 33.0172395360753, 33.8536857616209, 33.6674890736095, 
33.8540063819049, 33.7682068972397, 32.8486337823862, 32.5466639970099, 
32.7333085469436, 34.1959926792621, 34.3958830480944, 33.5377417933838, 
33.3696802489062, 33.5944276115547, 34.6484928852355, 35.1343066750461, 
34.1149243264359, 34.2713083724156, 35.4909784710129, 36.03490206647, 
35.8571382246223, 32.8576298651687, 31.8560724676896, 33.4413618499818, 
33.6530437000684, 33.4994308506157, 33.665906722296, 30.7532570490993, 
29.8120756199854, 33.8190844829503, 33.6586953979928, 33.2017145305023, 
35.6238046597362, 37.013685572146, 37.8613316434327, 38.2875116914766, 
38.549208477516, 39.4650380947901, 38.9290189082866, 38.2132530131912, 
37.5497555295335, 36.5140629963788, 37.5808060394466, 38.3877177704534, 
38.5082144236854, 38.2287378734583, 38.0140647764945, 37.3658556581415, 
36.3741736500831, 36.3702553492573, 35.7007823398793, 35.4972205390942, 
4.49813705320115, 4.09727578841662, 1.47751860812325, 1.76965336408288, 
2.66793556142787, 4.34272043348432, 7.63523586331795, 7.58104398845544, 
8.49681471103692, 8.30317567655819, 9.22363750753568, 9.20006628737734, 
7.67162734146225, 6.34880245804464, 7.93539079286658, 7.12445738725429, 
4.43163573236464, 2.18088132351963, 3.55560959130315, 5.13154843120573, 
4.17907971750735, 6.59678700201449, 10.7005924673815, 13.1021861019541, 
13.6455803735171, 12.5364743246461, 11.6738152914407, 11.7980485651294, 
11.2914856179284, 10.2148483038496, 8.22872245636678, 7.70747507894693, 
5.87215756854318, 4.63443222254526, 4.18913293154375, 5.17958177395618, 
6.3712480411187, 6.5608516515522, 4.18293763894554, 3.53660115650086, 
4.48804697310659, 3.6376010078284, 3.70407335851876, 5.24311261011117, 
6.15708844589972, 4.91201635206409, 4.92155945855797, 6.24250699746844, 
9.77893878471625, 12.2176753629791, 11.7832041404766, 14.6495326979664, 
19.3430028360441, 24.6652099296142, 28.531297171138, 27.736351606742, 
26.5049906120042, 29.8844401673426, 32.7321087373142, 36.3955311564514, 
37.4704092002452, 37.3998290298001, 34.3631141259164, 29.8373441248769, 
30.8105641274353, 30.3938111821089, 30.8887866680831, 31.9682374632855, 
31.2358864600197, 32.4138171892824, 32.6331937162077, 32.2925669374792, 
32.1456558792039, 31.7347891266805, 31.4797336638866, 30.7843907924101, 
30.4440020345003, 29.2872349007924, 29.7190551638616, 29.0200742802494, 
27.8751165499268, 29.7717033936248, 30.6686168349514, 29.4435345040357, 
28.6279265833258, 29.8396660854189, 31.0303973094137, 30.7559563304527, 
30.1987132297069, 30.8204833178213, 31.2644366896088, 31.7798667188928, 
31.3972339911988, 32.128629562247, 33.7414817333252, 34.8826473530896, 
34.7344871406641, 34.8436379030384, 34.5070270532988, 33.4513221446435, 
33.4052079702607, 30.8045720466833, 25.0903794348502, 25.321954969548, 
29.1784269536585, 32.1632661838125, 29.6778186476349, 27.1298004491675, 
26.5341722836716, 33.5285693150918, 37.2494653182297, 36.7841311969982, 
36.2309437094285, 36.1635399132043, 35.2590764461185, 36.8687905056835, 
37.0739046997834, 35.4577713515424, 34.8241619703412, 34.9187122875988, 
34.6582434609878, 34.332882428278, 35.176187285879, 34.1771317665265, 
32.1841477697097, 30.8948137118261, 29.9441821865154, 30.0650053569202, 
4.24590761503862, 6.58706955549353, 5.14001981750085, 4.02327082625487, 
2.02387942203817, 3.93430062684401, 5.49085586199056, 5.97252073684378, 
6.38617865138845, 7.57687801664802, 7.64592045790803, 5.7048642094141, 
7.93303430783389, 8.21375408307856, 6.67850157798494, 6.90072329130471, 
8.44348769053734, 8.50865469533959, 7.99061923277607, 6.93076304145874, 
10.1730504660844, 13.247162046971, 12.6676837456755, 10.2882571832153, 
6.85620337109416, 5.73546716674336, 6.27834489447945, 5.92048718504714, 
7.78092131359624, 7.25026587851585, 6.35510129574075, 5.04652537496283, 
4.24495328660813, 4.14450928117606, 6.31242380396113, 7.73129900427797, 
8.12977304326719, 6.66761450694945, 5.41802973167563, 5.622563975306, 
2.69363966598835, 4.37106796149554, 5.63484364638934, 6.71836116261902, 
7.73747239837048, 11.7764404858944, 14.6246124144063, 17.427069392365, 
20.4638717548533, 21.580282148308, 24.9607725131118, 27.3542012031281, 
26.1651443722689, 22.6304751526561, 24.0078726914112, 24.7618682680652, 
23.2639250985013, 19.1578518986074, 22.0305476373376, 26.0580821885365, 
26.0714114495019, 25.3586141134036, 27.9879702124512, 30.9490576764272, 
16.8862438164275, 18.2359971830993, 18.4252578940205, 18.2359078194051, 
18.9386122147076, 19.5748807936766, 20.1974109561314, 20.0856598538266, 
19.8334466018065, 20.7299572056071, 20.7972933327709, 20.4944394453419, 
20.3218193931407, 20.9646242581597, 20.7805697366428, 19.3807385318063, 
18.1119979835249, 16.4445842975135, 17.418589610921, 18.8246681953561, 
19.3360887254557, 21.2516758004749, 21.6135365262713, 20.8874030641787, 
20.3488812144378, 18.4547296587838, 16.4472240500551, 15.4135457886651, 
16.133553891506, 17.6156051271499, 17.5870796700682, 16.5995359702178, 
16.6492604564103, 15.1787382315817, 14.0325153914404, 14.3201830161326, 
14.0214131288971, 11.4746525252694, 11.5925933478808, 20.0870503305336, 
32.5888497331192, 26.7806345992374, 28.2736061187, 27.6544675599628, 
13.9962358057791, 16.804459293176, 20.6034494108771, 22.2573372583962, 
23.5617580925286, 24.119096984721, 23.4694228099674, 23.5622616948941, 
23.8048547835316, 22.9539852741684, 22.2916682301799, 21.5373784576304, 
20.1007731899337, 19.7501481293477, 19.5758270270867, 19.1926461742548, 
18.6398901285469, 20.1678096944505, 19.8587540984488, 18.7649577344573, 
3.13713193912276, 3.72197571683822, 6.08677004123036, 8.80455285224964, 
9.41566027456421, 10.484986397602, 11.4637453371227, 12.8085880936829, 
10.6066732583046, 8.52368847007728, 6.60257322881109, 5.7453624445249, 
8.0597240995645, 12.4076367056019, 11.250024281376, 7.30512791111485, 
5.54107068258806, 6.06970048525654, 7.44834049756326, 8.92540447601665, 
10.8464890674639, 12.6816321795726, 10.0868855027687, 8.79600192585917, 
12.895479787365, 10.1093200823515, 9.52526283669831, 11.6883725453949, 
13.6163292977876, 11.9501713375248, 10.3715639509064, 11.7597626323319, 
11.7048064309065, 11.1267970828634, 13.8480230428095, 15.94397373683, 
18.7317187141294, 18.9807956857515, 20.3878589984706, 20.2138031064884, 
21.5466646645502, 22.4587803504256, 23.3367446198862, 24.351433610226, 
24.756425047641, 25.5567033937034, 27.0888143967736, 31.8674059850769, 
32.2797866089406, 29.9119620996882, 29.7372469455416, 29.6036588898934, 
28.1786828251114, 23.5299488424583, 19.8071225875958, 16.4200907177126, 
13.8157205916348, 24.9052726955745, 23.2525450858707, 15.4322778487833, 
11.4139395101001, 12.6280070768167, 12.7317168387143, 14.2823734655314, 
14.4702714282311, 15.565664817003, 17.0053740914605, 17.8123193902973, 
19.085798309982, 18.6757751260586, 18.723998391723, 18.5482116204633, 
16.1370099279873, 15.0760295228264, 12.822428082062, 10.8169296925352, 
8.53206021469168, 7.57883256313832, 7.90927771905417, 8.71332819140725, 
7.92276209497131, 5.68473378655548, 4.31118023825224, 5.30671276132695, 
7.02630327950313, 10.6186160921216, 11.3800783587135, 10.7226458578344, 
12.2673561378797, 9.44663756960719, 9.00616987110468, 11.9255083120552, 
17.5781256820809, 14.6685248532456, 15.0725332566032, 17.0152880518942, 
17.4335787629381, 14.8162414946875, 13.9433499348345, 13.7811675872092, 
11.4194573334759, 20.6627908725043, 24.456857344671, 26.9110720311341, 
29.7005882130269, 30.8140953873781, 29.6763824439426, 26.2003332115879, 
17.2220129029145, 18.274102326022, 19.3718785564096, 20.1947811968411, 
20.5006568309742, 20.9451490177134, 20.868053142554, 19.4946516361577, 
19.1361246688804, 18.4334552831468, 16.7538221437907, 15.6186254042813, 
13.7758942252347, 14.2983753196306, 16.3624725976036, 19.9762375736536, 
24.3097741611668, 25.2152703797421, 27.4327279306759, 30.8516375047321, 
19.7361389185162, 16.356188014156, 15.5387402888203, 15.8892028608949, 
11.1224871644179, 8.84439937904988, 8.80090871551959, 11.1459272702519, 
10.3606780041065, 10.9485266069136, 12.397640107044, 12.3640973010802, 
9.1648379359883, 7.31135300525946, 9.06299062693732, 13.8239277215833, 
16.836368223128, 20.1272884327997, 18.8857188945312, 20.5818359580053, 
21.8444836892572, 22.5558249913885, 22.0765049558776, 24.7527437892732, 
27.0979686492998, 25.4451611354304, 23.3313385410153, 22.464565630675, 
19.9199351977965, 19.390584193174, 21.1588422084341, 22.3975217602772, 
23.4183707713846, 21.5735539783071, 22.9658640561162, 22.6574836132354, 
23.1432055836179, 24.1550228955901, 26.1307165458262, 30.289814683018, 
32.5088648950077, 31.1697566843635, 32.7074771121226, 34.8013812621943, 
37.023351920487, 38.1618730125409, 37.9479004458954, 35.627678318392, 
32.7757103568373, 29.9253174364041, 28.6157831853704, 29.1731616822873, 
28.4262356153627, 30.4173115890969, 30.5212852992803, 31.5671468826574, 
29.7596838118952, 28.9310253022001, 25.6550759054862, 22.4455491715208, 
17.9177073652873, 13.1970324774727, 12.964030980619, 13.9230763716529, 
23.5548580015286, 22.6484484281833, 22.4673379113301, 21.9723239629941, 
20.3750894137696, 17.605366101918, 17.4540620904575, 18.4390755782599, 
18.6191719824054, 19.3083471370153, 22.2993625532571, 27.1818957684656, 
33.9815147256227, 29.2962676473082, 26.4858855077577, 25.6999791918312, 
25.6762563689988, 26.0868901940831, 26.8108194557244, 27.8025976760139, 
26.3311175366056, 24.0509881362589, 21.3385827834339, 19.5024321045435, 
20.8550023619992, 19.5276516802643, 18.9505677044051, 20.1504914314814, 
23.0547281741143, 21.1820223728197, 22.8374676771078, 25.5775142550711, 
26.2686062076563, 26.4556984334268, 27.7480723434562, 29.6572163948088, 
30.5372990594179, 30.8980555829381, 31.8559414400431, 31.7915079471112, 
31.1019772024964, 30.1229750530396, 28.5070794007507, 27.0853492854166, 
26.5464941747512, 28.0475665291844, 28.8709508082225, 29.1554969567807, 
29.6738421007345, 28.5094674949343, 28.496067216356, 28.4099448482126, 
28.5982154652807, 27.6041396583703, 26.2088543523036, 26.7300531533377, 
28.5949450445305, 28.5425731655724, 29.2216673441961, 29.714078580941, 
29.5498030720869, 32.8400216738179, 37.0319908599474, 39.8199408742341, 
12.9316946590926, 12.1189841602846, 10.2371687636444, 8.80183905380826, 
8.56835416302959, 10.3211792691477, 10.3464695723814, 10.8993000082191, 
6.54465555851981, 5.46438413711733, 6.84268236959143, 7.66699718335858, 
6.64407899219206, 8.36715896048984, 8.87674096752462, 11.1290089479538, 
12.6176223799162, 15.9005383905595, 18.0404711988086, 20.4603632738225, 
21.9285692889607, 23.2302571830587, 25.2150563683233, 26.5902238722634, 
25.9456846238755, 26.6244691228804, 23.383243413576, 19.5505676107401, 
17.7117466047808, 16.094350777183, 14.4802050070385, 15.590285385215, 
18.4803492948929, 18.5979743947435, 21.0794551508179, 23.045173110941, 
24.3950243040872, 24.7046982825553, 30.1586522376974, 34.5543003344482, 
32.6477885818973, 33.2921495886034, 34.0053508579225, 33.673717507626, 
32.9848147402721, 31.9586498356753, 31.3130162277742, 29.3957256653809, 
27.9702213576144, 27.1767104646776, 25.7091422179426, 25.6917376005403, 
25.4535859736816, 25.8735097367904, 24.5558054296203, 21.8292242278296, 
19.8403057934627, 23.0515876361141, 23.1145107449502, 20.3316365983609, 
19.1760492987616, 19.7954079823422, 22.7163589333881, 24.1979402517242, 
31.1112548518387, 31.6063921313205, 31.935677359458, 30.6182382708131, 
28.162726522919, 26.5758146868534, 23.4783548834523, 20.5136557061654, 
18.7147747970546, 20.5538460663832, 25.39210787382, 31.280012728044, 
35.0109609846278, 28.0162119607658, 28.0565571927712, 30.5754896785205, 
33.7175232072975, 36.2962752152816, 36.1354379358757, 35.1591182777996, 
35.6569096411707, 35.7052439038844, 36.2288715239456, 36.7719301397068, 
36.0523702516819, 35.7735537029253, 36.3281553794952, 38.1247446199556, 
40.8992722730844, 42.488868433224, 41.5985100220242, 37.8548494718039, 
32.581208141129, 35.1692341310651, 36.8703351208495, 37.1428910545658, 
32.1072842424694, 31.7280311759972, 31.7077546433819, 34.1943387131495, 
36.3162750111459, 36.8194622998428, 37.3498961526291, 35.6545766414716, 
33.2365599827184, 30.0246952812454, 29.5157002191774, 30.9095443930866, 
34.5435519034044, 34.0238464289074, 35.7138684943977, 37.7752332770596, 
40.4189650294038, 38.5949240061308, 36.6583345928791, 36.1204332869508, 
35.5178304607111, 36.7637645934617, 38.1835124432105, 40.512639084342, 
41.7309209750672, 44.1368453559309, 43.8078120522917, 45.8624908713306, 
9.91315523504061, 7.83452265579604, 6.55279778070773, 3.89232855028949, 
2.49126115402126, 2.06636744988997, 3.35502335512414, 6.24155741911059, 
5.38388474189794, 5.71863311775888, 3.53941886250367, 1.95662208193552, 
0.148158681740251, 1.1952548745022, 3.15982079642996, 0.49210575700192, 
0.519440294903558, 2.9218642499632, 3.63284713274372, 6.76516997262585, 
8.68570913460455, 8.57452980084653, 10.6404592561631, 12.8471899909408, 
13.3542223054888, 13.9937563206796, 16.6137280376809, 17.6539397407461, 
22.0699349576732, 24.9690451657431, 29.839657256851, 32.0987453711185, 
37.0970974824521, 38.5200355338485, 42.5947326032893, 44.9949440082404, 
50.1725643676363, 55.3285470756083, 54.7230376902602, 55.5697505471726, 
52.7542499359321, 52.2825545324835, 48.6970838455491, 43.9677452166308, 
41.4496938778813, 43.1137345607866, 43.8700954484507, 41.9225449338636, 
42.4248322904062, 39.6679844847734, 38.4595286693062, 36.2298298465115, 
34.2781462630074, 32.4540099258218, 31.6013254974506, 33.0396558603175, 
38.1198853731198, 35.0322304731766, 29.1335975052961, 22.8354887453348, 
21.4587546103882, 22.308803637988, 24.5728479043388, 27.21297104555, 
17.1819435013492, 17.8554028810094, 21.9655940875574, 23.9225565286609, 
23.6304042444764, 24.7235974991769, 25.5281191924206, 25.4358287729095, 
26.0532614474233, 26.8542951444164, 27.1507529516812, 27.0887406840043, 
27.6295980937631, 28.5614317522339, 28.3513649241197, 27.6464914917721, 
25.6211292568882, 22.6784464459324, 21.6839978669255, 19.8332667354494, 
19.9223365059495, 22.1724429381004, 28.4184021361474, 32.805108750708, 
31.3993771956137, 33.5401546600306, 35.3565513342246, 37.3866278362993, 
40.7712278056811, 43.7836154545377, 42.7269900357206, 38.6646964212692, 
33.7223549578911, 32.8095961809433, 32.8227137138846, 33.7465954236313, 
32.8304948243261, 30.4747839766765, 29.3724592708776, 28.9912914061174, 
29.3525337912647, 30.9996319384989, 31.9188657865743, 32.133316934676, 
31.3946249731815, 31.0434063251654, 31.4222525248755, 31.5306243665683, 
34.897968060876, 34.0994911855773, 32.9177901120637, 31.8213110739527, 
32.5512755579636, 31.3997717653454, 31.4493137346281, 32.0073303133403, 
33.3382860572721, 34.7018637631532, 35.776468239499, 36.2284206246489, 
37.1440315043935, 40.0226035376064, 42.5401453969618, 44.9529501863812, 
13.4369902307368, 12.0338738093844, 11.4808577661966, 10.7129055393164, 
10.1535212698557, 8.66332620993116, 8.84645204772863, 9.61915606587303, 
9.94711650485316, 9.81271182742484, 7.91531245280362, 7.92345345736219, 
9.05375345239321, 9.24236579389951, 8.40671319809074, 8.90501292322871, 
9.28386730617935, 10.6897836467706, 10.5138291381848, 10.650486744676, 
11.6865554887995, 11.7893003120848, 13.8006678977712, 14.2969185635706, 
16.1052464744284, 17.7341057061135, 20.1059240493809, 22.6084693230095, 
25.9007937374107, 32.5876469435131, 38.3177345115868, 41.8644722495726, 
46.1242343471446, 50.6065087449325, 55.8500527656509, 59.6044563434007, 
63.1604998491673, 66.576030240554, 66.8550644167256, 66.8341591597672, 
67.2253411230628, 68.1207357134203, 68.8554570786724, 67.4916262961679, 
64.475944548583, 63.3840553633854, 61.8662929817962, 60.2512256388088, 
59.5870765060548, 59.6641495818755, 57.7634990950955, 54.1747333464055, 
51.303444302519, 47.0366084060608, 42.4366326313344, 38.2701731445216, 
37.7574185233592, 39.5471164553846, 39.4546782537745, 36.6734297985646, 
30.1778049471079, 27.5173335438703, 23.5573553712838, 19.6175209985682, 
29.7739121373998, 22.8833329566833, 19.2897670802557, 18.8249240359308, 
18.4726589580968, 23.7019043404939, 22.8840648030995, 20.5020544919573, 
17.7395168779123, 16.5191057407913, 13.7484303329341, 12.013378785478, 
13.681615856612, 15.5718924921468, 16.7058185238404, 17.3303054709531, 
18.2408745656858, 21.7691710556524, 24.905345620743, 29.2238024981239, 
33.0947605671574, 29.7324656964791, 30.8621185613333, 32.1940175809084, 
34.5560764550304, 36.4381650438003, 38.2816964382953, 38.5516158743422, 
39.986849242909, 41.0394274789976, 41.3812650170372, 42.8346039501876, 
43.0693886495686, 39.8040162541349, 38.6991707878879, 37.616784344638, 
37.3817094977432, 35.4165988746972, 35.1022904596085, 35.4245539541514, 
35.2359329500545, 36.7367643355379, 37.9526610217124, 39.7727379136396, 
39.8925135820943, 40.8023646682773, 43.5564100963287, 44.7520641966879, 
46.4510487277813, 44.448453485913, 42.9516223391202, 43.0366723650785, 
42.856959158089, 42.1846935315121, 42.4330785479567, 42.9350863445782, 
43.2394849296013, 44.6409373013808, 47.1827480699465, 47.4245271147565, 
48.3183850785869, 49.2098547748522, 50.1558981135185, 51.9318253414845, 
15.652961326362, 16.0423086822042, 17.2152791672946, 17.2347808189188, 
16.4692416177192, 15.9892016145277, 17.4261981744551, 17.6989228989087, 
17.330989491965, 17.2970185003451, 17.1146929407731, 17.2865607190072, 
18.1493603289472, 17.8877607988243, 19.379093185813, 21.2588346927663, 
21.8251560870627, 21.9847453140702, 22.2819640825119, 22.4552193070326, 
22.8477460598402, 23.718561712993, 24.7249561990408, 26.5142207384975, 
27.683399522485, 28.4733176916976, 29.9247443839513, 31.3708437926519, 
34.1358983623584, 36.7306363224471, 38.0461791758227, 39.5151793458758, 
39.6303811551982, 41.5218539113027, 43.2149922455355, 45.7848770102405, 
48.904453123193, 49.1459564650878, 50.5142899304611, 53.1031676895714, 
54.0879167218001, 55.0842957280173, 55.5591017653529, 58.0075446135001, 
58.6290164327946, 59.3082875516971, 59.6588249444059, 59.8672913939924, 
59.4326785965069, 59.0910519816974, 58.5620891715461, 58.1808340908844, 
57.2154701897654, 53.3952635333695, 51.262622227081, 49.3835966375007, 
45.5437873129028, 41.1791568025701, 36.4855289653366, 32.8894304148017, 
30.0196784842475, 28.5056323345534, 23.8736611145859, 24.4996053369152, 
19.8571154608762, 21.6573740258332, 22.3165772869503, 23.8285764375074, 
29.0984382392354, 36.7883964556601, 38.8054404902253, 37.8533493559798, 
36.3854034130093, 35.0479145890181, 31.7594040215542, 27.9528700286328, 
26.1802353807673, 26.1786764901725, 26.6093847421694, 26.5265889941424, 
25.8908395782636, 24.9913891834021, 25.2771669464366, 25.1681466426163, 
25.6948511521932, 25.708651781083, 25.2830046261792, 25.4272163611253, 
26.850871103606, 27.3735622194445, 28.8420501388572, 30.1426467863899, 
30.6504434949001, 32.6130549910426, 33.1192988224308, 34.0398020463928, 
33.7896658757732, 33.0518188805355, 32.4672464885508, 31.5321720445673, 
31.4852817880143, 30.1877785456796, 29.4499045190464, 28.3696982300806, 
27.6680308307796, 26.942712125134, 26.9544081345062, 27.9847655823097, 
26.0324859536164, 26.2642522829197, 26.7216124398603, 26.9462547556949, 
26.9268020118696, 26.6395386352571, 27.5485257269516, 28.0292040906753, 
28.7190348552072, 28.7152577171317, 28.3189326266314, 28.7070439737008, 
28.926801396602, 30.014722674714, 30.6354552860212, 30.5651508216867, 
28.9370939458108, 28.7765098611173, 29.7380223659807, 30.8575202875486, 
41.0040371677014, 40.9216305969762, 40.1800687858887, 39.2031365629932, 
39.1138356948039, 39.1425739946192, 38.6197021027114, 38.0626599605031, 
38.2183543958813, 38.0954730323031, 38.6997461532963, 38.9538122239869, 
38.1569374695236, 37.9483904850231, 37.2302655250042, 37.2577815909196, 
38.5177914770695, 38.4015864575589, 38.3896251342292, 39.2408004393991, 
38.6763416800329, 38.1451409011677, 38.7822674503402, 38.139394272112, 
38.6997334149812, 38.0532751858707, 38.1747576488532, 37.6388186714147, 
36.7594891494034, 36.0155984454148, 34.6115591570666, 34.1158309834443, 
33.6245397361779, 32.8411945618495, 32.9989061484026, 32.9771977291905, 
32.5098728033488, 32.4333504409289, 31.9403721152645, 31.8482712398959, 
31.0880791030545, 30.3946555336461, 30.9466553361087, 31.0360232403449, 
30.9611386408038, 30.0464663186929, 29.242729677614, 28.9292860338773, 
27.7723498402251, 26.7103047983328, 25.6526075401583, 24.4198440490224, 
23.3320483200434, 22.291101866487, 22.0628517297235, 21.1445883697007, 
20.4753887143934, 19.647571238509, 18.9181277848348, 17.6999192648078, 
16.4835016311833, 15.9681977259848, 15.8305221245734, 16.7287273100248
), offset = 0, gain = 1, inmemory = TRUE, fromdisk = FALSE, 
    isfactor = FALSE, attributes = list(), haveminmax = TRUE, 
    min = -11.6835174739136, max = 97.3832753485588, band = 1L, 
    unit = "", names = "layer"), legend = new(".RasterLegend", 
    type = character(0), values = logical(0), color = logical(0), 
    names = logical(0), colortable = logical(0)), title = character(0), 
extent = new("Extent", xmin = -181.40625, xmax = 178.59375, 
    ymin = -89.258464857103, ymax = 89.258464857103), rotated = FALSE, 
rotation = new(".Rotation", geotrans = numeric(0), transfun = function () 
NULL), ncols = 128L, nrows = 64L, crs = new("CRS", projargs = "+proj=longlat +datum=WGS84 +no_defs"), 
history = list(), z = list())

Any help would be greatly appreciated!

Thank you!


Solution

  • Not sure about the error (a reprex or at least the output of traceback() may be useful), but

    col = col=brewer.pal(n=10, name="RdBu")
    

    should probably be replaced by

    col.regions = colorRampPalette(brewer.pal(n=10, name="RdBu"))