View | Details | Raw Unified | Return to bug 16895 | Differences between
and this patch

Collapse All | Expand All

(-)table.R (-3 / +5 lines)
Lines 1-7 Link Here
1
#  File src/library/base/R/table.R
1
#  File src/library/base/R/table.R
2
#  Part of the R package, https://www.R-project.org
2
#  Part of the R package, https://www.R-project.org
3
#
3
#
4
#  Copyright (C) 1995-2015 The R Core Team
4
#  Copyright (C) 1995-2016 The R Core Team
5
#
5
#
6
#  This program is free software; you can redistribute it and/or modify
6
#  This program is free software; you can redistribute it and/or modify
7
#  it under the terms of the GNU General Public License as published by
7
#  it under the terms of the GNU General Public License as published by
Lines 81-89 Link Here
81
                    else {
81
                    else {
82
                        if (useNA != "no")
82
                        if (useNA != "no")
83
                            a <- addNA(a, ifany = (useNA == "ifany"))
83
                            a <- addNA(a, ifany = (useNA == "ifany"))
84
                        ll <- levels(a)
84
                        nl <- length(ll <- levels(a))
85
                        a <- factor(a, levels = ll[!(ll %in% exclude)],
85
                        if (length(ll <- ll[!(ll %in% exclude)]) != nl)
86
                            a <- factor(a, levels = ll,
86
                               exclude = if (useNA == "no") NA)
87
                               exclude = if (useNA == "no") NA)
88
                        a
87
                    }
89
                    }
88
                }
90
                }
89
            }
91
            }

Return to bug 16895