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

combine-named-data-frames #9

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

combine-named-data-frames #9

noamross opened this issue Mar 22, 2015 · 0 comments

Comments

@noamross
Copy link
Owner

https://github.com/noamross/zero-dependency-problems/blob/master/R/combine-named-data-frames.md

I would like to add a title to each of the resulting dataframes and then after applying rbind, have a column in the resulting combined file that identifies each so I can compare values.

This is what the code looks like right now. I need the next steps.

f <- c("NoChange_MINU", "T5only_MINU", "P2Only_MINU","t2p5_MINU")
s <- stack(f)
names(s) <- gsub('_MINU', '', f)
rcl <- matrix(c(0,0.2,1, 0.2, 0.4,2,.4,.6,3,.6,.8,4,.8,1,5), ncol=3, byrow=T)
r <- reclassify(s, rcl)
rl = list()
for (i in 1:nlayers(r)) { rl[[i]] = zonal(a, r[[i]], 'sum') }
rl
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