Why does plot funtion not recognize my categorial data?

Sorry for a probably stupid question from a beginner:

In my data set I want to plot categorial data (three classes of medication) versus quantitative data (qPCR), but plot () does not recognize the medication.
It works perfectly fine with the dataset head "(iris) from the R-tutorial". Therefore the code is correct per se.

I defined medication from the uploaded filenames ( e.g. 2020_02_04_M533mtx_Mepo_bevor_PCRplate_1.txt) by using: med <- substr(x, 20, nchar(x).
Mepo is the medication here.
How can I tell R Studio that this is ot just a name but a variable?
Thannk you in advance for help!

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Thank you - I finally solved the problem (after 2 days).
R "saw" my data as characters: final_data$med <- as.factor(final_data$med) did the job.
Apologies for having disturbed you!
Actually it had already workd in the iris data frame but not in mine

This topic was automatically closed 21 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.