Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wch
on Dec 6, 2012
|
parent
|
context
|
favorite
| on:
Try R — A new online course, for free
In your R version, you don't need the call to `which()`, so you could do this instead:
dfrm$height[substr(dfrm$name,1,1) == "D"]
And here's a much clearer way to do it:
subset(dfrm, grepl("^D", name), select = height)
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: