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
207 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
• 32,930 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,300 points
835 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
2,890 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
368 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
1,254 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
659 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 261 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
426 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
• 32,930 points
3,621 views
+3 votes
2 answers

Error: could not find function - R Programming

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

answered Aug 22, 2019 in Data Analytics by anonymous
• 32,930 points
25,658 views