Newbie confused by errors

I am trying to analyse the number of target items per month. I have loaded tgt (target) and all (all of the items) per month. I combine them and I can perform a summary, why can't I do a boxplot?

s <-cbind(tgt[2], all[2])
s
tgt whole
1 1094 9598
2 1087 8675
3 1260 9335
4 1646 9680
5 2204 13467
6 2096 12798
7 1896 13724
8 1988 13646
9 1776 10770
10 1897 11463
11 1321 10418
12 1199 9270
summary(s)
tgt whole
Min. :1087 Min. : 8675
1st Qu.:1260 1st Qu.: 9598
Median :1646 Median :10418
Mean :1622 Mean :11070
3rd Qu.:1897 3rd Qu.:12798
Max. :2204 Max. :13724
boxplot(s)
Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In as.integer64.double(range(e, na.rm = na.rm)) :
NAs produced by integer64 overflow
4: In min(x, na.rm = na.rm) :
no non-missing arguments to min; returning Inf
5: In max(x, na.rm = na.rm) :
no non-missing arguments to max; returning -Inf
6: In as.integer64.double(range(e, na.rm = na.rm)) :
NAs produced by integer64 overflow

I tried to reproduce the issue and am not able to.

I used the following code to make a reproducible example and simply created the data frame with the resulting data you're showing:

s <- data.frame(tgt = c(1094, 1087, 1260, 1646, 2204, 2096, 1896, 1988, 1776, 1897, 1321, 1199),
                whole = c(9598, 8675, 9335, 9680, 13467, 12798, 13724, 13646, 10770, 11463, 10418, 9270))

boxplot(s)

This worked fine with no errors:

Interestingly, summary(s) returned slightly different results from what you show in your post:

     tgt           whole      
 Min.   :1087   Min.   : 8675  
 1st Qu.:1245   1st Qu.: 9532  
 Median :1711   Median :10594  
 Mean   :1622   Mean   :11070  
 3rd Qu.:1920   3rd Qu.:12965  
 Max.   :2204   Max.   :13724  

This has me wondering if there is something in your data that is not quite as it is represented in your question that is causing the issue?

I am creating the tgt variable using a DB query:
tgt <- dbGetQuery(DB,'SELECT month, count(month) as tgt From Winup10R group by 1 order by 1')
So my tgt looks like this:

tgt
month tgt
1 1 1094
2 2 1087
3 3 1260
4 4 1646
5 5 2204
6 6 2096
7 7 1896
8 8 1988
9 9 1776
10 10 1897
11 11 1321
12 12 1199
Same for whole. So I guess my summary variable is different :
s <-cbind(tgt[2], all[2])
s
tgt whole
1 1094 9598
2 1087 8675
3 1260 9335
4 1646 9680
5 2204 13467
6 2096 12798
7 1896 13724
8 1988 13646
9 1776 10770
10 1897 11463
11 1321 10418
12 1199 9270
I copied your code to create a variable x which should be the same as s. It looks the same but still fails!
s <-cbind(tgt[2], all[2])
s
tgt whole
1 1094 9598
2 1087 8675
3 1260 9335
4 1646 9680
5 2204 13467
6 2096 12798
7 1896 13724
8 1988 13646
9 1776 10770
10 1897 11463
11 1321 10418
12 1199 9270
x <- data.frame(tgt = c(1094, 1087, 1260, 1646, 2204, 2096, 1896, 1988, 1776, 1897, 1321, 1199),

  •             whole = c(9598, 8675, 9335, 9680, 13467, 12798, 13724, 13646, 10770, 11463, 10418, 9270))
    

x
tgt whole
1 1094 9598
2 1087 8675
3 1260 9335
4 1646 9680
5 2204 13467
6 2096 12798
7 1896 13724
8 1988 13646
9 1776 10770
10 1897 11463
11 1321 10418
12 1199 9270
summary(s)
tgt whole
Min. :1087 Min. : 8675
1st Qu.:1260 1st Qu.: 9598
Median :1646 Median :10418
Mean :1622 Mean :11070
3rd Qu.:1897 3rd Qu.:12798
Max. :2204 Max. :13724
summary(x)
tgt whole
Min. :1087 Min. : 8675
1st Qu.:1245 1st Qu.: 9532
Median :1711 Median :10594
Mean :1622 Mean :11070
3rd Qu.:1920 3rd Qu.:12965
Max. :2204 Max. :13724
boxplot(x) (succeeds)
boxplot(s)
Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In as.integer64.double(range(e, na.rm = na.rm)) :
NAs produced by integer64 overflow
4: In min(x, na.rm = na.rm) :
no non-missing arguments to min; returning Inf
5: In max(x, na.rm = na.rm) :
no non-missing arguments to max; returning -Inf
6: In as.integer64.double(range(e, na.rm = na.rm)) :
NAs produced by integer64 overflow

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.