datacamp / datacamp/rdocumentation-2.0

Filtered dataframe causes critical error

Open
#139 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
301
Forks
54
Avg merge
16h 19m
Merged PRs (30d)
1

Description

Hi,

I am running a fit using nlsLM, matching a function against a tibble of observed data.

The function runs fine on a particular dataset "data", but if I try to run it on a subset "data_subset" (subset using a filter statement) I get the following error:

"Error in model.frame.default ... invalid type (list) for variable"

The two tibbles look identical to me, using str(data) and str(data_subset), and I cannot work out where the list is coming from.

I was wondering if anyone had encountered this problem before and what I can do to resolve it?

Parmesh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the nlsLM fit with the original data and the filtered data_subset, then inspect the model.frame.default error and the structures reported by str(). Done means identifying why the filtered tibble supplies a list variable and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.