similar to: dates

Displaying 20 results from an estimated 4000 matches similar to: "dates"

2002 Apr 08
2
subsetting with NA's
Hi, I often have large dataframes with many variables and many NA's, from which I would like to subset out some rows. Here is a toy example: > x <- data.frame(a = c("x", "y", "z"), b = c(1, NA, 5)) > x a b 1 x 1 2 y NA 3 z 5 I realize that, if I know the values in x$b that I want to subset, things are easy: > x[x$b %in% c(1),] a b 1 x 1
2001 Aug 31
1
--quiet flag sets echo option to TRUE (PR#1083)
The help for options says: echo: logical. Only used in non-interactive mode, when it controls whether input is echoed. Command-line options `--quiet' and `--slave' set this initially to `FALSE'. I don't think that this is correct for me. Consider the following session: mica|junk> ls test.R mica|junk> cat test.R cat("Why was this command
2001 Nov 29
3
package argument to library as string
The help page for library says that: package, help: name or character string giving the name of a package. Yet, I don't seem to be able to use a string variable here. > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1
2002 May 20
1
(PR#1577) is.na<- coerces character vectors to be factors
The inconsistency is that you use $<- to set the column, then [[<- to change it. Had you tried to set the column by x[[1]] <- as.character(x[[1]]) you would have seen the problem immediately (it does not work as you would have intended). If you want to be sure to turn off conversion to factor, you need to set the column to class "AsIs". My belief is that will behave
2002 Apr 30
3
rbind'ing empty rows in dataframes in 1.4.1 versus 1.5.0
Hi, In 1.4.1, I was able to create extra "empty" rows in a dataframe as so: > x <- data.frame(a = letters[1:3], b = 1:3) > x a b 1 a 1 2 b 2 3 c 3 > x[4,] a b NA NA NA > rbind(x, x[4,]) a b 1 a 1 2 b 2 3 c 3 NA NA NA > R.version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6
2001 Oct 04
1
Strange behavior with saved character vectors containing a slash
I am seeing some strange behavior using save on a character vector containing a slash. If this is a bug, I will happily submit it (as a single entry! ;-) ) to r-bugs. Here is an example involving "VIA\B". > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create objects of class AsIs: > I("a") [1] "a" attr(,"class") [1] "AsIs" "character" > I(4) [1] 4 attr(,"class") [1] "AsIs" "numeric" > I(4 + 0i) [1] 4+0i attr(,"class") [1] "AsIs" "complex" > This
2002 May 08
3
Suggestions for poor man's parallel processing
Almost all of the heavy crunching I do in R is like: > for(i in long.list){ + do.something(i) + } > collect.results() Since all the invocations of do.something are independent of one another, there is no reason that I can't run them in parallel. Since my machine has four processors, a natural way to do this is to divide up long.list into 4 pieces and then start 4 jobs, each of which
2001 Oct 04
1
Problems merging with POSIXct objects and all = TRUE
I am having problems using merge with all = TRUE when one of the dataframes has objects of class POSIXct. If this is a bug, let me know and I will report it to r-bugs. Here is an example: > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1
2001 Oct 04
1
Bug when trying to save a character vector with an embedded / (PR#1115)
Here is an example involving "VIA\B". > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 3.0 year 2001 month 06 day 22 language
2002 Jul 10
1
bug in all.equal.character (PR#1767)
There is a bug in all.equal.character: > all.equal.character(c("A", "B", "C"), c("A", "B", "C")) [1] TRUE > all.equal.character(c("A", "B", "C"), c("A", "B", NA)) Error in sum(out) : Object "out" not found > traceback() 3: sum(out) 2: paste("`is.NA' value
2007 Mar 12
1
timeDate & business day
I have a daily time series and have two questions to get some help with. Firs,t I have dates in simple numeric values. e.g. ymd [1] 20050104 20050105 20050106 20050107 20050110 20050111 20050113 20050114 [9] 20050118 20050120 20050121 20050124 20050125 20050126 20050127 20050128 [17] 20050201 20050202 20050203 20050204 Now, I'd like to compute statistics, e.g. acf, by business days. So, I
2003 Jan 09
2
Warnings with no INDEX file in a package.
In previous versions of R (at least in 1.5.1, I think), my practice was not to include an INDEX file in the package. R CMD check did not complain and an INDEX was created for me when I use R CMD build. At least, this is how I remember it. I thought that this was a good way to behave since it ensured that my INDEX was automatically kept up to date by R, without me having to worry about what
2002 May 14
0
FW: Summary of Suggestions for poor man's parallel processing
It turns out that my web host doesn't allow direct links. Try going to http://www.warnes.net/downloads or getting it from the sourceforge snippet library https://sourceforge.net/snippet/detail.php?type=snippet&id=101149. -Greg > -----Original Message----- > From: Warnes, Gregory R [mailto:gregory_r_warnes at groton.pfizer.com] > Sent: Monday, May 13, 2002 10:15 AM > To:
2002 Oct 18
0
Correct placement of .tex files in an R package
I have a package in which I would like to store a LaTeX .tex file. It is not documentation on any particular function, but is related to the package. In thought that I could just create a "doc" directory under the "inst" subdirectory and place it there. I thought that things in "inst" were just recursively copied when the package was installed. Alas, when I check the
2001 Nov 06
1
R CMD check, undoc and package checking
As cool and wonderful as the package checking tools for R are, I sometimes am stymied when trying to track down a problem. For example, I occasionally see error messages when running R CMD check like the following: [...] * checking Rd files ... OK * checking for undocumented objects ... ERROR * in parse(file, n, text, prompt) : syntax error on line 932 * in undoc(dir =
2002 Mar 08
2
Sys.putenv environment variables disappear (PR#1371)
Environment variables set with Sys.putenv() disappear (i.e. become "") after a while, especially after heavy-duty I/O. Example: R> x <- matrix(1., 3000, 3000) R> save(x, file="myx.RData") R> Sys.putenv(HOME="/tmp") R> while (Sys.getenv("HOME") != "") {cat("ok\n"); load("myx.RData")} The loop prints
2003 Dec 04
5
Processing calendar dates with R
I am a beginner in R with a background in SAS. Are there built-in R methods of reading dates for calculating elapsed days between two calendar dates? If so, are there any examples I can browse? Thanks in anticipation. John Byrne. Lecturer in Information Systems. Australian Catholic University.
2001 Jul 24
1
strptime and "impossible" dates
Typically, when I use strptime with "impossible" dates I get an NA, which is what I expect. > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 3.0 year 2001 month 06
2004 Mar 01
6
Find out the day of week for a chron object?
I know that this is correct: library(chron) x = dates("01-03-04", format="d-m-y", out.format="day mon year") print(x) It gives me the string "01 Mar 2004" which is correct. I also know that I can say: print(day.of.week(3,1,2004)) in which case he says 1, for today is monday. My question is: How do I combine these two!? :-) I have a