Transform Julian Day to Calendar Date Object in R (Example Code)

In this tutorial you’ll learn how to change a Julian day to a calendar date in the R programming language.

Construction of Example Data

x <- c(5, 37, 216, 45)                                # Create example Julian day
# [1]   5  37 216  45

Example: Transforming Julian Days to Dates Using as.Date() Function

x_date <- as.Date(x, origin = as.Date("2020-01-01"))  # Get date from Julian day
# [1] "2020-01-06" "2020-02-07" "2020-08-04" "2020-02-15"

Related Tutorials & Further Resources

You may find some related R tutorials on topics such as data conversion, data inspection, data objects, and dates in the following list:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed