Relationship between price and quantity in R I tried to figure out how I can analyze this project. To find out how to analyze relationships between prices and quantities. I think with only two variables you can't build models.
For example,  one pencil company sells
100 pencils for 10 dollars,  200 for \$15, 300 for \$30, 400 for \$35, etc/
How can you analyse this relationship in R? 
 A: Assuming that the relationship is linear, you could do:
quantity <- c(100,200,300,400)
price <- c(10,15,30,35)
plot(quantity~price)
fit <- lm(quantity~price)
abline(fit)
summary(fit)

A: This is a typical question in microeconomics. You are trying to estimate a demand function. Paired values of prices and quantities are absolutely sufficient to do that. Usually there is the basic assumption of linear relationships. You do not show us your data so maybe a nonlinear model would also be appropriate. 
You find a very basic introduction to this topic here. 
A: HOSS_JFL is right, but it should be highlighted that it is far from clear what exactly you are measuring if you regress prices on quantities: is it a supply or a demand function or a mixture of both? If you can't tell what drives the variation in prices, you can't tell which side of the market you explain.
This would be a classic example for endogeneity problem which requires instrumental variables or system of equation estimation. See the systemfit package for detail. They even discuss the case of supply and demand functions in the introduction of the methods.
