I'm struggling trying to format a collectd ploted file si I can later import it to an influx db instance.
This is how the file looks like:
#Date Time [CPU]User% [CPU]Nice% [CPU]Sys% [CPU]Wait% [CPU]Irq% [CPU]Soft% [CPU]Steal% [CPU]Idle% [CPU]Totl% [CPU]Intrpt/sec [CPU]Ctx/sec [CPU]Proc/sec [CPU]ProcQue [CPU]ProcRun [CPU]L-Avg1 [CPU]L-Avg5 [CPU]L-Avg15 [CPU]RunTot [CPU]BlkTot [MEM]Tot [MEM]Used [MEM]Free [MEM]Shared [MEM]Buf [MEM]Cached [MEM]Slab [MEM]Map [MEM]Anon [MEM]Commit [MEM]Locked [MEM]SwapTot [MEM]SwapUsed [MEM]SwapFree [MEM]SwapIn [MEM]SwapOut [MEM]Dirty [MEM]Clean [MEM]Laundry [MEM]Inactive [MEM]PageIn [MEM]PageOut [MEM]PageFaults [MEM]PageMajFaults [MEM]HugeTotal [MEM]HugeFree [MEM]HugeRsvd [MEM]SUnreclaim [SOCK]Used [SOCK]Tcp [SOCK]Orph [SOCK]Tw [SOCK]Alloc [SOCK]Mem [SOCK]Udp [SOCK]Raw [SOCK]Frag [SOCK]FragMem [NET]RxPktTot [NET]TxPktTot [NET]RxKBTot [NET]TxKBTot [NET]RxCmpTot [NET]RxMltTot [NET]TxCmpTot [NET]RxErrsTot [NET]TxErrsTot [DSK]ReadTot [DSK]WriteTot [DSK]OpsTot [DSK]ReadKBTot [DSK]WriteKBTot [DSK]KbTot [DSK]ReadMrgTot [DSK]WriteMrgTot [DSK]MrgTot [INODE]NumDentry [INODE]openFiles [INODE]MaxFile% [INODE]used [NFS]ReadsS [NFS]WritesS [NFS]MetaS [NFS]CommitS [NFS]Udp [NFS]Tcp [NFS]TcpConn [NFS]BadAuth [NFS]BadClient [NFS]ReadsC [NFS]WritesC [NFS]MetaC [NFS]CommitC [NFS]Retrans [NFS]AuthRef [TCP]IpErr [TCP]TcpErr [TCP]UdpErr [TCP]IcmpErr [TCP]Loss [TCP]FTrans [BUD]1Page [BUD]2Pages [BUD]4Pages [BUD]8Pages [BUD]16Pages [BUD]32Pages [BUD]64Pages [BUD]128Pages [BUD]256Pages [BUD]512Pages [BUD]1024Pages
20190228 00:01:00 12 0 3 0 0 1 0 84 16 26957 20219 14 2991 3 0.05 0.18 0.13 1 0 198339428 197144012 1195416 0 817844 34053472 1960600 76668 158641184 201414800 0 17825788 0 17825788 0 0 224 0 0 19111168 3 110 4088 0 0 0 0 94716 2885 44 0 5 1982 1808 0 0 0 0 9739 9767 30385 17320 0 0 0 0 0 0 12 13 3 110 113 0 16 16 635592 7488 0 476716 0 0 0 0 0 0 0 0 0 0 0 8 0 0 22 0 1 0 0 0 0 48963 10707 10980 1226 496 282 142 43 19 6 132
20190228 00:02:00 11 0 3 0 0 1 0 85 15 26062 18226 5 2988 3 0.02 0.14 0.12 2 0 198339428 197138128 1201300 0 817856 34054692 1960244 75468 158636064 201398036 0 17825788 0 17825788 0 0 220 0 0 19111524 0 81 960 0 0 0 0 94420 2867 42 0 7 1973 1842 0 0 0 0 9391 9405 28934 16605 0 0 0 0 0 0 9 9 0 81 81 0 11 11 635446 7232 0 476576 0 0 0 0 0 0 0 0 0 0 0 3 0 0 8 0 1 0 0 0 0 49798 10849 10995 1241 499 282 142 43 19 6 132
20190228 00:03:00 11 0 3 0 0 1 0 85 15 25750 17963 4 2980 0 0.00 0.11 0.10 2 0 198339428 197137468 1201960 0 817856 34056400 1960312 75468 158633880 201397832 0 17825788 0 17825788 0 0 320 0 0 19111712 0 75 668 0 0 0 0 94488 2869 42 0 5 1975 1916 0 0 0 0 9230 9242 28411 16243 0 0 0 0 0 0 9 9 0 75 75 0 10 10 635434 7232 0 476564 0 0 0 0 0 0 0 0 0 0 0 2 0 0 6 0 1 0 0 0 0 50029 10817 10998 1243 501 282 142 43 19 6 132
20190228 00:04:00 11 0 3 0 0 1 0 84 16 25755 17871 10 2981 5 0.08 0.11 0.10 3 0 198339428 197140864 1198564 0 817856 34058072 1960320 75468 158634508 201398088 0 17825788 0 17825788 0 0 232 0 0 19111980 0 79 2740 0 0 0 0 94488 2867 4 0 2 1973 1899 0 0 0 0 9191 9197 28247 16183 0 0 0 0 0 0 9 9 0 79 79 0 10 10 635433 7264 0 476563 0 0 0 0 0 0 0 0 0 0 0 5 0 0 12 0 1 0 0 0 0 49243 10842 10985 1245 501 282 142 43 19 6 132
20190228 00:05:00 12 0 4 0 0 1 0 83 17 26243 18319 76 2985 3 0.06 0.10 0.09 2 0 198339428 197148040 1191388 0 817856 34059808 1961420 75492 158637636 201405208 0 17825788 0 17825788 0 0 252 0 0 19112012 0 85 18686 0 0 0 0 95556 2884 43 0 6 1984 1945 0 0 0 0 9176 9173 28153 16029 0 0 0 0 0 0 10 10 0 85 85 0 12 12 635473 7328 0 476603 0 0 0 0 0 0 0 0 0 0 0 3 0 0 7 0 1 0 0 0 0 47625 10801 10979 1253 505 282 142 43 19 6 132
What I'm trying to do, is to get it in a format that looks like this:
cpu_value,host=mxspacr1,instance=5,type=cpu,type_instance=softirq value=180599 1551128614916131663
cpu_value,host=mxspacr1,instance=2,type=cpu,type_instance=interrupt value=752 1551128614916112943
cpu_value,host=mxspacr1,instance=4,type=cpu,type_instance=softirq value=205697 1551128614916128446
cpu_value,host=mxspacr1,instance=7,type=cpu,type_instance=nice value=19250943 1551128614916111618
cpu_value,host=mxspacr1,instance=2,type=cpu,type_instance=softirq value=160513 1551128614916127690
cpu_value,host=mxspacr1,instance=1,type=cpu,type_instance=softirq value=178677 1551128614916127265
cpu_value,host=mxspacr1,instance=0,type=cpu,type_instance=softirq value=212274 1551128614916126586
cpu_value,host=mxspacr1,instance=6,type=cpu,type_instance=interrupt value=673 1551128614916116661
cpu_value,host=mxspacr1,instance=4,type=cpu,type_instance=interrupt value=701 1551128614916115893
cpu_value,host=mxspacr1,instance=3,type=cpu,type_instance=interrupt value=723 1551128614916115492
cpu_value,host=mxspacr1,instance=1,type=cpu,type_instance=interrupt value=756 1551128614916112550
cpu_value,host=mxspacr1,instance=6,type=cpu,type_instance=nice value=21661921 1551128614916111032
cpu_value,host=mxspacr1,instance=3,type=cpu,type_instance=nice value=18494760 1551128614916098304
cpu_value,host=mxspacr1,instance=0,type=cpu,type_instance=interrupt value=552 1551
What I have managed to do so far is just to convert the date string into EPOCH format.
I was thinking somehow to use the first value "[CPU]" as the measurement, and the "User%" as the type, the host I can take it from the system where the script will run.
I would really appreciate your help, because I really basic knowledge of text editing.
Thanks.
EDIT: this is what would expect to get with the information of the second line using as a header the first row:
cpu_value,host=mxspacr1,type=cpu,type_instance=user% value=0 1551128614916131663
EDIT: This is what I have so far, and I'm stuck here.
awk -v HOSTNAME="$HOSTNAME" 'BEGIN { FS="[][]"; getline; NR==1; f1=$2; f2=$3 } { RS=" "; printf f1"_measurement,host="HOSTNAME",type="f2"value="$3" ", system("date +%s -d \""$1" "$2"\"") }' mxmcaim01-20190228.tab
And this is what I get, but this is only for 1 column, now I don't know how to process the remaining columns such as Nice, Sys, Wait and so on.
CPU_measurement,host=mxmcamon05,type=User% value= 1552014000
CPU_measurement,host=mxmcamon05,type=User% value= 1551960000
CPU_measurement,host=mxmcamon05,type=User% value= 1551343500
CPU_measurement,host=mxmcamon05,type=User% value= 1551997620
CPU_measurement,host=mxmcamon05,type=User% value= 1551985200
CPU_measurement,host=mxmcamon05,type=User% value= 1551938400
CPU_measurement,host=mxmcamon05,type=User% value= 1551949200
CPU_measurement,host=mxmcamon05,type=User% value= 1551938400
CPU_measurement,host=mxmcamon05,type=User% value= 1551938400
CPU_measurement,host=mxmcamon05,type=User% value= 1551945600
CPU_measurement,host=mxmcamon05,type=User% value= 1551938400
Please help.
EDIT. First of all, Thanks for your help.
Taking Advantage from you knowledge in text editing, I was expecting to use this for 3 separate files, but unfortunately and I don't know why the format is different, like this:
#Date Time SlabName ObjInUse ObjInUseB ObjAll ObjAllB SlabInUse SlabInUseB SlabAll SlabAllB SlabChg SlabPct
20190228 00:01:00 nfsd_drc 0 0 0 0 0 0 0 0 0 0
20190228 00:01:00 nfsd4_delegations 0 0 0 0 0 0 0 0 0 0
20190228 00:01:00 nfsd4_stateids 0 0 0 0 0 0 0 0 0 0
20190228 00:01:00 nfsd4_files 0 0 0 0 0 0 0 0 0 0
20190228 00:01:00 nfsd4_stateowners 0 0 0 0 0 0 0 0 0 0
20190228 00:01:00 nfs_direct_cache 0 0 0 0 0 0 0 0 0 0
So I don't how to handle the arrays in a way that I can use nfsd_drc as the type and then Iterate through ObjInUse ObjInUseB ObjAll ObjAllB SlabInUse SlabInUseB SlabAll SlabAllB SlabChg SlabPct and use them like the type_instance and finally the value in this case for ObjInUse will be 0, ObjInUseB = 0, ObjAll = 0, an so one, making something like this:
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=ObjectInUse value=0 1551128614916131663
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=ObjInuseB value=0 1551128614916131663
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=ObjAll value=0 1551128614916112943
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=ObjAllB value=0 1551128614916128446
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabInUse value=0 1551128614916111618
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabInUseB value=0 1551128614916127690
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabAll value=0 1551128614916127265
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabAllB value=0 1551128614916126586
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabChg value=0 1551128614916116661
slab_value,host=mxspacr1,type=nfsd_drc,type_instance=SlabPct value=0 1551128614916115893
slab_value is a hard-coded value.
Thanks.
It is not clear where do instance and type_instance=interrupt come from in your final desired format. Otherwise awk code below should work.
Note: it doesn't strip % from tag values and prints timestamp at end of line in seconds (append extra zeros if you want nanoseconds).
gawk -v HOSTNAME="$HOSTNAME" 'NR==1 {split($0,h,/[ \t\[\]]+/,s); for(i=0;i<length(h);i++){ h[i]=tolower(h[i]); };}; NR>1 { for(j=2;j<NF;j++) {k=2*j; printf("%s_value,host=%s,type=%s,type_instance=%s value=%s %s\n", h[k], HOSTNAME, h[k], h[k+1],$(j+1), mktime(substr($1,1,4)" "substr($1,5,2)" "substr($1,7,2)" "substr($2,1,2)" "substr($2,4,2)" "substr($2,7,2)));}}' mxmcaim01-20190228.tab
I am using bufio to append byte arrays to a file. When I use cat on it I get:
[176 0 0 0 4 0 0 0 1 0 0 0 57 12 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0][176 0 0 0 4 0 0 0 1 0 0 0 4 162 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0][176 0 0 0 4 0 0 0 1 0 0 0 35 200 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0]
So arrays of bytes. Now I want to read the file into memory, so I use:
content, err := ioutil.ReadFile(filename)
But when I display the content variable I get a completely different output than the contents of the file (and one array instead of many). What's wrong?
You wrote it wrong to the file. Its human readable format, should be binary.
My guess you used something like fmt.Fprintln(file, byte_slice) or variants.
It must be fmt.Fprintf(file, "%s", byte_slice) or similar.
Please, show us code how you write to the file.
So what think is happening is that the content inside of that file is a string. When you pull it out of the file it converts that string to bytes. What you need to do is convert those bytes to a string before you append to the file and then convert them back when you pull from the file
https://play.golang.org/p/PyBXAU9rVW
I have a matrix that is 50x2. But column 2 has different amount of entries. How can I make a box plot where the x axis is position and the y axis are the different counts? Ideally, I'd like to take the absolute value of the counts. Thanks in advance!
> mat.count[1:50,]
position count
1 136873135 0
2 136873136 0
3 136873137 0
4 136873138 0
5 136873139 0
6 136873140 -15
7 136873141 0
8 136873142 0
9 136873143 0
10 136873144 0
11 136873145 0
12 136873146 0
13 136873147 0
14 136873148 0
15 136873149 0
16 136873150 0
17 136873151 0
18 136873152 0
19 136873153 0
20 136873154 0
21 136873155 0
22 136873156 0
23 136873157 0
24 136873158 0
25 136873159 0
26 136873160 0
27 136873161 0
28 136873162 0
29 136873163 0
30 136873164 0
31 136873165 0
32 136873166 0
33 136873167 0
34 136873168 -1
35 136873169 0
36 136873170 0
37 136873171 0
38 136873172 0
39 136873173 -70
40 136873174 -66
41 136873175 -73,-1,-1,-1,-73,-1
42 136873176 -52
43 136873177 0
44 136873178 0
45 136873179 -66,-1
46 136873180 -1
47 136873181 0
48 136873182 -68,-75
49 136873183 -67,-67
50 136873184 -60,-56,-56
So I have done this in both python and bash, and the code I am about to post probably has a world of things wrong with it but it is generally very basic and I cannot see a reason that it would cause this 'bug' which I will explain soon.. I have done the same in Python, but much more professionally and cleanly and it also causes this error (at some point, the maths generates a negative number, which makes no sense.)
#!/bin/bash
while [ 1 ];
do
zero=0
ARRAY=()
ARRAY2=()
first=`command to generate a list of numbers`
sleep 1
second=`command to generate a list of numbers`
# so now we have two data sets, 1 second between the capture of each.
for i in $first;
do
ARRAY+=($i)
done
for i in $second;
do
ARRAY2+=($i)
done
for (( c=$zero; c<=${#ARRAY2[#]}; c++ ))
do
expr ${ARRAY2[$c]} - ${ARRAY[$c]}
done
ARRAY=()
ARRAY2=()
zero=0
c=0
first=``
second=``
math=''
done
So the script grabs a set of data, waits 1 second, grabs it again, does math on the two sets to get the difference, that difference is printed. It's very simple, and I have done it elegantly in Python too - no matter how I would do it every now and then, could be anywhere from 3 loops in to 30 loops in, we will get negative numbers.. like so:
START 0 0 0 0 0 19 10 563 0
-34 19 14 2 0
-1302 1198
-532 639
-1078 1119 1 0 0
-843 33 880 0 5
-8
-13508 8773 4541 988 181
-12
-205 217
-9 7 1
-360 303 60 1 0 0
-12
-96 98 3
-870 904
-130
-2105 2264 6
-3084 1576 1650
-939 971
-2249 1150 1281
-693 9 513 142 76 expr: syntax error
Please help, I simply can't find anything about this.
Sample OUTPUT as requested:
ARRAY1 OUTPUT
1 15 1 25 25 1 2 1 3541 853 94567 42 5 1 351 51 1 11 1 13 7 14 12 3999 983 5 1938 3 8287 40 1 1 1 5253 706 1 1 1 1 5717 3 50 1 85 100376 17334 4655 1 1345 2 1 16 1777 1 3 38 23 8 32 47 781 947 1 1 206 9 1 3 2 81 2602 7 158 1 1 43 91 1 120 6589 6 2534 1092 1 6014 7 2 2 37 1 1 1 80 2 1 1270 15448 66 1 10238 1 10794 16061 4 1 1 1 9754 5617 1123 926 3 24 10 16
ARRAY2 OUTPUT
1 15 1 25 25 1 2 1 3555 859 95043 42 5 1 355 55 1 11 1 13 7 14 12 4015 987 5 1938 3 8335 40 1 1 1 5280 706 1 1 1 1 5733 3 50 1 85 100877 17396 4691 1 1353 2 1 16 1782 1 3 38 23 8 32 47 787 947 1 1 206 9 1 3 2 81 2602 7 159 1 1 43 91 1 120 6869 6 2534 1092 1 6044 7 2 2 37 1 1 1 80 2 1 1270 15563 66 1 10293 1 10804 16134 4 1 1 1 9755 5633 1135 928 3 24 10 16
START
The answer lies in Russell Uhl's comment above. Your loop runs one time to many(this is your code):
for (( c=$zero; c<=${#ARRAY2[#]}; c++ ))
do
expr ${ARRAY2[$c]} - ${ARRAY[$c]}
done
To fix, you need to change the test condition from c <= ${#ARRAY2[#]} to c < ${#ARRAY2[#]}:
for (( c=$zero; c < ${#ARRAY2[#]}; c++ ))
do
echo $((${ARRAY2[$c]} - ${ARRAY[$c]}))
done
I've also changed the expr to use arithmetic evaluation builtin $((...)).
The test script (sum.sh):
#!/bin/bash
zero=0
ARRAY=()
ARRAY2=()
first="1 15 1 25 25 1 2 1 3541 853 94567 42 5 1 351 51 1 11 1 13 7 14 12 3999 983 5 1938 3 8287 40 1 1 1 5253 706 1 1 1 1 5717 3 50 1 85 100376 17334 4655 1 1345 2 1 16 1777 1 3 38 23 8 32 47 7
second="1 15 1 25 25 1 2 1 3555 859 95043 42 5 1 355 55 1 11 1 13 7 14 12 4015 987 5 1938 3 8335 40 1 1 1 5280 706 1 1 1 1 5733 3 50 1 85 100877 17396 4691 1 1353 2 1 16 1782 1 3 38 23 8 32 47
for i in $first; do
ARRAY+=($i)
done
# Alternately as chepner suggested:
ARRAY2=($second)
for (( c=$zero; c < ${#ARRAY2[#]}; c++ )); do
echo -n $((${ARRAY2[$c]} - ${ARRAY[$c]})) " "
done
Running it:
samveen#precise:/tmp$ echo $BASH_VERSION
4.2.25(1)-release
samveen#precise:/tmp$ bash sum.sh
0 0 0 0 0 0 0 0 14 6 476 0 0 0 4 4 0 0 0 0 0 0 0 16 4 0 0 0 48 0 0 0 0 27 0 0 0 0 0 16 0 0 0 0 501 62 36 0 8 0 0 0 5 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 280 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 115 0 0 55 0 10 73 0 0 0 0 1 16 12 2 0 0 0 0
EDIT:
* Added improvements from suggestions in comments.
I think the problem has to be when the two arrays don't have the same size. It's easy to reproduce that syntax error -- one of the operands for the minus operator is an empty string:
$ a=5; b=3; expr $a - $b
2
$ a=""; b=3; expr $a - $b
expr: syntax error
$ a=5; b=""; expr $a - $b
expr: syntax error
$ a=""; b=""; expr $a - $b
-
Try
ARRAY=( $(command to generate a list of numbers) )
sleep 1
ARRAY2=( $(command to generate a list of numbers) )
if (( ${#ARRAY[#]} != ${#ARRAY2[#]} )); then
echo "error: different size arrays!"
echo "ARRAY: ${#ARRAY[#]} (${ARRAY[*]})"
echo "ARRAY2: ${#ARRAY2[#]} (${ARRAY2[*]})"
fi
"The error occurs whenever the first array is smaller than the second" -- of course. You're looping from 0 to the array size of ARRAY2. When ARRAY has fewer elements, you'll eventually try to access an index that does not exist in the array. When you try to reference an unset variable, bash gives you the empty string.
$ a=(1 2 3)
$ b=(4 5 6 7)
$ i=2; expr ${a[i]} - ${b[i]}
-3
$ i=3; expr ${a[i]} - ${b[i]}
expr: syntax error
I'm not good at English. So I ask for your patience and editing.
I have analysed census data of South Korea. I used 'adaboost' as a analysis method and adaboost was implemented for each cities. Target variable, independent variables, formula, options, the number of observation, etc, everything is same among cities. There is no difference. And I made a macro that implements adaboost for the cities one by one. The macro removes all objects except for itself before it starts to analyse the next city.
And I found that average process speed is getting slower as time goes on. I mean that the average time needed for cities 1-30 was around 10 minutes, but it became 25 minutes for the cities 80-100. So I terminated the R session and re-opened. I re-ran the macro from 80th city, then the average time for cities 80-100 was reduced to 10 minutes.
Why does this happen? How can I solve this problem? I need your help. Thanks in advance.
The r code and macro are as below. 'sgg' macro variable indicates city codes. Target variable has six categories. So I used 'one-others' method for multi-class classification.
memory.limit(size=4095)
library(gbm)
library(gtools)
dbset<-strmacro(sgg,sampnum,
expr=
{
setwd("C:\\Users\\Kim\\Desktop\\JQ\\");
db.sgg<-read.table('sgg.TXT', header=TRUE);
db.sgg<-subset(db.sgg, AGE>=10)
N<-nrow(db.sgg);
if(N>=sampnum)
{
db.sgg<-db.sgg[sample(1:N, sampnum),]
};
db.sgg$SEX<-factor(letters[db.sgg$SEX])
ordered(db.sgg$AREA);
db.sgg$josagu_attri_mod2<-factor(letters[db.sgg$josagu_attri_mod])
db.sgg$geocheo_type_mod2<-factor(letters[db.sgg$geocheo_type_mod])
db.sgg$dandok_type_mod2<-factor(letters[db.sgg$dandok_type_mod])
colnames(db.sgg)[10:15]<-c('FLC3.1','FLC3.3','FLC3.4','FLC3.5','FLC3.6','FLC3.7');
}
);
train<-strmacro(i, sgg,
expr={
res.sgg.i<-gbm(FLC3.i~SEX+AREA+AGE+josagu_attri_mod2+geocheo_type_mod2+dandok_type_mod2,
data=db.sgg, distribution='adaboost', n.trees=3000,shrinkage = 0.005,
cv.folds=5, keep.data=TRUE,
bag.fraction=0.7, interaction.depth=3);
BI.sgg.i<-gbm.perf(res.sgg.i, method='cv');
PRED.sgg.i<-predict.gbm(res.sgg.i, db.sgg, BI.sgg.i);
}
);
clean<-strmacro(sgg,
expr={
rm(BI.sgg.1);rm(BI.sgg.3);rm(BI.sgg.4);rm(BI.sgg.5);rm(BI.sgg.6);rm(BI.sgg.7);
rm(res.sgg.1);rm(res.sgg.3);rm(res.sgg.4);rm(res.sgg.5);rm(res.sgg.6);rm(res.sgg.7);
rm(PRED.sgg.1);rm(PRED.sgg.3);rm(PRED.sgg.4);rm(PRED.sgg.5);rm(PRED.sgg.6);rm(PRED.sgg.7);
rm(db.sgg);
}
);
all<-strmacro(sgg,num,
expr={
dbset(sgg,num);
train(1,sgg);train(3,sgg);train(4,sgg);train(5,sgg);train(6,sgg);train(7,sgg);
clean(sgg);
}
);
all(11010,3000)
all(11020,3000)
all(11030,3000)
Data is as below. This data is stored in '11010.txt'.
C3 mem_num josagu_attri_mod SEX AGE geocheo_type_mod dandok_type_mod C97 FLC3 FLC3_1 FLC3_3 FLC3_4 FLC_4 FLC3_6 FLC3_7 AREA
1 3 3 1 14 1 1 49 3 0 0 1 0 0 0 2
1 1 1 2 44 1 1 49 3 0 0 1 0 0 0 2
2 1 1 1 67 1 1 46 6 0 0 0 0 0 1 2
2 2 2 2 60 1 1 46 6 0 0 0 0 0 1 2
3 1 1 2 65 1 1 49 6 0 0 0 0 0 1 2
4 1 1 1 66 1 4 16 6 0 0 0 0 0 1 1
4 2 2 2 61 1 4 16 6 0 0 0 0 0 1 1
5 1 1 2 32 1 6 15 1 1 0 0 0 0 0 1
7 2 2 1 55 1 6 59 5 0 0 0 0 1 0 2
7 4 3 1 23 1 6 59 5 0 0 0 0 1 0 2
7 1 1 2 50 1 6 59 5 0 0 0 0 1 0 2
7 3 3 2 24 1 6 59 5 0 0 0 0 1 0 2
8 1 1 1 68 1 1 46 6 0 0 0 0 0 1 2
8 2 2 2 64 1 1 46 6 0 0 0 0 0 1 2
9 1 1 1 57 1 1 59 5 0 0 0 0 1 0 2
9 2 2 2 55 1 1 59 5 0 0 0 0 1 0 2
9 3 3 2 28 1 1 59 5 0 0 0 0 1 0 2
10 2 3 1 17 1 6 16 4 0 0 0 1 0 0 1
10 1 1 2 41 1 6 16 4 0 0 0 1 0 0 1
12 1 1 2 24 1 6 16 1 1 0 0 0 0 0 1
14 1 1 1 72 2 1 119 6 0 0 0 0 0 1 4
14 2 2 2 72 2 1 119 6 0 0 0 0 0 1 4
17 2 2 1 42 1 4 50 3 0 0 1 0 0 0 2
17 1 1 2 41 1 4 50 3 0 0 1 0 0 0 2
19 1 1 1 36 1 4 50 2 0 1 0 0 0 0 2
19 2 2 2 27 1 4 50 2 0 1 0 0 0 0 2
20 2 2 1 52 1 1 50 5 0 0 0 0 1 0 2
20 3 3 1 21 1 1 50 5 0 0 0 0 1 0 2
20 4 3 1 24 1 1 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101 6 0 0 0 0 0 1 4
70 2 2 2 56 2 1 101 6 0 0 0 0 0 1 4
71 1 1 1 37 2 2 101 2 0 1 0 0 0 0 4
71 2 2 2 37 2 2 101 2 0 1 0 0 0 0 4
72 1 1 1 74 1 1 91 5 0 0 0 0 1 0 3
72 3 3 1 41 1 1 91 5 0 0 0 0 1 0 3
72 2 2 2 71 1 1 91 5 0 0 0 0 1 0 3
73 1 1 1 60 1 1 91 5 0 0 0 0 1 0 3
73 3 3 1 27 1 1 91 5 0 0 0 0 1 0 3
73 2 2 2 57 1 1 91 5 0 0 0 0 1 0 3
74 1 1 1 61 2 1 119 5 0 0 0 0 1 0 4
74 4 3 1 30 2 1 119 5 0 0 0 0 1 0 4
74 2 2 2 56 2 1 119 5 0 0 0 0 1 0 4
74 3 3 2 32 2 1 119 5 0 0 0 0 1 0 4
75 2 2 1 72 1 1 99 6 0 0 0 0 0 1 3
75 1 1 2 71 1 1 99 6 0 0 0 0 0 1 3
78 1 1 2 28 1 4 15 1 1 0 0 0 0 0 1
80 1 1 1 68 1 1 92 6 0 0 0 0 0 1 3
80 2 2 2 66 1 1 92 6 0 0 0 0 0 1 3
81 2 3 1 27 1 6 46 5 0 0 0 0 1 0 2
81 3 3 1 29 1 6 46 5 0 0 0 0 1 0 2
81 1 1 2 57 1 6 46 5 0 0 0 0 1 0 2
83 1 1 1 30 1 4 43 2 0 1 0 0 0 0 2
83 2 2 2 30 1 4 43 2 0 1 0 0 0 0 2
84 1 1 2 64 1 4 33 6 0 0 0 0 0 1 2
85 1 1 1 35 1 6 26 2 0 1 0 0 0 0 1
85 2 2 2 33 1 6 26 2 0 1 0 0 0 0 1
88 1 1 1 52 2 1 145 5 0 0 0 0 1 0 5
88 2 2 2 49 2 1 145 5 0 0 0 0 1 0 5
88 3 3 2 25 2 1 145 5 0 0 0 0 1 0 5
89 2 3 1 13 2 1 145 4 0 0 0 1 0 0 5
89 3 3 1 22 2 1 145 4 0 0 0 1 0 0 5
89 1 1 2 47 2 1 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33 1 1 0 0 0 0 0 2
101 2 2 2 32 4 4 33 1 1 0 0 0 0 0 2
103 1 1 1 39 1 6 27 4 0 0 0 1 0 0 1
103 2 2 2 34 1 6 27 4 0 0 0 1 0 0 1
103 3 3 2 13 1 6 27 4 0 0 0 1 0 0 1
105 2 3 1 19 1 6 27 5 0 0 0 0 1 0 1
105 3 3 1 25 1 6 27 5 0 0 0 0 1 0 1
105 1 1 2 49 1 6 27 5 0 0 0 0 1 0 1
106 1 1 1 28 1 6 23 1 1 0 0 0 0 0 1
107 1 1 1 49 2 1 78 5 0 0 0 0 1 0 3
107 3 3 1 18 2 1 78 5 0 0 0 0 1 0 3
107 4 3 1 21 2 1 78 5 0 0 0 0 1 0 3
107 2 2 2 49 2 1 78 5 0 0 0 0 1 0 3
108 1 1 1 33 2 4 78 1 1 0 0 0 0 0 3
108 2 2 2 28 2 4 78 1 1 0 0 0 0 0 3
109 1 1 1 55 2 1 78 5 0 0 0 0 1 0 3
109 3 3 1 21 2 1 78 5 0 0 0 0 1 0 3
109 2 2 2 53 2 1 78 5 0 0 0 0 1 0 3
110 1 1 1 48 2 1 78 4 0 0 0 1 0 0 3
110 2 2 2 45 2 1 78 4 0 0 0 1 0 0 3
110 3 3 2 20 2 1 78 4 0 0 0 1 0 0 3
110 4 3 2 15 2 1 78 4 0 0 0 1 0 0 3
111 1 1 1 37 2 4 78 2 0 1 0 0 0 0 3
111 2 2 2 34 2 4 78 2 0 1 0 0 0 0 3
112 1 1 1 28 4 4 82 2 0 1 0 0 0 0 3
112 2 2 2 30 4 4 82 2 0 1 0 0 0 0 3
113 1 1 1 64 4 1 63 5 0 0 0 0 1 0 2
113 3 3 1 26 4 1 63 5 0 0 0 0 1 0 2
113 2 2 2 55 4 1 63 5 0 0 0 0 1 0 2
113 4 3 2 24 4 1 63 5 0 0 0 0 1 0 2
115 1 1 1 42 4 4 58 3 0 0 1 0 0 0 2
115 4 3 1 10 4 4 58 3 0 0 1 0 0 0 2
115 2 2 2 39 4 4 58 3 0 0 1 0 0 0 2
115 3 3 2 12 4 4 58 3 0 0 1 0 0 0 2
116 1 1 1 56 4 1 63 5 0 0 0 0 1 0 2
116 3 3 1 29 4 1 63 5 0 0 0 0 1 0 2
116 2 2 2 51 4 1 63 5 0 0 0 0 1 0 2
118 1 1 1 75 4 1 70 6 0 0 0 0 0 1 3
118 2 2 2 74 4 1 70 6 0 0 0 0 0 1 3
119 1 1 1 49 1 4 66 4 0 0 0 1 0 0 2
119 3 3 1 18 1 4 66 4 0 0 0 1 0 0 2
119 4 3 1 17 1 4 66 4 0 0 0 1 0 0 2
119 2 2 2 47 1 4 66 4 0 0 0 1 0 0 2
120 2 3 1 32 4 1 56 5 0 0 0 0 1 0 2
120 1 1 2 64 4 1 56 5 0 0 0 0 1 0 2
120 3 3 2 41 4 1 56 5 0 0 0 0 1 0 2
121 1 1 1 44 4 4 56 4 0 0 0 1 0 0 2
121 3 3 1 17 4 4 56 4 0 0 0 1 0 0 2
121 4 3 1 16 4 4 56 4 0 0 0 1 0 0 2
121 2 2 2 42 4 4 56 4 0 0 0 1 0 0 2
123 1 1 1 44 4 4 56 3 0 0 1 0 0 0 2
123 2 2 2 43 4 4 56 3 0 0 1 0 0 0 2
123 3 3 2 11 4 4 56 3 0 0 1 0 0 0 2
123 5 3 2 14 4 4 56 3 0 0 1 0 0 0 2
125 2 3 1 21 1 4 30 5 0 0 0 0 1 0 1
125 1 1 2 48 1 4 30 5 0 0 0 0 1 0 1
126 1 1 1 49 1 4 30 5 0 0 0 0 1 0 1
126 2 2 2 44 1 4 30 5 0 0 0 0 1 0 1
126 3 3 2 25 1 4 30 5 0 0 0 0 1 0 1
127 1 1 1 75 1 6 25 6 0 0 0 0 0 1 1
128 1 1 1 49 2 1 82 3 0 0 1 0 0 0 3
128 3 3 1 12 2 1 82 3 0 0 1 0 0 0 3
128 2 2 2 43 2 1 82 3 0 0 1 0 0 0 3
129 1 1 2 66 2 1 82 6 0 0 0 0 0 1 3
130 1 1 1 36 2 4 82 3 0 0 1 0 0 0 3
130 2 2 2 41 2 4 82 3 0 0 1 0 0 0 3
130 3 3 2 11 2 4 82 3 0 0 1 0 0 0 3
132 1 1 2 64 2 1 82 6 0 0 0 0 0 1 3
133 1 1 1 34 2 1 82 2 0 1 0 0 0 0 3
133 2 2 2 35 2 1 82 2 0 1 0 0 0 0 3
134 1 1 1 37 2 4 82 2 0 1 0 0 0 0 3
134 2 2 2 35 2 4 82 2 0 1 0 0 0 0 3
135 1 1 1 38 2 4 82 2 0 1 0 0 0 0 3
135 2 2 2 37 2 4 82 2 0 1 0 0 0 0 3
136 1 1 1 31 2 6 83 1 1 0 0 0 0 0 3
136 2 2 2 29 2 6 83 1 1 0 0 0 0 0 3
137 2 2 1 47 2 5 30 3 0 0 1 0 0 0 1
137 3 3 1 19 2 5 30 3 0 0 1 0 0 0 1
137 1 1 2 43 2 5 30 3 0 0 1 0 0 0 1
137 4 3 2 10 2 5 30 3 0 0 1 0 0 0 1
138 2 3 1 24 2 5 30 5 0 0 0 0 1 0 1
138 1 1 2 54 2 5 30 5 0 0 0 0 1 0 1
139 1 1 2 44 2 5 30 4 0 0 0 1 0 0 1
139 2 3 2 13 2 5 30 4 0 0 0 1 0 0 1
139 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
140 1 1 2 55 2 5 30 5 0 0 0 0 1 0 1
140 2 3 2 29 2 5 30 5 0 0 0 0 1 0 1
141 1 1 1 45 2 5 30 4 0 0 0 1 0 0 1
141 2 2 2 43 2 5 30 4 0 0 0 1 0 0 1
141 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
141 4 3 2 13 2 5 30 4 0 0 0 1 0 0 1
142 1 1 2 52 2 5 30 4 0 0 0 1 0 0 1
142 2 3 2 23 2 5 30 4 0 0 0 1 0 0 1
142 3 3 2 18 2 5 30 4 0 0 0 1 0 0 1
144 1 1 1 52 2 5 30 5 0 0 0 0 1 0 1
144 4 3 1 19 2 5 30 5 0 0 0 0 1 0 1
144 2 2 2 48 2 5 30 5 0 0 0 0 1 0 1
144 3 3 2 22 2 5 30 5 0 0 0 0 1 0 1
145 1 1 1 61 2 4 72 6 0 0 0 0 0 1 3
145 2 2 2 55 2 4 72 6 0 0 0 0 0 1 3
147 1 1 1 32 2 4 85 1 1 0 0 0 0 0 3
147 2 2 2 33 2 4 85 1 1 0 0 0 0 0 3
148 1 1 1 30 2 1 85 1 1 0 0 0 0 0 3
148 2 2 2 35 2 1 85 1 1 0 0 0 0 0 3
149 2 2 1 54 1 1 46 4 0 0 0 1 0 0 2
149 1 1 2 51 1 1 46 4 0 0 0 1 0 0 2
149 3 3 2 20 1 1 46 4 0 0 0 1 0 0 2
149 4 3 2 13 1 1 46 4 0 0 0 1 0 0 2
149 5 3 2 27 1 1 46 4 0 0 0 1 0 0 2
152 1 1 1 72 1 1 99 5 0 0 0 0 1 0 3
152 3 3 1 39 1 1 99 5 0 0 0 0 1 0 3
152 2 2 2 69 1 1 99 5 0 0 0 0 1 0 3
153 1 1 1 28 1 6 49 2 0 1 0 0 0 0 2
153 2 2 2 27 1 6 49 2 0 1 0 0 0 0 2
155 1 1 2 54 1 6 27 5 0 0 0 0 1 0 1
155 2 3 2 29 1 6 27 5 0 0 0 0 1 0 1
156 1 1 1 48 1 1 76 3 0 0 1 0 0 0 3
156 3 3 1 17 1 1 76 3 0 0 1 0 0 0 3
156 2 2 2 43 1 1 76 3 0 0 1 0 0 0 3
158 1 1 1 52 1 4 50 5 0 0 0 0 1 0 2
158 3 3 1 23 1 4 50 5 0 0 0 0 1 0 2
158 2 2 2 47 1 4 50 5 0 0 0 0 1 0 2
158 4 3 2 20 1 4 50 5 0 0 0 0 1 0 2
159 1 1 1 54 1 6 40 5 0 0 0 0 1 0 2
159 3 3 1 30 1 6 40 5 0 0 0 0 1 0 2
159 2 2 2 51 1 6 40 5 0 0 0 0 1 0 2
159 4 3 2 28 1 6 40 5 0 0 0 0 1 0 2
160 1 1 1 35 1 4 36 2 0 1 0 0 0 0 2
160 2 2 2 34 1 4 36 2 0 1 0 0 0 0 2
162 1 1 1 74 1 1 76 6 0 0 0 0 0 1 3
162 2 2 2 74 1 1 76 6 0 0 0 0 0 1 3
163 3 3 1 16 1 4 40 4 0 0 0 1 0 0 2
163 1 1 2 44 1 4 40 4 0 0 0 1 0 0 2
163 2 3 2 20 1 4 40 4 0 0 0 1 0 0 2
165 1 1 1 72 2 1 114 6 0 0 0 0 0 1 4
165 2 2 2 69 2 1 114 6 0 0 0 0 0 1 4
166 1 1 1 59 2 4 114 5 0 0 0 0 1 0 4
166 3 3 1 26 2 4 114 5 0 0 0 0 1 0 4
166 2 2 2 54 2 4 114 5 0 0 0 0 1 0 4
166 4 3 2 28 2 4 114 5 0 0 0 0 1 0 4
168 1 1 1 55 2 1 114 5 0 0 0 0 1 0 4
168 3 3 1 28 2 1 114 5 0 0 0 0 1 0 4
168 2 2 2 49 2 1 114 5 0 0 0 0 1 0 4
168 4 3 2 26 2 1 114 5 0 0 0 0 1 0 4
171 1 1 1 57 2 1 114 5 0 0 0 0 1 0 4
171 3 3 1 26 2 1 114 5 0 0 0 0 1 0 4
171 2 2 2 50 2 1 114 5 0 0 0 0 1 0 4
172 1 1 1 58 2 1 114 5 0 0 0 0 1 0 4
172 3 3 1 22 2 1 114 5 0 0 0 0 1 0 4
172 4 3 1 25 2 1 114 5 0 0 0 0 1 0 4
172 2 2 2 53 2 1 114 5 0 0 0 0 1 0 4
172 5 3 2 27 2 1 114 5 0 0 0 0 1 0 4
173 1 1 1 45 3 4 59 3 0 0 1 0 0 0 2
173 3 3 1 12 3 4 59 3 0 0 1 0 0 0 2
173 2 2 2 33 3 4 59 3 0 0 1 0 0 0 2
174 1 1 2 80 3 1 59 6 0 0 0 0 0 1 2
175 1 1 1 71 3 1 59 5 0 0 0 0 1 0 2
175 2 2 2 67 3 1 59 5 0 0 0 0 1 0 2
175 3 3 2 28 3 1 59 5 0 0 0 0 1 0 2
176 1 1 1 55 3 1 59 4 0 0 0 1 0 0 2
176 3 3 1 25 3 1 59 4 0 0 0 1 0 0 2
176 2 2 2 50 3 1 59 4 0 0 0 1 0 0 2
176 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
178 2 2 1 60 3 1 59 5 0 0 0 0 1 0 2
178 3 3 1 26 3 1 59 5 0 0 0 0 1 0 2
178 4 3 1 23 3 1 59 5 0 0 0 0 1 0 2
178 1 1 2 50 3 1 59 5 0 0 0 0 1 0 2
179 1 1 1 52 3 1 59 4 0 0 0 1 0 0 2
179 3 3 1 18 3 1 59 4 0 0 0 1 0 0 2
179 2 2 2 43 3 1 59 4 0 0 0 1 0 0 2
179 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
180 1 1 1 60 3 1 59 5 0 0 0 0 1 0 2
180 3 3 1 27 3 1 59 5 0 0 0 0 1 0 2
180 2 2 2 60 3 1 59 5 0 0 0 0 1 0 2
182 1 1 2 47 4 1 53 3 0 0 1 0 0 0 2
182 2 3 2 10 4 1 53 3 0 0 1 0 0 0 2
184 1 1 1 36 4 4 59 2 0 1 0 0 0 0 2
184 2 2 2 38 4 4 59 2 0 1 0 0 0 0 2
185 1 1 1 43 4 1 59 3 0 0 1 0 0 0 2
185 3 3 1 15 4 1 59 3 0 0 1 0 0 0 2
185 4 3 1 11 4 1 59 3 0 0 1 0 0 0 2
185 2 2 2 41 4 1 59 3 0 0 1 0 0 0 2
186 1 1 1 36 4 1 50 2 0 1 0 0 0 0 2
186 2 2 2 32 4 1 50 2 0 1 0 0 0 0 2
186 5 3 2 10 4 1 50 2 0 1 0 0 0 0 2
187 1 1 2 55 4 1 53 5 0 0 0 0 1 0 2
187 2 3 2 25 4 1 53 5 0 0 0 0 1 0 2
187 3 3 2 27 4 1 53 5 0 0 0 0 1 0 2
188 1 1 1 67 4 1 53 6 0 0 0 0 0 1 2
188 2 2 2 64 4 1 53 6 0 0 0 0 0 1 2
189 1 1 1 69 4 1 50 5 0 0 0 0 1 0 2
189 3 3 1 34 4 1 50 5 0 0 0 0 1 0 2
189 2 2 2 57 4 1 50 5 0 0 0 0 1 0 2
190 1 1 1 62 4 1 50 5 0 0 0 0 1 0 2
190 3 3 1 27 4 1 50 5 0 0 0 0 1 0 2
190 2 2 2 55 4 1 50 5 0 0 0 0 1 0 2
191 1 1 1 38 3 1 54 2 0 1 0 0 0 0 2
191 2 2 2 36 3 1 54 2 0 1 0 0 0 0 2
192 1 1 2 69 3 4 54 6 0 0 0 0 0 1 2
193 1 1 1 58 3 4 54 5 0 0 0 0 1 0 2
193 3 3 1 27 3 4 54 5 0 0 0 0 1 0 2
193 4 3 1 24 3 4 54 5 0 0 0 0 1 0 2
193 2 2 2 50 3 4 54 5 0 0 0 0 1 0 2
194 1 1 1 77 3 1 54 6 0 0 0 0 0 1 2
194 2 2 2 77 3 1 54 6 0 0 0 0 0 1 2
196 1 1 1 63 4 1 73 5 0 0 0 0 1 0 3
196 3 3 1 37 4 1 73 5 0 0 0 0 1 0 3
196 4 3 1 33 4 1 73 5 0 0 0 0 1 0 3
196 2 2 2 62 4 1 73 5 0 0 0 0 1 0 3
197 1 1 1 66 4 1 73 6 0 0 0 0 0 1 3
197 2 2 2 59 4 1 73 6 0 0 0 0 0 1 3
198 1 1 1 52 4 1 73 3 0 0 1 0 0 0 3
198 3 3 1 13 4 1 73 3 0 0 1 0 0 0 3
198 2 2 2 47 4 1 73 3 0 0 1 0 0 0 3
198 4 3 2 12 4 1 73 3 0 0 1 0 0 0 3
199 1 1 1 43 4 4 73 3 0 0 1 0 0 0 3
199 2 2 2 41 4 4 73 3 0 0 1 0 0 0 3
199 3 3 2 11 4 4 73 3 0 0 1 0 0 0 3
200 2 3 1 26 4 1 73 5 0 0 0 0 1 0 3
200 3 3 1 28 4 1 73 5 0 0 0 0 1 0 3
200 1 1 2 53 4 1 73 5 0 0 0 0 1 0 3
201 1 1 1 53 4 1 73 5 0 0 0 0 1 0 3
201 3 3 1 27 4 1 73 5 0 0 0 0 1 0 3
201 2 2 2 50 4 1 73 5 0 0 0 0 1 0 3
202 1 1 1 77 4 1 73 5 0 0 0 0 1 0 3
202 3 3 1 35 4 1 73 5 0 0 0 0 1 0 3
202 2 2 2 60 4 1 73 5 0 0 0 0 1 0 3
204 1 1 1 56 4 1 53 5 0 0 0 0 1 0 2
204 2 2 2 53 4 1 53 5 0 0 0 0 1 0 2
204 3 3 2 22 4 1 53 5 0 0 0 0 1 0 2
205 1 1 1 60 4 4 66 5 0 0 0 0 1 0 2
205 3 3 1 29 4 4 66 5 0 0 0 0 1 0 2
205 4 3 1 27 4 4 66 5 0 0 0 0 1 0 2
205 2 2 2 56 4 4 66 5 0 0 0 0 1 0 2
206 1 1 1 67 4 1 76 6 0 0 0 0 0 1 3
206 2 2 2 67 4 1 76 6 0 0 0 0 0 1 3
208 1 1 1 46 4 1 66 4 0 0 0 1 0 0 2
208 4 3 1 14 4 1 66 4 0 0 0 1 0 0 2
208 2 2 2 45 4 1 66 4 0 0 0 1 0 0 2
208 3 3 2 17 4 1 66 4 0 0 0 1 0 0 2
209 1 1 1 42 4 4 56 2 0 1 0 0 0 0 2
209 3 3 1 10 4 4 56 2 0 1 0 0 0 0 2
209 2 2 2 38 4 4 56 2 0 1 0 0 0 0 2
210 3 3 1 12 4 1 56 3 0 0 1 0 0 0 2
210 1 1 2 40 4 1 56 3 0 0 1 0 0 0 2
210 2 3 2 10 4 1 56 3 0 0 1 0 0 0 2
212 1 1 2 37 1 4 63 2 0 1 0 0 0 0 2
214 1 1 1 63 3 1 40 6 0 0 0 0 0 1 2
215 1 1 1 62 3 1 40 5 0 0 0 0 1 0 2
215 3 3 1 28 3 1 40 5 0 0 0 0 1 0 2
215 2 2 2 57 3 1 40 5 0 0 0 0 1 0 2
216 1 1 2 71 3 1 40 6 0 0 0 0 0 1 2
217 1 1 2 49 4 1 40 5 0 0 0 0 1 0 2
217 2 3 2 24 4 1 40 5 0 0 0 0 1 0 2
218 1 1 1 74 1 1 37 6 0 0 0 0 0 1 2
218 2 2 2 67 1 1 37 6 0 0 0 0 0 1 2
220 1 1 1 51 4 4 66 4 0 0 0 1 0 0 2
220 4 3 1 13 4 4 66 4 0 0 0 1 0 0 2
220 5 3 1 18 4 4 66 4 0 0 0 1 0 0 2
220 2 2 2 49 4 4 66 4 0 0 0 1 0 0 2
220 3 3 2 16 4 4 66 4 0 0 0 1 0 0 2
221 1 1 2 81 1 6 40 6 0 0 0 0 0 1 2
222 1 1 1 45 2 1 85 3 0 0 1 0 0 0 3
222 4 3 1 10 2 1 85 3 0 0 1 0 0 0 3
222 2 2 2 41 2 1 85 3 0 0 1 0 0 0 3
222 3 3 2 15 2 1 85 3 0 0 1 0 0 0 3
223 1 1 2 51 2 1 85 5 0 0 0 0 1 0 3
223 2 3 2 25 2 1 85 5 0 0 0 0 1 0 3
224 2 3 1 12 2 4 85 4 0 0 0 1 0 0 3
224 1 1 2 47 2 4 85 4 0 0 0 1 0 0 3
224 3 3 2 18 2 4 85 4 0 0 0 1 0 0 3
225 1 1 1 68 2 1 85 6 0 0 0 0 0 1 3
225 2 2 2 67 2 1 85 6 0 0 0 0 0 1 3
226 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
226 4 3 1 17 2 1 85 4 0 0 0 1 0 0 3
226 2 2 2 46 2 1 85 4 0 0 0 1 0 0 3
226 3 3 2 19 2 1 85 4 0 0 0 1 0 0 3
229 2 2 1 67 2 1 85 5 0 0 0 0 1 0 3
229 1 1 2 57 2 1 85 5 0 0 0 0 1 0 3
229 3 3 2 37 2 1 85 5 0 0 0 0 1 0 3
232 1 1 1 54 2 1 86 5 0 0 0 0 1 0 3
232 2 2 2 53 2 1 86 5 0 0 0 0 1 0 3
232 3 3 2 29 2 1 86 5 0 0 0 0 1 0 3
233 1 1 1 57 2 1 86 5 0 0 0 0 1 0 3
233 2 2 2 52 2 1 86 5 0 0 0 0 1 0 3
233 3 3 2 24 2 1 86 5 0 0 0 0 1 0 3
235 1 1 2 51 2 1 86 3 0 0 1 0 0 0 3
236 1 1 1 41 2 4 86 2 0 1 0 0 0 0 3
236 5 3 1 12 2 4 86 2 0 1 0 0 0 0 3
236 2 2 2 39 2 4 86 2 0 1 0 0 0 0 3
236 3 3 2 10 2 4 86 2 0 1 0 0 0 0 3
237 1 1 1 48 2 1 86 4 0 0 0 1 0 0 3
237 2 2 2 48 2 1 86 4 0 0 0 1 0 0 3
237 3 3 2 20 2 1 86 4 0 0 0 1 0 0 3
237 4 3 2 16 2 1 86 4 0 0 0 1 0 0 3
238 1 1 2 53 4 1 50 5 0 0 0 0 1 0 2
238 2 3 2 29 4 1 50 5 0 0 0 0 1 0 2
240 2 3 1 31 4 1 50 5 0 0 0 0 1 0 2
240 1 1 2 61 4 1 50 5 0 0 0 0 1 0 2
241 2 3 1 24 4 1 50 5 0 0 0 0 1 0 2
241 1 1 2 51 4 1 50 5 0 0 0 0 1 0 2
242 1 1 1 39 4 6 50 3 0 0 1 0 0 0 2
242 3 3 1 11 4 6 50 3 0 0 1 0 0 0 2
242 2 2 2 38 4 6 50 3 0 0 1 0 0 0 2
245 1 1 1 48 4 1 50 4 0 0 0 1 0 0 2
245 3 3 1 17 4 1 50 4 0 0 0 1 0 0 2
245 2 2 2 42 4 1 50 4 0 0 0 1 0 0 2
246 1 1 1 58 5 4 50 5 0 0 0 0 1 0 2
246 2 2 2 50 5 4 50 5 0 0 0 0 1 0 2
246 3 3 2 26 5 4 50 5 0 0 0 0 1 0 2
247 2 2 1 43 4 1 46 3 0 0 1 0 0 0 2
247 1 1 2 41 4 1 46 3 0 0 1 0 0 0 2
247 3 3 2 11 4 1 46 3 0 0 1 0 0 0 2
248 1 1 1 40 4 1 70 1 1 0 0 0 0 0 3
248 2 2 2 32 4 1 70 1 1 0 0 0 0 0 3
249 1 1 1 43 4 1 64 4 0 0 0 1 0 0 2
249 3 3 1 16 4 1 64 4 0 0 0 1 0 0 2
249 2 2 2 41 4 1 64 4 0 0 0 1 0 0 2
249 4 3 2 15 4 1 64 4 0 0 0 1 0 0 2
250 2 2 1 32 4 1 54 1 1 0 0 0 0 0 2
250 1 1 2 30 4 1 54 1 1 0 0 0 0 0 2
251 1 1 1 65 1 1 132 6 0 0 0 0 0 1 4
251 2 2 2 62 1 1 132 6 0 0 0 0 0 1 4
254 1 1 1 37 2 4 85 2 0 1 0 0 0 0 3
254 2 2 2 37 2 4 85 2 0 1 0 0 0 0 3
256 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
256 2 2 2 47 2 1 85 4 0 0 0 1 0 0 3
256 3 3 2 16 2 1 85 4 0 0 0 1 0 0 3
256 4 3 2 14 2 1 85 4 0 0 0 1 0 0 3
257 1 1 1 46 2 4 85 4 0 0 0 1 0 0 3
257 4 3 1 16 2 4 85 4 0 0 0 1 0 0 3
257 2 2 2 44 2 4 85 4 0 0 0 1 0 0 3
257 3 3 2 19 2 4 85 4 0 0 0 1 0 0 3
259 1 1 1 55 2 1 85 5 0 0 0 0 1 0 3
259 2 2 2 53 2 1 85 5 0 0 0 0 1 0 3
259 3 3 2 31 2 1 85 5 0 0 0 0 1 0 3
261 1 1 1 65 2 1 145 6 0 0 0 0 0 1 5
261 2 2 2 62 2 1 145 6 0 0 0 0 0 1 5
262 1 1 1 44 3 1 56 4 0 0 0 1 0 0 2
262 3 3 1 19 3 1 56 4 0 0 0 1 0 0 2
262 2 2 2 42 3 1 56 4 0 0 0 1 0 0 2
262 4 3 2 15 3 1 56 4 0 0 0 1 0 0 2
263 1 1 1 49 3 1 54 5 0 0 0 0 1 0 2
263 4 3 1 22 3 1 54 5 0 0 0 0 1 0 2
263 2 2 2 47 3 1 54 5 0 0 0 0 1 0 2
263 3 3 2 19 3 1 54 5 0 0 0 0 1 0 2
266 1 1 1 54 3 1 56 5 0 0 0 0 1 0 2
266 3 3 1 29 3 1 56 5 0 0 0 0 1 0 2
266 2 2 2 49 3 1 56 5 0 0 0 0 1 0 2
267 1 1 2 63 3 1 42 6 0 0 0 0 0 1 2
268 1 1 1 45 3 1 43 3 0 0 1 0 0 0 2
268 3 3 1 11 3 1 43 3 0 0 1 0 0 0 2
268 2 2 2 36 3 1 43 3 0 0 1 0 0 0 2
268 5 3 2 12 3 1 43 3 0 0 1 0 0 0 2
269 1 1 1 45 3 1 47 3 0 0 1 0 0 0 2
269 2 2 2 42 3 1 47 3 0 0 1 0 0 0 2
269 3 3 2 11 3 1 47 3 0 0 1 0 0 0 2
270 1 1 1 34 2 4 59 2 0 1 0 0 0 0 2
270 2 2 2 34 2 4 59 2 0 1 0 0 0 0 2
271 2 2 1 60 2 1 59 5 0 0 0 0 1 0 2
271 3 3 1 34 2 1 59 5 0 0 0 0 1 0 2
271 1 1 2 57 2 1 59 5 0 0 0 0 1 0 2
272 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
272 2 2 2 35 2 1 59 2 0 1 0 0 0 0 2
273 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
273 2 2 2 39 2 1 59 2 0 1 0 0 0 0 2
275 1 1 1 33 2 1 59 2 0 1 0 0 0 0 2
275 2 2 2 29 2 1 59 2 0 1 0 0 0 0 2
276 1 1 1 30 2 4 59 1 1 0 0 0 0 0 2
277 1 1 1 47 2 1 59 4 0 0 0 1 0 0 2
277 2 2 2 48 2 1 59 4 0 0 0 1 0 0 2
277 3 3 2 17 2 1 59 4 0 0 0 1 0 0 2
277 4 3 2 15 2 1 59 4 0 0 0 1 0 0 2
278 1 1 1 78 2 1 84 6 0 0 0 0 0 1 3
278 2 2 2 79 2 1 84 6 0 0 0 0 0 1 3
280 1 1 1 56 2 1 84 5 0 0 0 0 1 0 3
280 2 2 2 53 2 1 84 5 0 0 0 0 1 0 3
280 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
281 1 1 1 50 2 1 84 4 0 0 0 1 0 0 3
281 4 3 1 17 2 1 84 4 0 0 0 1 0 0 3
281 2 2 2 45 2 1 84 4 0 0 0 1 0 0 3
281 3 3 2 22 2 1 84 4 0 0 0 1 0 0 3
283 1 1 1 51 2 1 84 5 0 0 0 0 1 0 3
283 4 3 1 25 2 1 84 5 0 0 0 0 1 0 3
283 2 2 2 49 2 1 84 5 0 0 0 0 1 0 3
283 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
285 1 1 1 48 2 1 122 3 0 0 1 0 0 0 4
285 5 3 1 17 2 1 122 3 0 0 1 0 0 0 4
285 2 2 2 41 2 1 122 3 0 0 1 0 0 0 4
285 3 3 2 15 2 1 122 3 0 0 1 0 0 0 4
286 1 1 1 57 2 1 122 5 0 0 0 0 1 0 4
286 4 3 1 25 2 1 122 5 0 0 0 0 1 0 4
286 2 2 2 51 2 1 122 5 0 0 0 0 1 0 4
286 3 3 2 29 2 1 122 5 0 0 0 0 1 0 4
287 1 1 1 43 2 1 122 2 0 1 0 0 0 0 4
287 2 2 2 40 2 1 122 2 0 1 0 0 0 0 4
287 3 3 2 12 2 1 122 2 0 1 0 0 0 0 4
290 1 1 1 46 2 1 102 3 0 0 1 0 0 0 4
290 4 3 1 10 2 1 102 3 0 0 1 0 0 0 4
290 2 2 2 42 2 1 102 3 0 0 1 0 0 0 4
290 3 3 2 15 2 1 102 3 0 0 1 0 0 0 4
291 1 1 1 30 2 4 102 2 0 1 0 0 0 0 4
291 2 2 2 26 2 4 102 2 0 1 0 0 0 0 4
292 1 1 2 61 1 1 59 6 0 0 0 0 0 1 2
295 1 1 1 47 1 4 43 3 0 0 1 0 0 0 2
295 3 3 1 11 1 4 43 3 0 0 1 0 0 0 2
295 2 2 2 43 1 4 43 3 0 0 1 0 0 0 2
297 1 1 1 43 1 4 43 2 0 1 0 0 0 0 2
297 2 2 2 46 1 4 43 2 0 1 0 0 0 0 2
298 1 1 1 40 1 4 56 2 0 1 0 0 0 0 2
298 2 2 2 37 1 4 56 2 0 1 0 0 0 0 2
299 2 3 1 24 1 4 50 5 0 0 0 0 1 0 2
299 1 1 2 60 1 4 50 5 0 0 0 0 1 0 2
300 1 1 1 46 4 4 83 4 0 0 0 1 0 0 3
300 2 2 2 43 4 4 83 4 0 0 0 1 0 0 3
300 3 3 2 13 4 4 83 4 0 0 0 1 0 0 3
My understanding is that R is implemented as copy-on-write.
Take for instance:
X <- 1:1000
y <- x # no copy made. x & y share the reference
y[1] <- 8 # now a copy is made.
If x is growing, the copies take longer and longer, and the script slows down.
I'm not that familiar with macro variables, but I suspect something like this is happening.
If you're working with a list, every time you add a new element to the list, every thing is recopied.
y <- list()
y$this <- 1:5
y$that <- 6:10 # now every thing was recopied.
Therefore it's better to allocate first. It really helps the performance.
y <- vector("list", 2)
y[[1]] <- 1:5
y[[2]] <- 6:10
These slides are really good: a link take a look!