[{"data":1,"prerenderedAt":530},["ShallowReactive",2],{"/sr/set":3,"/sr/set-surround":519},{"id":4,"title":5,"body":6,"description":485,"extension":486,"meta":487,"navigation":505,"path":515,"seo":516,"stem":517,"__hash__":518},"content/sr/set.md","Simple R Extension Dictionary: set",{"type":7,"value":8,"toc":475},"minimark",[9],[10,11,15,16,15,26,51,55,58,175,178,188,197,200,472],"div",{"className":12,"id":14},[13],"dict_entry","set","\n  ",[17,18,20,21,15],"h3",{"id":19},"srset","\n    ",[22,23,25],"a",{"href":24},"#set","sr:set",[27,28,32],"h4",{"id":29,"className":30},"srset-variable-name-value",[31],"section-heading",[22,33,20,37,15],{"className":34,"href":36},[35],"section-anchor","#----srset-variable-name-value--",[38,39,42,43,47,48],"span",{"className":40},[41],"prim_example","sr:set ",[44,45,46],"i",{},"variable-name"," ",[44,49,50],{},"value",[52,53,54],"p",{},"Sets a variable in the R session with the given name to the given NetLogo value.\nNetLogo objects will be converted to R objects as expected.",[52,56,57],{},"Note that lists in NetLogo are converted into lists in R if the elements are of different\ntypes.  If all the elements of a NetLogo list are of the identical number, boolean, or\nstring type then the data will be automatically converted into a vector in R.",[59,60,61],"pre",{},[62,63,64,47,69,47,74,79,82,47,86,47,90,95,97,47,100,104,105,47,109,47,113,117,118,120,47,123,47,127,131,133,47,136,47,140,144,146,47,149,47,153,157,159,47,164,47,168,47,171],"code",{},[38,65,25],{"className":66},[67,68],"token","variable",[38,70,73],{"className":71},[67,72],"string","\"x\"",[38,75,78],{"className":76},[67,77],"number","42",[80,81],"br",{},[38,83,85],{"className":84},[67,68],"sr:run",[38,87,89],{"className":88},[67,72],"\"print(x)\"",[38,91,94],{"className":92},[67,93],"comment",";; prints `[1] 42` to the command center",[80,96],{},[38,98,25],{"className":99},[67,68],[38,101,103],{"className":102},[67,72],"\"y\""," [",[38,106,108],{"className":107},[67,77],"1",[38,110,112],{"className":111},[67,77],"2",[38,114,116],{"className":115},[67,77],"3","]",[80,119],{},[38,121,85],{"className":122},[67,68],[38,124,126],{"className":125},[67,72],"\"print(typeof(y))\"",[38,128,130],{"className":129},[67,93],";; prints `[1] \"double\"` to the command center",[80,132],{},[38,134,85],{"className":135},[67,68],[38,137,139],{"className":138},[67,72],"\"print(typeof(list(y)))\"",[38,141,143],{"className":142},[67,93],";; prints `[1] \"list\"` to the command center",[80,145],{},[38,147,85],{"className":148},[67,68],[38,150,152],{"className":151},[67,72],"\"print(y)\"",[38,154,156],{"className":155},[67,93],";; prints `[1] 1 2 3` to the command center",[80,158],{},[38,160,163],{"className":161},[67,162],"command","show",[38,165,167],{"className":166},[67,68],"sr:runresult",[38,169,103],{"className":170},[67,72],[38,172,174],{"className":173},[67,93],";; reports [1 2 3]",[52,176,177],{},"Agents are converted into lists with named elements for each agent variable.",[52,179,180,181,184,185,187],{},"Agentsets are converted into a list of the above lists. If you want to convert\nagents to a data frame, see ",[62,182,183],{},"sr:set-agent-data-frame",".  If you want to use ",[62,186,25],{},"\nand do the conversion manually, try the following:",[59,189,195],{"className":190,"code":192,"language":193,"meta":194},[191],"language-R","my_data_frame \u003C- as.data.frame(do.call(rbind, \u003Cagentset-list-of-lists>))\n","R","",[62,196,192],{"__ignoreMap":194},[52,198,199],{},"For example:",[59,201,202],{},[62,203,204,104,209,47,213,117,217,104,223,227,228,230,47,234,237,238,47,241,47,246,227,250,252,47,256,47,259,237,263,47,266,47,269,47,272,47,275,47,279,117,283,285,47,288,47,291,237,294,47,297,47,300,47,304,47,307,47,310,117,314,316,318,47,321,47,325,47,328,331,333,47,336,47,340,343,345,47,348,352,354,358,360,364,366,370,372,376,378,382,384,388,390,394,396,398,47,401,47,405,408,410,47,413,417,419,47,422,426,428,431,433,437,439,443,445,449,451,455,457,461,463,467,469],{},[38,205,208],{"className":206},[67,207],"keyword","breed",[38,210,212],{"className":211},[67,68],"goats",[38,214,216],{"className":215},[67,68],"goat",[38,218,220,222],{"className":219},[67,207],[80,221],{},"goats-own",[38,224,226],{"className":225},[67,68],"energy"," ]",[80,229],{},[38,231,233],{"className":232},[67,68],"create-goats",[38,235,112],{"className":236},[67,77]," [ ",[38,239,14],{"className":240},[67,162],[38,242,245],{"className":243},[67,244],"reporter","color",[38,247,249],{"className":248},[67,77],"75",[80,251],{},[38,253,255],{"className":254},[67,162],"ask",[38,257,216],{"className":258},[67,68],[38,260,262],{"className":261},[67,77],"0",[38,264,14],{"className":265},[67,162],[38,267,226],{"className":268},[67,68],[38,270,78],{"className":271},[67,77],[38,273,14],{"className":274},[67,162],[38,276,278],{"className":277},[67,244],"xcor",[38,280,282],{"className":281},[67,77],"5",[80,284],{},[38,286,255],{"className":287},[67,162],[38,289,216],{"className":290},[67,68],[38,292,108],{"className":293},[67,77],[38,295,14],{"className":296},[67,162],[38,298,226],{"className":299},[67,68],[38,301,303],{"className":302},[67,77],"-42",[38,305,14],{"className":306},[67,162],[38,308,278],{"className":309},[67,244],[38,311,313],{"className":312},[67,77],"-5",[80,315],{},[80,317],{},[38,319,25],{"className":320},[67,68],[38,322,324],{"className":323},[67,72],"\"goat\"",[38,326,216],{"className":327},[67,68],[38,329,262],{"className":330},[67,77],[80,332],{},[38,334,85],{"className":335},[67,68],[38,337,339],{"className":338},[67,72],"\"print(typeof(goat))\"",[38,341,143],{"className":342},[67,93],[80,344],{},[38,346,85],{"className":347},[67,68],[38,349,351],{"className":350},[67,72],"\"print(goat)\"",[80,353],{},[38,355,357],{"className":356},[67,93],";; Should output:",[80,359],{},[38,361,363],{"className":362},[67,93],";; $WHO",[80,365],{},[38,367,369],{"className":368},[67,93],";; [1] 0",[80,371],{},[38,373,375],{"className":374},[67,93],";;",[80,377],{},[38,379,381],{"className":380},[67,93],";; $COLOR",[80,383],{},[38,385,387],{"className":386},[67,93],";; [1] 75",[80,389],{},[38,391,393],{"className":392},[67,93],";; (etc.)",[80,395],{},[80,397],{},[38,399,25],{"className":400},[67,68],[38,402,404],{"className":403},[67,72],"\"goats_list_of_lists\"",[38,406,212],{"className":407},[67,68],[80,409],{},[38,411,85],{"className":412},[67,68],[38,414,416],{"className":415},[67,72],"\"goats_data_frame \u003C- as.data.frame(do.call(rbind, goats_list_of_lists))\"",[80,418],{},[38,420,85],{"className":421},[67,68],[38,423,425],{"className":424},[67,72],"\"print(goats_data_frame)\"",[80,427],{},[38,429,357],{"className":430},[67,93],[80,432],{},[38,434,436],{"className":435},[67,93],";;   WHO COLOR HEADING XCOR YCOR   SHAPE LABEL LABEL-COLOR BREED HIDDEN? SIZE",[80,438],{},[38,440,442],{"className":441},[67,93],";; 1   0    75      82    5    0 default               9.9 GOATS   FALSE    1",[80,444],{},[38,446,448],{"className":447},[67,93],";; 2   1    75     200   -5    0 default               9.9 GOATS   FALSE    1",[80,450],{},[38,452,454],{"className":453},[67,93],";;   PEN-SIZE PEN-MODE ENERGY",[80,456],{},[38,458,460],{"className":459},[67,93],";; 1        1       up     42",[80,462],{},[38,464,466],{"className":465},[67,93],";; 2        1       up    -42",[80,468],{},[38,470,375],{"className":471},[67,93],[52,473,474],{},"Agents with variables containing references to agentsets will have those variables converted into the string representation of that agentset.",{"title":194,"searchDepth":476,"depth":477,"links":478},5,3,[479],{"id":19,"depth":477,"text":480,"children":481},"\n    sr:set\n  ",[482],{"id":29,"depth":483,"text":484},4,"\n    sr:set variable-name value\n  ","Documentation for the set primitive.","md",{"source":488,"metadataOutputPath":489,"projectConfig":490,"language":498,"inheritFrom":506,"output":505,"version":491,"layout":507,"dictionaryDisplayName":508,"dictionaryHomeDirectory":509,"indexFileURI":510,"currentItemId":14,"currentItemLabel":25,"primRoot":511,"icon":512,"extensionName":513,"assetsRoot":493},"../../external/extensions/sr/sr/set.md","content/sr/set.metadata.yaml",{"version":491,"projectRoot":492,"scanRoot":493,"outputRoot":494,"defaults":495,"engine":501,"partials":502,"dedupeIdenticalDiskWrites":505},"7.0.4",".","/home/runner/work/Helio/Helio/external/extensions/sr","content",{"inheritFrom":496,"language":498,"output":499,"extension":486,"title":500,"version":491},[497],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":503,"extensions":504},[492],[501,486],true,[497],"catalog","Simple R Extension Dictionary","/sr.html","/_index/extensions/sr.txt","sr","logos:r-lang",{"shortName":511,"fullName":514},"Simple R","/sr/set",{"title":5,"description":485},"sr/set","bRG0sE8U17GhhTyD5-FaGXLsTY5IlcunEec4nL6YrX4",[520,525],{"title":521,"path":522,"stem":523,"description":524},"Simple R Extension Dictionary: runresult","/sr/runresult","sr/runresult","Documentation for the runresult primitive.",{"title":526,"path":527,"stem":528,"description":529},"Simple R Extension Dictionary: set-agent","/sr/set-agent","sr/set-agent","Documentation for the set-agent primitive.",1777657901102]