-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error that aborts R #7
Comments
If anyone knows of a consistent way to reproduce this bug, I would very much like to know. |
Try to run |
I thought I fixed this... :( I'll look into it. |
Following the examples for library(remotePARTS)
data(ndvi_AK10000)
df = ndvi_AK10000[seq_len(1000), ] # first 1000 rows
pm = sample_partitions(nrow(df), npart = 3)
partGLS = fitGLS_partition(formula = AR_coef ~ 0, partmat = pm, data = df) # causes crash And this is because it doesn't make sense to use a zero-only intercept. The typical intercept results in a model matrix with a single column, where a 0-intercept version has a 0-column model matrix (which is nonsense): modmat1 = model.matrix(AR_coef ~ 1, data = df)
modmat0 = model.matrix(AR_coef ~ 0, data = df)
dim(modmat1) # 1000 1
dim(modmat2) # 1000 0 I'll add some functionality to prevent 0-intercept models from being run and I will also create a warning about the intercept-only model. |
Clay,
Yes, this makes sense!
Tony
…__________________________
Anthony R. Ives (he/him/his)
UW-Madison
459 Birge Hall
608-262-1519
From: Clay Morrow ***@***.***>
Date: Tuesday, August 29, 2023 at 2:47 PM
To: morrowcj/remotePARTS ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [morrowcj/remotePARTS] Fatal error that aborts R (Issue #7)
Following the examples for fitGLS_partition, using 0-intercept only does cause a crash.
library(remotePARTS)
data(ndvi_AK10000)
df = ndvi_AK10000[seq_len(1000), ] # first 1000 rows
pm = sample_partitions(nrow(df), npart = 3)
partGLS = fitGLS_partition(formula = AR_coef ~ 0, partmat = pm, data = df) # causes crash
And this is because it doesn't make sense to use a zero-only intercept. The typical intercept results in a model matrix with a single column, where a 0-intercept version has a 0-column model matrix (which is nonsense):
modmat1 = model.matrix(AR_coef ~ 1, data = df)
modmat0 = model.matrix(AR_coef ~ 0, data = df)
dim(modmat1) # 1000 1
dim(modmat2) # 1000 0
I'll add some functionality to prevent 0-intercept models from being run and I will also create a warning about the intercept-only model.
—
Reply to this email directly, view it on GitHub<#7 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACYX6LBII7A4SHDXVK3ODDLXXZBLHANCNFSM6AAAAAASOU6SQY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
I've implemented a fix in the development branch. I'll test it after compiling and then push to master ASAP. |
Occasionally, using some functions in this package can cause a fatal errorthat aborts R.
As far as I've been able to tell, these errors occur when input to the functions are improper (e.g., incorrect dimensions) or when there is insufficient memory.
They appear to only occur with functions that use C++ (via Rcpp).
The text was updated successfully, but these errors were encountered: