Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franssen, Wietse
WFRTools
Commits
8b51ec02
Commit
8b51ec02
authored
Mar 25, 2015
by
Franssen, Wietse
Browse files
Some minor details
parent
05df0569
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/WFRTools.R
View file @
8b51ec02
...
...
@@ -121,7 +121,8 @@ r2ggplotDataStructure <-function(data, timestep = 1) {
#' @export
ggplotje
<-
function
(
rdata
,
lon
=
NULL
,
lat
=
NULL
)
{
if
(
!
is.na
(
rdata
$
Dates
$
start
[
1
]))
{
title
=
paste0
(
rdata
$
Variable
$
longName
,
" ["
,
rdata
$
Variable
$
units
,
"]\n("
,
rdata
$
Dates
$
start
[
1
],
")"
)
# title=paste0(rdata$Variable$longName, " [",rdata$Variable$units,"]\n(" ,rdata$Dates$start[1], ")")
title
=
paste0
(
rdata
$
Variable
$
longName
,
" ["
,
rdata
$
Variable
$
units
,
"]\n("
,
as.character
(
as.Date
(
data
$
Dates
$
start
[
1
])),
")"
)
}
else
{
title
=
paste0
(
rdata
$
Variable
$
longName
,
" ["
,
rdata
$
Variable
$
units
,
"]"
)
}
...
...
@@ -143,9 +144,11 @@ ggplotje <-function(rdata,lon = NULL, lat = NULL) {
coord_equal
()
+
theme_bw
()
+
xlab
(
expression
(
Longitude
*
' '
*
degree
*
E
*
' '
))
+
ylab
(
expression
(
Latitude
*
' '
*
degree
*
S
*
' '
))
+
ylab
(
expression
(
Latitude
*
' '
*
degree
*
N
*
' '
))
+
theme
(
legend.title
=
element_blank
())
# xlab(expression(Longitude * ' ' * degree * E * ' ')) +
# ylab(expression(Latitude * ' ' * degree * S * ' ')) +
if
(
!
is.null
(
lon
)
&&
!
is.null
(
lat
))
{
zp1
<-
zp1
+
scale_shape_identity
()
+
geom_point
(
colour
=
"black"
,
size
=
10
,
aes_string
(
x
=
lon
,
y
=
lat
,
shape
=
3
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment