R
Z technicznego punktu widzenia nie jest to błąd, ale ostrzeżenie, ale mimo to jest niedorzeczne i występuje z całkowicie ezoterycznych powodów.
[[EDYCJA]] Wydaje się, że przyczyną niektórych fragmentów śmiesznych ostrzeżeń jest RStudio, a nie R per se, więc jest to mniej interesujące, niż początkowo myślałem. Pierwszy przykład, to plot(1:2, NotAGraphicalParameter = "ignore.me")
jest jednak nadal powtarzalny w „nagim” R i sam w sobie jest dość zabawny. [[/ EDIT]]
> plot(1:2, NotAGraphicalParameter = "ignore.me")
# produces a nice scatterplot with two points, [1,1] and [2,2]
Warning messages:
1: In plot.window(...) :
"NotAGraphicalParameter" is not a graphical parameter
2: In plot.xy(xy, type, ...) :
"NotAGraphicalParameter" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
"NotAGraphicalParameter" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
"NotAGraphicalParameter" is not a graphical parameter
5: In box(...) : "NotAGraphicalParameter" is not a graphical parameter
6: In title(...) : "NotAGraphicalParameter" is not a graphical parameter
> plot(2:3)
# another nice scatterplot: [2,2] and [3,3]
# but there should be nothing wrong this time!
# however ...
There were 12 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: "NotAGraphicalParameter" is not a graphical parameter
2: "NotAGraphicalParameter" is not a graphical parameter
3: "NotAGraphicalParameter" is not a graphical parameter
4: "NotAGraphicalParameter" is not a graphical parameter
5: "NotAGraphicalParameter" is not a graphical parameter
6: "NotAGraphicalParameter" is not a graphical parameter
7: "NotAGraphicalParameter" is not a graphical parameter
8: "NotAGraphicalParameter" is not a graphical parameter
9: "NotAGraphicalParameter" is not a graphical parameter
10: "NotAGraphicalParameter" is not a graphical parameter
11: "NotAGraphicalParameter" is not a graphical parameter
12: "NotAGraphicalParameter" is not a graphical parameter
# but let's try once more:
> plot(2:3)
# yup. no warnings this time. we had to do it twice
To tak, jakby R pamięta nasze obelgi. Ale nie na długo.
Naprawdę nie potrafię wyjaśnić, dlaczego tak się dzieje - ale jest to powtarzalne. W rzeczywistości występuje to za każdym razem, gdy podasz jakiś „nie graficzny parametr” do wydruku 1, a następnie wydrukujesz wykres 2 w całkowicie nienaganny sposób. Szczególnie zabawne jest to, że otrzymujemy 12 ostrzeżeń „nie graficznych” dla drugiego wątku, ale tylko 6 dla pierwszego. Kolejną zabawną rzeczą jest to, że jeśli podasz „nie parametr graficzny” o wartości NULL, wówczas nie zostanie zgłoszony żaden warunek:
plot(1:2, Nonsense=NULL)
# no warnings
# however
plot(1:2, Nonsense="gibberish")
# gives the usual 6-pack of warnings
Aby stać się jeszcze bardziej absurdalnym, narysujmy kilka linii na uprzednio narysowanej fabule:
plot(1:2)
# you will see the number of warnings growing with each line:
lines(1:2, 1:2, mumbo = 1)
lines(1:2, 1:2, jumbo = 2)
lines(1:2, 1:2, bimbo = 3)
lines(1:2, 1:2, cucaracha = 4)
lines(1:2, 1:2, karaoke = 5)
lines(1:2, 1:2, radiogaga = 6)
lines(1:2, 1:2, reptiles = 7)
lines(1:2, 1:2, cowsonmoon = 8)
lines(1:2, 1:2, stainlessSteelLadderToTheMoon = 9)
lines(1:2, 1:2, frambuesa = 10)
lines(1:2, 1:2, fresa = 11)
lines(1:2, 1:2, limonYNada = 12)
lines(1:2, 1:2, slingsAndArrows = 13)
# ... and now you have 25 warnings:
warnings()
Warning messages:
1: "mumbo" is not a graphical parameter
2: "jumbo" is not a graphical parameter
3: "bimbo" is not a graphical parameter
4: "cucaracha" is not a graphical parameter
5: "karaoke" is not a graphical parameter
6: "radiogaga" is not a graphical parameter
7: "reptiles" is not a graphical parameter
8: "cowsonmoon" is not a graphical parameter
9: "stainlessSteelLadderToTheMoon" is not a graphical parameter
10: "frambuesa" is not a graphical parameter
11: "fresa" is not a graphical parameter
12: "limonYNada" is not a graphical parameter
13: "mumbo" is not a graphical parameter
14: "jumbo" is not a graphical parameter
15: "bimbo" is not a graphical parameter
16: "cucaracha" is not a graphical parameter
17: "karaoke" is not a graphical parameter
18: "radiogaga" is not a graphical parameter
19: "reptiles" is not a graphical parameter
20: "cowsonmoon" is not a graphical parameter
21: "stainlessSteelLadderToTheMoon" is not a graphical parameter
22: "frambuesa" is not a graphical parameter
23: "fresa" is not a graphical parameter
24: "limonYNada" is not a graphical parameter
25: In plot.xy(xy.coords(x, y), type = type, ...) :
"slingsAndArrows" is not a graphical parameter
To powinno nie wygraj dużo czasu, chyba że nie ma sprawiedliwości.
import sys; sys.setrecursionlimit(~-2**31); x=lambda x:x(x); x(x);