Passing arguments to a function


I am using facet_wrap () function and passed two columns one (code)with numeric data type and other(description )with character data type. but I got the below error and if I pass one column name I can see the graph, if I pass both I am getting error.

I would like to have both columns in my output graph
Looking forward for your help

Example code:

ggplot(df, aes(x= dates, y =numbers))+
facet_wrap(~code, ~description, scales =“free”)

Error in sanitise_dim(nrow)
Language object cannot be coerced to type integer
Only first value of nrow will be used
Coercing now to be an integer



Reading that I think that

facet_wrap(~code+description, scales =“free”)

could work.
As you specify it ~description is considered to be nrow.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.