ID EN
Math Functions

round.POSIXt

R Base 3.6.2 🇮🇩 Bahasa Indonesia

Membulatkan atau memotong objek tanggal-waktu.

Syntax

R
# S3 method for POSIXt
round(x,
      units = c("secs", "mins", "hours", "days", "months", "years"))
# S3 method for POSIXt
trunc(x,
      units = c("secs", "mins", "hours", "days", "months", "years"),
      &#8230;)<p></p><p># S3 method for Date
round(x, &#8230;)
# S3 method for Date
trunc(x, &#8230;)</p>

Arguments

Parameter Deskripsi
x an object inheriting from "POSIXt" or "Date".
units one of the units listed. Can be abbreviated.
&#8230; arguments to be passed to or from other methods, notably digits for round.

Return Value

Objek kelas "POSIXlt" atau "Tanggal".

Details

Waktu dibulatkan atau dipotong menjadi detik, menit, jam, hari, bulan atau tahun. Zona waktu hanya relevan untuk beberapa hari atau lebih, ketika tengah malam di zona waktu saat ini digunakan. Metode untuk kelas "Tanggal" tidak banyak berguna kecuali untuk menghilangkan pecahan hari.

Contoh

Example
R
# NOT RUN {
round(.leap.seconds + 1000, "hour")
# }
# NOT RUN {
trunc(Sys.time(), "day")
# }

See Also

round for the generic function and default methods. DateTimeClasses Date