Beginner to R - basic of table manipulation -


i starting r , trying learn ways of working csv files

sample data set

org_name  question#  response(scales 1 through 5) org1      1         1 org1      2         3 org1      3         5 org2      1         4 org2      2         2 org2      3         3 org3      1         4 org3      2         1 org3      3         5 

i trying figure out how data analysis using r

so questions this

  1. is r tool this? . not sure if excel better choice (i more comfortable excel)

  2. how 1 work table in r? example if want check org names have scored high (4-5) in question#2 , low (1-2) in question#1. how happen? there method this?

  3. is there tutorial/resources learning r. understand r great choice data analysis , learn more it.

1) r great tool handling csv data. in few minutes, can download rstudio , , running.

here sample code shows how started:

sample <- data.frame(org_name = c(rep("org1", 3), rep("org2", 3), rep("org3", 3)),                      question = c(1,2,3,1,2,3,1,2,3),                      response = c(1,3,5,4,2,3,4,1,5)) 

2) defines data frame called sample , assigns data it. find out orgs scored 4 or higher on question 2, can use this:

> sample$org_name[sample$response >= 4 & sample$question == 2] factor(0) 

this returns factor(0) means no orgs match. however, if want find out orgs have low response question 2 can try:

> sample$org_name[sample$response <= 2 & sample$question == 2] [1] org2 org3 

3) google great place start finding r resources. , official r documentation too.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -