Skip to content

Help with study guide for R exam

2 messages · 343GS, Peter Dalgaard

#
Hi there. I have a final exam coming up in a class that is heavily based in
the R programming language. The teacher has provided to us a few questions
to study in preparation for the exam. I was looking to see if anyone could
help answer any or all of these questions. Your help is extremely
appreciated! Thank you! - Spark


1.	Write the first 6 lines of a hypothetical external data file named infile
that will be completely read by the following  R command:

mydata <- read.table(?infile?, skip=3, header=FALSE, sep=?,?,
colClasses=c(?character?, rep(?numeric?, 3) ) )

2.	Describe and fix the error in the following R command.

if(mydata[,2]=2) {mydata[,2]=mydata[,2]*2}

3.	Write 1 or more R statements that will calculate the mean, sum, and
standard deviation of the numeric columns of mydata described in question
#1.

4.	What type of data structure is produced by the R command in question #1?

5.	What type of data structure is returned by the which statement in the
following R command?

myresult <- mydata[which(mydata[,1]>

6.	Be able to fully describe the characteristcs and advantages of the
following data structures:

vector, dataframe, matrix, list

7.	Be able to describe the following data types:

character, numeric, logical, date, factor

8.	Describe several advantages and disadvantages to the R open-source
development process (ie. of the R system development)

9.	What is an R package?

10.	What makes R different from a language like Fortran or C?


--
View this message in context: http://r.789695.n4.nabble.com/Help-with-study-guide-for-R-exam-tp4173951p4173951.html
Sent from the R help mailing list archive at Nabble.com.
#
On Dec 8, 2011, at 20:34 , 343GS wrote:

            
Sorry, no.

For one thing, the R lists are not there to do your work for you. Secondly, we wouldn't be doing you a favor anyway. The whole point of such an exercise is to help you prepare for the exam, and giving you the answers leaves you exactly as unprepared as you are now. Bear in mind that the answers will most likely already have been given to you once, in class.

So get together with some fellow students and talk your way through the questions. If you get stuck, I'm sure that your instructor has ways to help you become unstuck.