Skip to content
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

Error in scale_color_gradient2() #321

Open
ShashTrip1 opened this issue May 6, 2024 · 5 comments
Open

Error in scale_color_gradient2() #321

ShashTrip1 opened this issue May 6, 2024 · 5 comments

Comments

@ShashTrip1
Copy link

Reran some old code I had (last ran 1 month aga without any errors) however today it threw an error. Code below:

I ran: plotDAbeeswarm(da_results, group.by = "ident")

And it gave the following error:
converting group.by to factor...
Error in scale_color_gradient2():
! Discrete values supplied to continuous scale.

@MikeDMorgan
Copy link
Member

Hi @ShashTrip1 can you check if the 'ident' variable is a factor, character or numeric type. Pre-converting to character may help.

@shuaizh117
Copy link

Reran some old code I had (last ran 1 month aga without any errors) however today it threw an error. Code below:

I ran: plotDAbeeswarm(da_results, group.by = "ident")

And it gave the following error: converting group.by to factor... Error in scale_color_gradient2(): ! Discrete values supplied to continuous scale.

I encountered the same problem. I group.by = "celltype", but it still gave me the same error, even I converted "celltype" to character. Did you solve it?

@MikeDMorgan
Copy link
Member

MikeDMorgan commented May 28, 2024

Your code states that the group.by variable is "ident" not "celltype".

@ionzhanghui
Copy link

I also met this problem when I run " plotDAbeeswarm":
Converting group_by to factor...
Error in scale_color_gradient2():
! Discrete values supplied to continuous scale.
ℹ Example values: NA, NA, NA, NA, and NA
Run rlang::last_trace() to see where the error occurred.

I check the 'ident' variable I used is a factor.
Do you have any suggestion?

@MikeDMorgan
Copy link
Member

Yes - you have NA values in your variables, as stated in the error traceback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants