r:input_output
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
r:input_output [2017/09/28 08:19] – [Reading from CSV Files] hkimscil | r:input_output [2019/09/19 12:28] – [Fixed-Width Records] hkimscil | ||
---|---|---|---|
Line 38: | Line 38: | ||
> source(" | > source(" | ||
> sink() | > sink() | ||
+ | |||
+ | < | ||
+ | cat(results, | ||
+ | cat(conclusion, | ||
+ | |||
+ | Without " | ||
< | < | ||
Line 45: | Line 51: | ||
close(con)</ | close(con)</ | ||
+ | " | ||
====== Listing Files ====== | ====== Listing Files ====== | ||
< | < | ||
Line 62: | Line 69: | ||
Yates | Yates | ||
Smith | Smith | ||
+ | |||
</ | </ | ||
- | < | + | < |
</ | </ | ||
Line 77: | Line 85: | ||
5 Smith Kirstine | 5 Smith Kirstine | ||
</ | </ | ||
+ | Funky variable names (V1, V2, . . .). Use the below method with " | ||
+ | < | ||
+ | + | ||
+ | > records | ||
+ | Last First Born Died | ||
+ | 1 Fisher | ||
+ | 2 Pearson | ||
+ | 3 Cox Gertrude | ||
+ | 4 Yates Frank 1902 1994 | ||
+ | 5 Smith Kirstine | ||
+ | </ | ||
====== Reading Tabular Data Files ====== | ====== Reading Tabular Data Files ====== | ||
< | < | ||
Line 140: | Line 159: | ||
====== Reading from CSV Files ====== | ====== Reading from CSV Files ====== | ||
- | <code csv filename.csv> | + | <code csv filename.csv> |
- | label lbound ubound | + | low 0.000 0.674 |
- | low 0.000 0.674 | + | mid 0.674 1.640 |
- | mid 0.674 1.640 | + | high 1.640 2.330 |
- | high 1.640 2.330 | + | |
- | + | ||
- | + | ||
</ | </ | ||
- | < | + | < |
+ | > tbl</ | ||
+ | |||
+ | < | ||
+ | > tbl</ | ||
- | < | + | < |
+ | > tbl</ | ||
< | < | ||
Line 210: | Line 230: | ||
> url <- ' | > url <- ' | ||
> tbls <- readHTMLTable(url) | > tbls <- readHTMLTable(url) | ||
+ | </ | ||
+ | |||
+ | The above not working for me. :( | ||
+ | |||
+ | < | ||
+ | url <- ' | ||
+ | tables <- GET(url) | ||
+ | tables <- readHTMLTable(rawToChar(tables$content)) | ||
</ | </ | ||
r/input_output.txt · Last modified: 2019/09/20 10:32 by hkimscil