[R] data =

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sat Oct 4 12:39:37 CEST 2025


On 10/4/2025 12:54 AM, R Jerome Anderson wrote:
> I can code summary(midterm_df$hv109) and I get the summary of variable
> hv109. No problem.
> 
> Yet when I write the code:
> 
> summary(hv109, data = midterm_df)
> 
> I get this error:
> 
> Error in h(simpleError(msg, call)) : error in evaluating the argument
> 'object' in selecting a method for function 'summary': object 'hv109' not
> found
> 
> If I write the code summary('hv109', data = midterm_df), R treats hv109 as
> if it were a character variable. It is not.
> 
> Page 521 in Andrews *Doing Data Science in R* shows the data = [df]
> command. I thought it was straightforward. Why doesn't my code work?
> 
> Any help w/ this would be appreciated.
> 
> -- Jerome Anderson
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hello,

?summary has no argument 'data'. You must use the first form.

Hope this helps,

Rui Barradas



More information about the R-help mailing list