1

I wish to create contour of P = f(X,Y), where

X <- seq(-10, 10, 0.1)
Y <- seq(-10, 10, 0.1)

How do I create a grid of points and store them in data.frame/tibble of X and Y? such that for each value of X, Y ranges from -10 to 10. So that I can calculate P for all combinations of X and Y to draw contour.

Thanks

SiH
  • 1,378
  • 4
  • 18

1 Answers1

1

We can use crossing

library(tidyr)
crossing(X, Y)
akrun
  • 874,273
  • 37
  • 540
  • 662