Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:16:07+00:00 2026-06-17T23:16:07+00:00

Having an object of class zoo we can select observations for a range of

  • 0

Having an object of class zoo we can select observations for a range of dates of interest using the function:

window(z, start = as.Date("2006-01-05"), end = as.Date("2006-01-08"))

In running this function the following warning message occurs:

Warning messages:
1: In which(in.index & all.indexes >= start & all.indexes <= end) :
  Metodi incompatibili ("Ops.POSIXt", "Ops.Date") per ">="
2: In which(in.index & all.indexes >= start & all.indexes <= end) :
  Metodi incompatibili ("Ops.POSIXt", "Ops.Date") per "<="

I have checked that the object is of class zoo and that Dates are included in the time series.

How is that possible?

Below the str(z) as requested:

   ‘zoo’ series from 2006-01-03 to 2013-01-24
  Data: num [1:1795, 1:40] 3.65 3.68 3.69 3.72 3.7 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:1795] "1" "2" "3" "4" ...
  ..$ : chr [1:40] "EURARS" "EURAUD" "EURBRO" "EURCAD" ...
  Index:  POSIXct[1:1795], format: "2006-01-03" "2006-01-04" "2006-01-05" "2006-01-06" ...

Below the dput(head(z)) as requested:

structure(c(3.6511, 3.6833, 3.6931, 3.7152, 3.7027, 3.6897, 1.62349, 
1.62257, 1.62011, 1.6115, 1.60243, 1.61108, 2.802, 2.7692, 2.7727, 
2.7741, 2.7238, 2.729, 1.38937, 1.39109, 1.40716, 1.41627, 1.41196, 
1.40666, 1.55055, 1.5472, 1.5448, 1.54335, 1.54215, 1.545, 623.73, 
624.16, 628.43, 638.11, 632.27, 630.7, 9.6988, 9.7803, 9.7689, 
9.802, 9.7492, 9.7354, 2742.03, 2765.68, 2758.65, 2769.27, 2753.3, 
2747.31, 29.047, 28.972, 28.9, 28.88, 28.764, 28.792, 7.4616, 
7.4601, 7.4612, 7.458, 7.46, 7.4589, 6.8983, 6.9551, 6.9594, 
6.9838, 6.9374, 6.9253, 0.6882, 0.68905, 0.68961, 0.6863, 0.68473, 
0.68358, 9.3178, 9.3963, 9.3889, 9.4207, 9.3702, 9.3516, 251.72, 
250.28, 250.66, 250.39, 249.89, 250.86, 11657.46, 11677.26, 11612.05, 
11603.59, 11433.35, 11403.84, 5.5244, 5.5808, 5.5799, 5.6134, 
5.5858, 5.5957, 53.5288, 54.0151, 54.0323, 54.0105, 53.5591, 
53.6189, 74.96, 74.88, 74.41, 73.94, 73.79, 73.84, 139.6, 140.71, 
140.39, 139.09, 138.39, 137.93, 1208.3493, 1210.0214, 1195.7746, 
1200.3966, 1181.3457, 1184.9635, 160.65, 162.15, 162.02, 162.53, 
161.7, 161.43, 10.9802, 10.997, 10.9947, 10.9635, 10.9909, 10.9874, 
12.7724, 12.8255, 12.8746, 12.8338, 12.7859, 12.8273, 4.5416, 
4.5702, 4.5623, 4.5597, 4.5308, 4.5229, 7.9654, 7.9248, 7.9254, 
7.914, 7.9574, 8.0011, 1.7571, 1.7626, 1.7622, 1.7574, 1.7411, 
1.7391, 4.1276, 4.1608, 4.1665, 4.1818, 4.1606, 4.1534, 63.2627, 
63.4733, 63.6725, 63.7198, 63.3608, 63.3412, 3.8295, 3.8116, 
3.807, 3.805, 3.7609, 3.7799, 3.6732, 3.6815, 3.6834, 3.6842, 
3.6644, 3.6492, 34.5475, 34.8363, 34.7254, 34.8369, 34.68, 34.39, 
9.3648, 9.3279, 9.3321, 9.3152, 9.3389, 9.3603, 1.9844, 1.9932, 
1.9938, 1.9902, 1.9766, 1.9716, 48.9853, 48.9426, 48.6762, 48.3184, 
47.9995, 48.0187, 1.6149, 1.6195, 1.6193, 1.6204, 1.6155, 1.6148, 
1.6129, 1.6175, 1.6184, 1.6201, 1.6182, 1.6221, 39.2261, 39.1868, 
38.7569, 39.1189, 38.6148, 38.6309, 6.0673, 6.114, 6.1208, 6.1484, 
6.1095, 6.1082, 1.2019, 1.2119, 1.211, 1.2151, 1.2088, 1.2065, 
7.4834, 7.4559, 7.4658, 7.3872, 7.3206, 7.3497), .Dim = c(6L, 
40L), .Dimnames = list(c("1", "2", "3", "4", "5", "6"), c("EURARS", 
"EURAUD", "EURBRO", "EURCAD", "EURCHF", "EURCLP", "EURCNO", "EURCOP", 
"EURCZK", "EURDKK", "EUREGP", "EURGBP", "EURHKD", "EURHUF", "EURIDO", 
"EURILS", "EURINO", "EURISK", "EURJPY", "EURKRO", "EURKZT", "EURMAD", 
"EURMXN", "EURMYO", "EURNOK", "EURNZD", "EURPEN", "EURPHO", "EURPLN", 
"EURRON", "EURRUB", "EURSEK", "EURSGO", "EURTHO", "EURTND", "EURTRY", 
"EURTWO", "EURUAH", "EURUSD", "EURZAR")), index = structure(c(1136242800, 
1136329200, 1136415600, 1136502000, 1136761200, 1136847600), class = c("POSIXct", 
"POSIXt"), tzone = ""), class = "zoo")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:16:08+00:00Added an answer on June 17, 2026 at 11:16 pm

    You shouldn’t be comparing Date with POSIXct

    Try this:

    window(z, start = as.POSIXct("2006-01-05"), end = as.POSIXct("2006-01-08"))
    

    Alternatively, as @JoshuaUlrich points out in a comment, your data is daily frequency, so you’d be better off using a Date index class for your data to avoid timezone weirdness.

    index(z) <- as.Date(index(z))
    window(z, start = as.Date("2006-01-05"), end = as.Date("2006-01-08"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a class Student. I want to store the object of class
In UML, if there's a class A having an object of type B as
Having a snippet like this: import yaml class User(object): def __init__(self, name, surname): self.name=
What are the purposes of having private/protected members of a class/structure in object-oriented programming?
Having an object like this: var a = { b: string, c: function(){ return
HI when an object (having sub objects) is serialized using a BinaryFormatter, what exactly
i am trying to XML serialize a class object but having the following problem:
I'm using jaxb to generate java object class from xml schemas within an Ant
I am having an issue with serializing and object, I can get it to
I'm having trouble to find how to typecast the dynamically created class while using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.