Skip to content
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

find-multiple-maxima #10

Open
noamross opened this issue Mar 22, 2015 · 0 comments
Open

find-multiple-maxima #10

noamross opened this issue Mar 22, 2015 · 0 comments

Comments

@noamross
Copy link
Owner

https://github.com/noamross/zero-dependency-problems/blob/master/R/find-multiple-maxima.md

I'm trying to write a for-loop that finds the high tide in a vector of 10-minute tide recordings. When it finds the high tide, I'd like it to spit that value into a new vector. I generated some simple sample data (attached) that simulates the dataset with integers. So far, I have:

d <- read.csv("numbers.csv", header=T)

m=0

for (i in 1:length(d$numbers)) {

if(d$numbers[i]>=m) {d$numbers[i] -> m} 

else {m=m}

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant