# how do I create a Line chart from a data frame?

#### Serphentelm

##### New Member
i'm quite the newbie with R and i want to create a line chart starting from this dataset:

where every line points out the number of the smell detected (so in my case case 11 for version 1.2; 11 for version 1.3 and so on) and on the x axis i want to put every version that i've under exam.
The problem is that i don't know how to keep trace of a "counter" in r, counting how many smells there are for each version

#### consuli

##### Member
It seems, you do not have a concrete imagination, how (line) charts are created in R.

Thus, here is an example using ggplot2 (the Standard)

Code:
library(ggplot2)

dat1 <- data.frame( sex = factor(c("Female","Female","Male","Male")), time = factor(c("Lunch","Dinner","Lunch","Dinner"), levels=c("Lunch","Dinner")), total_bill = c(13.53, 16.81, 16.24, 17.42) )

p <- ggplot(data=dat1, aes(x=time, y=total_bill, group=sex)) +
geom_line() +
geom_point()

#### Serphentelm

##### New Member
thanks for the reply, so i managed to get to this