Skip to content

Woring message in as.yearmon()

3 messages · Megh Dal, Gabor Grothendieck, Andy Zhu

#
I have following dataset:
[,1] [,2] [,3]
 [1,] 1946    4 1.27
 [2,] 1946    5 1.27
 [3,] 1946    6 1.27
 [4,] 1946    7 1.27
 [5,] 1946    8 1.52
 [6,] 1946    9 1.52
 [7,] 1946   10 1.52
 [8,] 1946   11 1.52
 [9,] 1946   12 1.62
[10,] 1947    1 1.62
[11,] 1947    2 1.62
[12,] 1947    3 1.62
[13,] 1947    4 1.87
[14,] 1947    5 1.87
[15,] 1947    6 1.87

Now I write following code :
[1] "Apr 1946" "May 1946" "Jun 1946" "Jul 1946" "Aug 1946" "Sep 1946" "Oct 1946" "Nov 1946" "Dec 1946"
[10] "Jan 1947" "Feb 1947" "Mar 1947" "Apr 1947" "May 1947" "Jun 1947"
Warning message:
In if (nch == 1) "%Y-%m" else "%Y-%m-%d" :
  the condition has length > 1 and only the first element will be used

Can anyone please tell me why this warning message is coming and what is the remedy?

Regards,
#
I can't reproduce that.  When I run it I get no warning.  Check
your versions:
+  1946    5 1.27
+  1946    6 1.27
+  1946    7 1.27
+  1946    8 1.52
+  1946    9 1.52
+  1946   10 1.52
+  1946   11 1.52
+  1946   12 1.62
+  1947    1 1.62
+  1947    2 1.62
+  1947    3 1.62
+  1947    4 1.87
+  1947    5 1.87
+  1947    6 1.87"
Warning message:
closing unused connection 3 (Lines)
[1] "Apr 1946" "May 1946" "Jun 1946" "Jul 1946" "Aug 1946" "Sep 1946"
 [7] "Oct 1946" "Nov 1946" "Dec 1946" "Jan 1947" "Feb 1947" "Mar 1947"
[13] "Apr 1947" "May 1947" "Jun 1947"
[1] "R version 2.7.2 (2008-08-25)"
[1] "1.5-4"
On Wed, Sep 10, 2008 at 2:15 PM, Megh Dal <megh700004 at yahoo.com> wrote: