Displaying 20 results from an estimated 6000 matches similar to: "Apparent bug in behavior of formulas with '-' operator for lm"
2018 Mar 16
2
Apparent bug in behavior of formulas with '-' operator for lm
Joris, the point is that 'z' is NOT used as a predictor in the model.
Therefore it should not affect predictions. Also, I find it suspicious that
the error only occurs when the response variable conitains missings and 'z'
is unique (I have tested several other cases to confirm this).
-Mark
Op vr 16 mrt. 2018 om 13:03 schreef Joris Meys <jorismeys at gmail.com>:
>
2018 Mar 16
0
Apparent bug in behavior of formulas with '-' operator for lm
It's not a bug per se. It's the effect of removing all observations linked
to a certain level in your data frame. So the output of lm() doesn't
contain a coefficient for level a of z, but your new data contains that
level a. With a small addition, this works again:
d <- data.frame(x=rnorm(12),y=rnorm(12),z=rep(letters[1:6],2))
d$x[1] <- NA
m <- lm(x ~ . -z, data=d)
p <-
2018 Mar 16
0
Apparent bug in behavior of formulas with '-' operator for lm
Technically it is used as a predictor in the model. The information is
contained in terms :
> terms(x ~ . - z, data = d)
x ~ (y + z) - z
attr(,"variables")
list(x, y, z)
attr(,"factors")
y
x 0
y 1
z 0
attr(,"term.labels")
[1] "y"
attr(,"order")
[1] 1
attr(,"intercept")
[1] 1
attr(,"response")
[1] 1
2018 Feb 20
5
deparseDots to get names of all arguments?
Hi, All:
????? How can I get the names of all the arguments in dots(...)?
????? I'm able to get the name of the first argument but not the second:
deparseDots <- function(...){
? deparse(substitute(...))
}
a <- 1
b <- 2
deparseDots(a, b)
[1] "a"
????? I'd like to get c('a', 'b').
????? Thanks,
????? Spencer Graves
> sessionInfo()
R
2018 Mar 14
2
truncation/rounding bug with write.csv
I don't see the issue here. It would be helpful if people would report
their sessionInfo() when reporting whether or not they see this issue.
Mine is
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux
Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblas_haswellp-r0.2.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8
2018 Feb 21
0
deparseDots to get names of all arguments?
Does substitute(...()) do what you want?
> myFunc <- function(x, ...) substitute(...())
> myFunc(y=1/(1:10), x=sin(3:1), z=stop("Oops"), "untagged arg")
$y
1/(1:10)
$z
stop("Oops")
[[3]]
[1] "untagged arg"
> names(.Last.value)
[1] "y" "z" ""
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Feb 20, 2018 at
2008 Apr 27
2
R_DEFAULT_DEVICE (PR#11294)
Setting enviroment variable R_DEFAULT_DEVICE causes an error.
The patch below fixes this.
I guess the same goes for R_INTERACTIVE_DEVICE.
--- R-2.7.0/src/library/grDevices/R/zzz.R 2008-04-27 13:49:11.000000000 +0200
+++ R-2.7.0/src/library/grDevices/R/zzz.R.new 2008-04-27 13:59:37.000000000 +0200
@@ -22,7 +22,7 @@
extras <- if(.Platform$OS.type == "windows")
2006 Oct 31
4
'make check' fails on d-p-q-r-tests (PR#9326)
'make check' fails on d-p-q-r-tests:
> ##-- non central Chi^2 :
> xB <- c(2000,1e6,1e50,Inf)
> for(df in c(0.1, 1, 10))
+ for(ncp in c(0, 1, 10, 100)) stopifnot(pchisq(xB, df=df, ncp=ncp) == 1)
Error: pchisq(xB, df = df, ncp = ncp) == 1 is not all TRUE
Execution halted
Here is some more testing:
xB <- c(2000,1e6,1e50,Inf)
for(df in c(0.1, 1, 10)) for(ncp in c(0, 1,
2018 Apr 27
5
predict.glm returns different results for the same model
Hi all,
Very surprising (to me!) and mystifying result from predict.glm(): the
predictions vary depending on whether or not I use ns() or
splines::ns(). Reprex follows:
library(splines)
set.seed(12345)
dat <- data.frame(claim = rbinom(1000, 1, 0.5))
mns <- c(3.4, 3.6)
sds <- c(0.24, 0.35)
dat$wind <- exp(rnorm(nrow(dat), mean = mns[dat$claim + 1], sd =
sds[dat$claim + 1]))
dat <-
2015 Nov 26
2
Inconsistency in treating NaN-results?
This question is more out of curiosity than a complaint or suggestion, but
I'm just wondering.
The behavior of R on calculations that result in NaN seems a bit
inconsistent.
# this is expected:
> 0/0
[1] NaN
# but this gives a warning
> sin(Inf)
[1] NaN
Warning message:
In sin(Inf) : NaNs produced
# and this again does not
> exp(NaN)
[1] NaN
Conceptually, I like to think that R
2012 Apr 12
2
backup to NTFS USB disk
Hello, *
I am setting up a backup on a Linux system with Windows XP workstations. The
backup goes to three alternating usb drives, each of which is NTFS formatted.
The disks should be virtually identical but they do not seem to be.
First, my mount command is this (I edited a bit for brevity)
mount -t ntfs-3g -o locale=nl_NL.iso-8859-1,silent /dev/disk/by-id/usb-DiskA \
/mnt/tmp ||
mount -t
2018 Mar 14
2
truncation/rounding bug with write.csv
To my surprise, I can confirm on Windows 10 using R 3.4.3 . As tail is not
recognized by Windows cmd, I replaced with:
system('powershell -nologo "& "Get-Content -Path temp.csv -Tail 1')
The last line shows only 7 digits after the decimal, whereas the first have
15 digits after the decimal. I agree with Dirk though, 1.6Gb csv files are
not the best way to work with
2018 Jan 26
2
utils::install.packages with quiet=TRUE fails for source packages on Windows
Hi,
Installing a source package on Windows using utils::install.packages()
with quiet=TRUE fails, while it works with the default quiet = FALSE.
The problem seems to be caused by the fact that when quiet = TRUE,
stdout and stderr are set to FALSE when calling "R CMD INSTALL" with
base::system2() here:
2015 Dec 16
2
Mystifying SEGFAULT on 3.2.3 but not 3.2.2
Dear R developers,
(Apologies about previous incomplete e-mail, I fat-fingered a keyboard
shortcut)??
I recently upgraded to 3.2.3 and am getting mystifying errors with my
in-development code (available at
https://github.com/gertvv/gemtc/tree/feature/regression). Every few hundred
LPs that I solve using the rcdd package will result in a SEGFAULT in the
garbage collector (address 0x10, cause
2015 Nov 30
1
Inconsistency in treating NaN-results?
As a side note, Splus makes sin(x) NA, with a warning, for
abs(x)>1.6*2^48 (about
4.51e+14) because more than half the digits are incorrect in sin(x)
for such x. E.g.,
in R we get:
> options(digits=16)
> library(Rmpfr)
> sin(4.6e14)
[1] -0.792253849684354
> sin(mpfr(4.6e14, precBits=500))
1 'mpfr' number of precision 500 bits
[1]
2019 Oct 11
2
New matrix function
I think you are confusing package and function here. Plus some of the R
Core packages, that you mention, contain functions that should probably be
replaced by functions with better implementation from packages on CRAN.
Best regards
Morgan
On Fri, 11 Oct 2019 15:22 Joris Meys, <jorismeys at gmail.com> wrote:
>
>
> On Fri, Oct 11, 2019 at 3:55 PM Morgan Morgan <morgan.emailbox
2017 Sep 03
2
readLines() segfaults on large file & question on how to work around
Jeroen:
Thank you for pointing me to ndjson, which I had not heard of and is
exactly my case.
My experience:
jsonlite::stream_in - segfaults
ndjson::stream_in - my fault, I am running Ubuntu 14.04 and it is too old
so it won't compile the package
corpus::read_ndjson - works!!! Of course it does a different simplification
than jsonlite::fromJSON, so I have to change some code, but
2018 Jan 18
0
error while loading ggplot2
Please post using plain text... the mailing list will strip HTML anyway and mess up what you send.
Send the output of sessionInfo() so we know what versions of R and packages you have.
--
Sent from my phone. Please excuse my brevity.
On January 17, 2018 4:37:06 PM PST, shijin mathew via R-help <r-help at r-project.org> wrote:
>Getting the following error while loading ggplot2.
>
2018 Apr 24
1
data.table not available as win binary for R 3.5 yet?
Dear all,
to my astonishment data.table cannot be installed on R 3.5 Windows. When
checking the package page, the Windows binary is available for download.
When checking the server however, I can't seem to find data.table. Also
install.packages() says the package is only available in source form and
may need compilation.
Compiling using Rtools 35 is no problem.
Is this merely an issue of
2018 Jan 31
3
Best practices in developing package: From a single file
On 31/01/2018 6:33 AM, Joris Meys wrote:
> 3. given your criticism, I'd like your opinion on where I can improve
> the documentation of https://github.com/CenterForStatistics-UGent/pim.
> I'm currently busy updating the help files for a next release on CRAN,
> so your input is more than welcome.
After this invitation I sent some private comments to Joris. I would
say his