Code
myprint(2)
[1] 2
R
brush-up
myprint(2)
[1] 2
for
loopdata.frame
:first_name | last_name | gender |
---|---|---|
Hermione | Granger | female |
Ron | Weasley | male |
Harry | Potter | male |
Write a function that takes such a data.frame
as a argument and that will print the last name for each row.
while
statementwhile
statement.if
/else
statementThere are only two hard things in Computer Science:
- cache invalidation, and
- naming things.
– Phil Karlton