Displaying 20 results from an estimated 44 matches for "sdate".
Did you mean:
date
2017 Sep 11
2
Σχετ: show 0 at y axis in xyplot lattice
Dear Bert and all,
I am really sorry. This is the full code:
dat<-read.csv("example.csv")attach(dat)
sdate<-as.Date(Date, format="%Y-%m-%d")
#change the colour of the strip background
my.settings <- canonical.theme(color=FALSE)
my.settings[['strip.background']]$col <- "blue"
dat_key <- list(space="right",
??????????????? lines = list(type = c("b&qu...
2017 Sep 11
4
show 0 at y axis in xyplot lattice
...n't want to be aligned with the x axis. I want to be a little bit above.
I have tried many options but I don't get what I want. I also tried ylim=c(0, 80) but both 0 and 80 are fully aligned with the x-axis and the upper boundary of the plot, respectively:
xyplot(upper.zn + Zn2 + lower.zn ~ sdate | Location, type="b", as.table=TRUE, data=dat, pch=c(22, 21, 22), lty=c(2, 1, 2), ylim=c(0, 80),
?????? index.cond=list(c(3, 1, 2)), ylab="Percent (%)", par.strip.text=list(col="white", font=2, lines=1.5),
?????? lattice.options = modifyList(lattice.options(), list(ski...
2017 Sep 11
0
show 0 at y axis in xyplot lattice
1. Not reproducible since my.settings, dat_key, sdate not provided.
2. Why did you not try something like ylim = c(-5,80) ?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon,...
2017 Sep 11
0
show 0 at y axis in xyplot lattice
...ey Breathed in his "Bloom County" comic strip )
On Mon, Sep 11, 2017 at 2:38 PM, Maria Lathouri <mlathouri at yahoo.gr> wrote:
> Dear Bert and all,
>
> I am really sorry. This is the full code:
>
> dat<-read.csv("example.csv")
> attach(dat)
>
> sdate<-as.Date(Date, format="%Y-%m-%d")
>
> #change the colour of the strip background
> my.settings <- canonical.theme(color=FALSE)
> my.settings[['strip.background']]$col <- "blue"
>
> dat_key <- list(space="right",
>...
2008 Apr 23
1
Time arithmetic
...there a calendar
system in R?
I have written a function to add months to a date and return the number of
days resulting. I am newish to R so I am hoping there is a package that
can do this sort of date arithmetic for me...
Worik
DaysInMonths <- function(s,d){
## Days in d months from s
sdate <- MSTD(s)
## Get day, month and the year
sd <- as.double(days(sdate))
sm <- as.double(months(sdate))
sy <- as.double.difftime(years(sdate))
sm <- sm+d
while(sm > 12){
sm <- sm-12
sy <- sy+1
}
sdate2 <- MSTD(paste(sd,sm,sy,sep="/"))
r...
2017 Sep 12
2
Σχετ: show 0 at y axis in xyplot lattice
...),
#? ? ? lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)),
#? ? ? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"),
#? ? ? key=dat_key,
#? ? ? scales = list(x = list(at = sdate, labels = format(sdate, "%b-%y"))), xlab="Date",
? ? ? panel = function(x, y, ...) {
? ? ? ? panel.grid(h = -1, v = 0, lwd=1, lty=3, col="grey")
? ? ? ? panel.abline(v=dat$dDate, lwd=1, lty=3, col="grey")
? ? ? ? panel.xyplot(x, y, ...)
? ? ? ? }
? ? ? ? )
A...
2017 Sep 12
0
show 0 at y axis in xyplot lattice
...lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)),
# par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"),
# key=dat_key,
# scales = list(x = list(at = sdate, labels = format(sdate, "%b-%y"))), xlab="Date",
panel = function(x, y, ...) {
panel.grid(h = -1, v = 0, lwd=1, lty=3, col="grey")
panel.abline(v=dat$dDate, lwd=1, lty=3, col="grey")
panel.xyplot(x, y, ...)
}...
2010 Feb 23
1
Problem with strptime generating missing values where none appear to exist
...es between
two vectors of times. I have apparently no difficulty to convert the vectors
to the appropriate format using strptime. But, then difftime does not
calculate all the differences.
Here is the code and output:-
dob=strptime(as.character(datx$BDT),'%d-%b-%y'); dob$year=dob$year-100
sdate=strptime(as.character(datx$SDT),'%d-%b-%y')
head(dob); head(sdate)
[1] "1922-07-14" "1922-07-14" "1922-07-14" "1922-07-14" "1921-03-23"
"1921-03-23"
[1] "2001-08-27" "2001-08-27" "2001-08-27" "200...
2017 Sep 12
0
Σχετ: show 0 at y axis in xyplot lattice
...ce.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)),
> #? ? ? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"),
> #? ? ? key=dat_key,
> #? ? ? scales = list(x = list(at = sdate, labels = format(sdate, "%b-%y"))), xlab="Date",
> ? ? ? panel = function(x, y, ...) {
> ? ? ? ? panel.grid(h = -1, v = 0, lwd=1, lty=3, col="grey")
> ? ? ? ? panel.abline(v=dat$dDate, lwd=1, lty=3, col="grey")
> ? ? ? ? panel.xyplot(x, y, ......
2009 Jun 08
4
increase number of ticks on x axis of dates
My x axis is a series of daily dates (e.g., 01/01/2000, 01/02/2000,
etc.) from 2000 to end of 2008. The default only gives me 4 ticks. I
want more. Why doesn't this work?
sdate<-as.POSIXct(strptime(date,format="%m/%d/%Y"))
plot(ppt~sdate,type="l",ylim=c(0,47),col=1,lwd=1,pch=16,ylab="Salinity,
psu",xlab="Year",las=1,main="Duck Key Salinity",xaxt="n")
year.text=c("2001","2002",&quo...
2008 Dec 31
2
sdate<-as.POSIXct(strptime(date,format="%m/%d/%Y %H:%M"))
...strptime and the package CHRON, but still can't get there.
My simple task is that I want to plot salinity (S1 or S2) on y-axis and time on x-axis, but I want to use a lay-understandable representation of time (not Julian). If I use the following command, I can make a plot using "plot(S1~sdate)", where:
sdate<-as.POSIXct(strptime(date,format="%m/%d/%Y %H:%M"))
... however, every 00:00 time winds up being an NA. Here is an excerpt of the input data (this is a HUGE file):
index Date Julian S1 S2
24985 11/19/2006 00:00...
2005 Jul 18
5
colnames
Hi,
I have a matrix with column names starting with a character in [0-9]. After some matrix operations (e.g. copy to another matrix), R seems to add a character 'X' in front of the column name. Is this a normal default behaviour of R? Why has it got this behaviour? Can it be changed? What would be the side effect?
Thank you.
Regards,
Gilbert
[[alternative HTML version deleted]]
2012 Oct 01
2
Hmisc describe error
Describe fails for me with a message similar to what was an issue in 2008 and got fixed according to posts.
R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
# output truncated
> options(chmhelp = FALSE, help_type = "text")
> .help.ESS <- help
>
2002 Feb 22
1
Weekdays
...the number of days is a multiple of 7.
However, the number of weekend days in the tail is a little harder. It
depends on both the start date of the tail and the number of days in the
tail.
Any suggestions for a more elegant solution would be helpful.
Thanks,
Whit Armstrong
bdays <- function(sdate,edate)
{
sdate <- as.POSIXlt(sdate)
edate <- as.POSIXlt(edate)
length <- as.integer(difftime(edate,sdate))
weeks <- floor(length/7)
tail <- length%%7
# true no matter what day of the week the start date is
weekend.days <- weeks*2
weekend.days <- weekend.days + # num...
2010 Feb 23
0
subtracting 100 from strptime year vector generates missing values in POSIXct where none appear to exist in strptime year vector
...subtracting the 100?
Good thought - if I use difftime before subtracting 100 from dob$year, then there are no missing values!
But, it is not at all obvious to me why this should be so. Here are dob$years for the dates that go through OK after subtracting 100:-
> table(dob$year[!is.na(difftime(sdate,dob))])
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 46 48
2 12 18 20 24 32 40 52 44 16 30 20 40 62 41 46 60 33 15 16 28 21 23 16 16 4 4 4 4
and now here are the values for the dates that generate missing values:-
> table(dob$year[is.na(difftime(sdate,d...
2009 Jul 30
2
Question regarding sqldf
Hello,
I am having a problem using sqldf. I'm trying to choose a subset of
observations from a data set based on the date and maximum value of a
variable by date.
Here is the code I am using:
test<-sqldf("select distinct * from bextuse group by sdate having
bext=max(bext)",method="raw");
The result I get back is a data frame with 0 rows and 0 columns. I have
tried the code in another program that utilizes SQL, and I retrieve the
14 rows I was expecting to get.
I looked at the SQLite information on the web, and it mentions that...
2004 May 16
1
RE: wxGrid example
Kevin, should we check this in to CVS as one of the our distributed samples?
Curt
-----Original Message-----
From: Shashank Date [mailto:sdate@everestkc.net]
Sent: Sunday, May 16, 2004 4:30 PM
To: wxruby-users@rubyforge.org
Cc: curt@hibbs.com
Subject: wxGrid example
I am using the binary install of wxRuby 0.3.0 on WinXP(Home)
I could not find an example of using wxGrid, so I translated the simple
one from wxWidgets.org:...
2012 Mar 20
0
Google calendar is not working properly with gcal4ruby (0.2.6)
...vents][:traveller].upcase+'' - ''+params[:events][:title]
event = GCal4Ruby::Event.new(calendar)
event.title = title
event.content = params[:events][:content]
event.where = params[:events][:location]
event.start = Time.parse("#{sdate} at #{kstime} ")
event.end = Time.parse("#{edate} at #{ketime}")
if !event.save
return false
else
event_id = event.id
Event.add_event(event_id,params[:events][:traveller],params[:events][:title],
params[:events][:cont...
2007 Apr 27
0
Update of xlsReadWrite package
...imeAs = "numeric",
stringsAsFactors = default.stringsAsFactors() )
- write.xls( x, file,
colNames = TRUE,
sheet = 1,
from = 1,
rowNames = NA )
- dateTimeToStr( odate, format = "" )
- strToDateTime( sdate )
- dateTimeToIsoStr( odate, isoformat = "YYYY-MM-DD hh:mm:ss" )
- isoStrToDateTime( sdate )
o Download
- CRAN (v1.3.2; from within RGui) or
- http://treetron.googlepages.com/ (v1.3.3)
- direct link to package:
http://treetron.googlepages.com/xlsReadWrite_1.3.3.zip
- di...
2006 Aug 10
2
day, month, year functions
...I'm aware of the weekdays() and months() functions in the base package. But they return a character object which requires some coding to convert into a numeric value.
I've also tried the sday.of.week() in fCalendar but it doesn't like my date,
> sday.of.week(xx)
Error in Ops.Date(sdates, 10000) : %/% not defined for Date objects
Do these functions exist in some package I'm not aware of?
Thanks in adv.
Horace Tso