Error Object Concentration not found

0 votes
abc<- Plot_timevsconc[(Plot_timevsconc$Participant%in%c("905")),]##select the panelist
pdf("Final1.pdf", width = 25, height = 10)
for(ms in names(abc[,-c(1:6)]))
{
  abc <- data.frame(Concentration = abc[,ms], Time = abc$Time, Type = abc$Sample)
  hello <- ggplot(data = abc, aes(x = Time, y = Concentration, color = Type)) + geom_line(size=1)+
  scale_x_continuous(breaks=seq(0,520, by=40)) + labs(x = "Time(seconds)") + labs(y="Concentration(ppbv)") +
  ggtitle(paste(ms))
print(hello)
}
dev.off()

This is my code. It keeps saying the object "concentration" not found.

Could anyone please tell me what could have possibly gone wrong?

Thank you
Oct 18, 2019 in Data Analytics by Sanju Vigasini
• 120 points
1,125 views

1 answer to this question.

0 votes

Hi Sanju, is the abc data frame created in the below line before using ggplot?

for(ms in names(abc[,-c(1:6)])) 

  abc <- data.frame(Concentration = abc[,ms], Time = abc$Time, Type = abc$Sample) 
  hello <- ggplot(data = abc, aes(x = Time, y = Concentration, color = Type)) + geom_line(size=1)+ 
}

Convert Concentration = abc[,ms] to Concentration = abc$ms and try.

answered Oct 18, 2019 by Cherukuri
• 33,030 points

Otherwise, replace Concentration = abc[,ms] with Concentration = abc[,[ms col_no]] 

Related Questions In Data Analytics

+1 vote
1 answer

What does “Error: object '<myvariable>' not found” mean?

The error means that R could not ...READ MORE

answered Oct 29, 2018 in Data Analytics by Ali
• 11,360 points
2,047 views
+1 vote
1 answer

"Error in eval(ei, envir) : object 'RDX2' not found" when trying to source the code in R

This is a very common issue that ...READ MORE

answered Oct 30, 2018 in Data Analytics by Maverick
• 10,840 points
5,108 views
0 votes
1 answer

Error saying "object 'mvnorm' not found"

You seem to have made a small ...READ MORE

answered Nov 9, 2018 in Data Analytics by Maverick
• 10,840 points
1,252 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,249 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,919 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by Gitika 1,182 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,339 views
0 votes
1 answer

R Shiny Error: Object of type 'closure' is not subsettable

The error you mentioned happens when you ...READ MORE

answered Aug 20, 2019 in Data Analytics by anonymous
• 33,030 points
6,359 views
+3 votes
2 answers

Error: could not find function - R Programming

Yes, Just like @Maverik said, It happens ...READ MORE

answered Aug 23, 2019 in Data Analytics by anonymous
• 33,030 points
33,702 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP