konstantinos christodoulou
2023-Jul-25 11:29 UTC
[R] Seeking Assistance: Plotting Sea Current Vectors in R
Dear Rcommunity, I hope this email finds you well. I am writing to seek your assistance with a data visualization problem I am facing while working with R. Problem Description: I have a dataframe named "df" containing the following columns: "longitude", "latitude", "sea_currents_mag", and "sea_currents_direction". The dataframe includes sea current estimations, with information about magnitude (m/s) and direction (degrees) at various longitude and latitude coordinates. The study domain covers the Eastern Mediterranean Sea (23E to 36W) and extends from 31S to 37N. It is important to note that the longitude and latitude coordinates are not evenly spaced across the domain. Objective: I am seeking guidance on how to create a plot that visualizes the sea current vectors (arrows) at each coordinate. Additionally, if possible, I would like the borders of the surrounding countries to be included in the plot to provide geographic context. Specific Requests: 1. Help with plotting sea current vectors (arrows) based on "sea_currents_mag" and "sea_currents_direction" at each corresponding longitude and latitude coordinate. 2. Assistance with including the borders of the surrounding countries in the plot to provide geographic context. I would highly appreciate any advice, code examples, or packages that could assist me in achieving this visualization goal. Thank you very much for taking the time to read my email, and I look forward to any assistance you can provide. Best regards, Kostas [[alternative HTML version deleted]]
PIKAL Petr
2023-Jul-25 12:56 UTC
[R] Seeking Assistance: Plotting Sea Current Vectors in R
Not sure if correct but Chatgpt answer is: Here are some popular R packages for sea current vectors: oce: The "oce" package provides a wide range of functions for oceanographic data analysis, including handling sea current data. It allows you to work with current data in various formats and provides functions for visualization and basic analysis. oceanmap: The "oceanmap" package is specifically designed for the analysis and visualization of oceanographic data. It includes functions for mapping oceanographic variables, including sea current vectors, using ggplot2-based plotting techniques. rOceans: This package is part of the "rOpenSci" project and focuses on accessing various oceanographic datasets, including sea current data. It provides functions to download and work with sea current data from online sources. marmap: While "marmap" is primarily designed for bathymetric data (depth measurements of the ocean), it can be useful for visualizing sea current vectors in the context of oceanographic maps. ncdf4: The "ncdf4" package allows you to work with netCDF files, which are commonly used to store oceanographic data, including sea current data. It enables you to read, write, and manipulate netCDF files in R. oceanoGrafia: The "oceanoGrafia" package provides tools for oceanographic data analysis, including sea current vectors. It supports various data formats and offers functions for data processing and visualization. ocean: The "ocean" package is designed for oceanographic data analysis and visualization, including sea current data. It offers functions for data manipulation, transformation, and plotting. Cheers Petr -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of konstantinos christodoulou Sent: Tuesday, July 25, 2023 1:29 PM To: r-help mailing list <r-help at r-project.org> Subject: [R] Seeking Assistance: Plotting Sea Current Vectors in R Dear Rcommunity, I hope this email finds you well. I am writing to seek your assistance with a data visualization problem I am facing while working with R. Problem Description: I have a dataframe named "df" containing the following columns: "longitude", "latitude", "sea_currents_mag", and "sea_currents_direction". The dataframe includes sea current estimations, with information about magnitude (m/s) and direction (degrees) at various longitude and latitude coordinates. The study domain covers the Eastern Mediterranean Sea (23E to 36W) and extends from 31S to 37N. It is important to note that the longitude and latitude coordinates are not evenly spaced across the domain. Objective: I am seeking guidance on how to create a plot that visualizes the sea current vectors (arrows) at each coordinate. Additionally, if possible, I would like the borders of the surrounding countries to be included in the plot to provide geographic context. Specific Requests: 1. Help with plotting sea current vectors (arrows) based on "sea_currents_mag" and "sea_currents_direction" at each corresponding longitude and latitude coordinate. 2. Assistance with including the borders of the surrounding countries in the plot to provide geographic context. I would highly appreciate any advice, code examples, or packages that could assist me in achieving this visualization goal. Thank you very much for taking the time to read my email, and I look forward to any assistance you can provide. Best regards, Kostas [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Osobn? ?daje: Informace o zpracov?n? a ochran? osobn?ch ?daj? obchodn?ch partner? PRECHEZA a.s. jsou zve?ejn?ny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner?s personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/ D?v?rnost: Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a podl?haj? tomuto pr?vn? z?vazn?mu prohl??en? o vylou?en? odpov?dnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/
Hi Kostas, The function vectorField in the plotrix package may do what you want. See the example. Jim On Tue, Jul 25, 2023 at 9:30?PM konstantinos christodoulou <konstantinos.christodoulou1 at gmail.com> wrote:> > Dear Rcommunity, > > I hope this email finds you well. I am writing to seek your assistance with > a data visualization problem I am facing while working with R. > > Problem Description: > > I have a dataframe named "df" containing the following columns: > "longitude", "latitude", "sea_currents_mag", and "sea_currents_direction". > The dataframe includes sea current estimations, with information about > magnitude (m/s) and direction (degrees) at various longitude and latitude > coordinates. The study domain covers the Eastern Mediterranean Sea (23E to > 36W) and extends from 31S to 37N. It is important to note that the > longitude and latitude coordinates are not evenly spaced across the domain. > > Objective: I am seeking guidance on how to create a plot that visualizes > the sea current vectors (arrows) at each coordinate. Additionally, if > possible, I would like the borders of the surrounding countries to be > included in the plot to provide geographic context. > > Specific Requests: > > 1. Help with plotting sea current vectors (arrows) based on > "sea_currents_mag" and "sea_currents_direction" at each corresponding > longitude and latitude coordinate. > 2. Assistance with including the borders of the surrounding countries in > the plot to provide geographic context. > > I would highly appreciate any advice, code examples, or packages that could > assist me in achieving this visualization goal. > > Thank you very much for taking the time to read my email, and I look > forward to any assistance you can provide. > > Best regards, > Kostas > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.