If you look at the help pages ?png and ?svg , you will see that the default file names are "Rplot%03d.png" and "Rplot%03d.svg" respectively. Part of these names %03d means that every time a new chart is created, it automatically opens a new file, and part of the file name will be replaced by an incremental integer. Thus, the first file will be "Rplot001.png", and the next will be "Rplot002.png", etc.
If you donβt like the default file name, you can create your own and still insert the part to be replaced with an integer, for example, "myplots%02d.png" . % says that the number number starts here, 0 is optional, but says that 0 fill in the numbers (so you get 01, 02, ... rather than 1, 2, ...), this is usually preferable, so the sorting is done correctly (otherwise you can see the sorting as 1,10,11,2,3, ...), and the digit (3 by default, 2 in my example) is the number of digits if you create more 1000 plots, you must increase this to 4, if you know that you will not create 100, then 2 are fine (1 fine if you know that you will produce less than 10). And d is just an integer indicator.
source share