The R Project SVN R

Rev

Rev 84897 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84897 Rev 85145
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2023-08-01 r84816) -- "Unsuffered Consequences"
2
R Under development (unstable) (2023-09-08 r85109) -- "Unsuffered Consequences"
3
Copyright (C) 2023 The R Foundation for Statistical Computing
3
Copyright (C) 2023 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu
4
Platform: aarch64-apple-darwin22.6.0
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
8
Type 'license()' or 'licence()' for distribution details.
8
Type 'license()' or 'licence()' for distribution details.
9
 
9
 
Line 194... Line 194...
194
> ### Keywords: utilities chron
194
> ### Keywords: utilities chron
195
> 
195
> 
196
> ### ** Examples
196
> ### ** Examples
197
> 
197
> 
198
> with(beaver1, {
198
> with(beaver1, {
199
+     opar <- par(mfrow = c(2,1))
199
+     opar <- par(mfrow = c(3,1))
200
+     time <- strptime(paste(1990, day, time %/% 100, time %% 100),
200
+     time <- strptime(paste(1990, day, time %/% 100, time %% 100),
201
+                      "%Y %j %H %M")
201
+                      "%Y %j %H %M")
202
+     plot(time, temp, type = "l") # axis at 5-hour intervals.
202
+     plot(time, temp, type = "l") # axis at 6-hour intervals
-
 
203
+     # request more ticks
-
 
204
+     olab <- par(lab = c(10, 10, 7))
-
 
205
+     plot(time, temp, type = "l")
-
 
206
+     par(olab)
203
+     # now label every hour on the time axis
207
+     # now label every hour on the time axis
204
+     plot(time, temp, type = "l", xaxt = "n")
208
+     plot(time, temp, type = "l", xaxt = "n")
205
+     r <- as.POSIXct(round(range(time), "hours"))
209
+     r <- as.POSIXct(round(range(time), "hours"))
206
+     axis.POSIXct(1, at = seq(r[1], r[2], by = "hour"), format = "%H")
210
+     axis.POSIXct(1, at = seq(r[1], r[2], by = "hour"), format = "%H")
207
+     par(opar) # reset changed par settings
211
+     par(opar) # reset changed par settings
Line 974... Line 978...
974
+                plot.axes = { axis(1); axis(2); points(10, 10) })
978
+                plot.axes = { axis(1); axis(2); points(10, 10) })
975
> 
979
> 
976
> ## Persian Rug Art:
980
> ## Persian Rug Art:
977
> x <- y <- seq(-4*pi, 4*pi, length.out = 27)
981
> x <- y <- seq(-4*pi, 4*pi, length.out = 27)
978
> r <- sqrt(outer(x^2, y^2, `+`))
982
> r <- sqrt(outer(x^2, y^2, `+`))
-
 
983
> ## "minimal"
979
> filled.contour(cos(r^2)*exp(-r/(2*pi)), axes = FALSE)
984
> filled.contour(cos(r^2)*exp(-r/(2*pi)), axes = FALSE, key.border=NA)
980
> ## rather, the key *should* be labeled:
985
> ## rather, the key *should* be labeled (but axes still not):
981
> filled.contour(cos(r^2)*exp(-r/(2*pi)), frame.plot = FALSE,
986
> filled.contour(cos(r^2)*exp(-r/(2*pi)), frame.plot = FALSE,
982
+                plot.axes = {})
987
+                plot.axes = {})
983
> 
988
> 
984
> 
989
> 
985
> 
990
> 
Line 2286... Line 2291...
2286
> ### ** Examples
2291
> ### ** Examples
2287
> 
2292
> 
2288
> points.default # to see how it calls "plot.xy(xy.coords(x, y), ...)"
2293
> points.default # to see how it calls "plot.xy(xy.coords(x, y), ...)"
2289
function (x, y = NULL, type = "p", ...) 
2294
function (x, y = NULL, type = "p", ...) 
2290
plot.xy(xy.coords(x, y), type = type, ...)
2295
plot.xy(xy.coords(x, y), type = type, ...)
2291
<bytecode: 0x0000019cccf29bf8>
2296
<bytecode: 0x148a28c60>
2292
<environment: namespace:graphics>
2297
<environment: namespace:graphics>
2293
> 
2298
> 
2294
> 
2299
> 
2295
> 
2300
> 
2296
> cleanEx()
2301
> cleanEx()
Line 3156... Line 3161...
3156
    if (warn.log && (par("xlog") || par("ylog"))) 
3161
    if (warn.log && (par("xlog") || par("ylog"))) 
3157
        warning("log scale:  xyinch() is nonsense")
3162
        warning("log scale:  xyinch() is nonsense")
3158
    u <- par("usr")
3163
    u <- par("usr")
3159
    xy * c(u[2L] - u[1L], u[4L] - u[3L])/par("pin")
3164
    xy * c(u[2L] - u[1L], u[4L] - u[3L])/par("pin")
3160
}
3165
}
3161
<bytecode: 0x0000019ccc7ed9a0>
3166
<bytecode: 0x1484fa978>
3162
<environment: namespace:graphics>
3167
<environment: namespace:graphics>
3163
> 
3168
> 
3164
> ## plot labels offset 0.12 inches to the right
3169
> ## plot labels offset 0.12 inches to the right
3165
> ## of plotted symbols in a plot
3170
> ## of plotted symbols in a plot
3166
> with(mtcars, {
3171
> with(mtcars, {
Line 3237... Line 3242...
3237
> ### * <FOOTER>
3242
> ### * <FOOTER>
3238
> ###
3243
> ###
3239
> cleanEx()
3244
> cleanEx()
3240
> options(digits = 7L)
3245
> options(digits = 7L)
3241
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
3246
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
3242
Time elapsed:  3.054 0.221 3.303 0 0 
3247
Time elapsed:  1.594 0.099 1.697 0 0 
3243
> grDevices::dev.off()
3248
> grDevices::dev.off()
3244
null device 
3249
null device 
3245
          1 
3250
          1 
3246
> ###
3251
> ###
3247
> ### Local variables: ***
3252
> ### Local variables: ***