Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Country,count
- uk,34
- au,35
- us,53
- in,44
- args <- commandArgs()
- #Storing the filename in fn given next to "--args"
- fn <- args[which(args=="--args")+1]
- t<-read.table(fn,sep=",",header=TRUE,as.is=TRUE,quote="")
- t
- for (i in levels(t$Country)){
- if ( i == us ) {
- RES <<- t[t$Country == i,]
- }
- }
- RES
- > args <- commandArgs()
- > #Storing the filename in fn given next to "--args"
- > fn <- args[which(args=="--args")+1]
- > t<-read.table(fn,sep=",",header=TRUE,as.is=TRUE,quote="")
- > t
- Country count
- 1 uk 34
- 2 au 35
- 3 us 53
- 4 in 44
- > for (i in levels(t$Country)){
- + if ( i == us ) {
- + RES <<- t[t$Country == i,]
- + }
- + }
- > RES
- Error: object 'RES' not found
- Execution halted
- for (i in t$Country)
- if (i =="us")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement