-
Notifications
You must be signed in to change notification settings - Fork 20
Final Exercise07 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Exercise07 | ||
|
|
||
| # Part 1 | ||
| # file creation | ||
| file.create("iris.txt") | ||
| # input | ||
| read.csv("iris.csv",header=TRUE,stringsAsFactors=TRUE) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this just read the file but not assign the contain of it to anything |
||
| # assigning data as the variable called inputIris | ||
| inputIris<-read.csv("iris.csv",header=TRUE,stringsAsFactors=TRUE) | ||
| #output as file called iris.txt | ||
| write.table(inputIris,file="iris.txt",row.names=FALSE,col.names=TRUE,sep="\t",append=FALSE) | ||
|
|
||
| # Part 2 | ||
| #making data structures | ||
| vecone<-seq(from=100,to=1000,length.out=10) | ||
| dftwo<-data.frame(name=c('Notre Dame','Syracuse'),score=c('41','24')) | ||
| vecthree<-999 | ||
| matfour<-matrix(data=1:50,nrow=10,ncol=5,byrow=TRUE) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't need byrow = T here |
||
| vecfive<-c('r','g','f') | ||
| # putting data structures into list called listex7 | ||
| listex7<-list(vecone,dftwo,vecthree,matfour,vecfive) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +2 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need this line