Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

13. Miscellaneous Graphs > Creating a Vector Field

Creating a Vector Field

Problem

You want to make a vector field.

Solution

Use geom_segment(). For this example, we’ll use the isabel data set:

library(gcookbook) # For the data set
isabel

         x        y      z        vx        vy           vz         t    speed
 -83.00000 41.70000  0.035        NA        NA           NA        NA       NA
 -83.00000 41.62786  0.035        NA        NA           NA        NA       NA
 -83.00000 41.55571  0.035        NA        NA           NA        NA       NA
 ...
 -62.04208 23.88036 18.035 -12.54371 -5.300128 -0.045253485 -66.96269 13.61749
 -62.04208 23.80822 18.035 -12.56157 -5.254994 -0.020277001 -66.98840 13.61646
 -62.04208 23.73607 18.035 -12.78071 -5.259613  0.005555035 -67.00575 13.82064

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint