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
44 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,440 points

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

Related Questions In Data Analytics

0 votes
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
• 10,660 points
167 views
0 votes
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,800 points
1,234 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,800 points
137 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
308 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
269 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
114 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
163 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,440 points
737 views
0 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,440 points
10,475 views