Displaying 20 results from an estimated 10000 matches similar to: "printing POSIXct values in table labels"
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
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
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
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 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
2002 Apr 30
2
display of character NA's in a dataframe in 1.5.0
I understand that NA's in character vectors are displayed differently than NA's
in factor vectors.
> c("x", NA, "y")
[1] "x" NA "y"
> as.factor(c("x", NA, "y"))
[1] x <NA> y
Levels: x y
That seems sensible enough. But shouldn't I see the same behavior in a dataframe?
> test <- data.frame(a =
2001 Jul 17
2
variations in how long commands take
We are performming a series of S+ 6.0 versus R 1.3 comparisons. (If anyone has
already written scripts for this purpose, we would be eager for a copy.) The
purpose is to see if there are any "gotchas" -- places were S+ works and R
doesn't -- that would prevent us from going all the way over to R. (We have
lots of legacy code, so the conversion costs are non-trivial.) As part of this
2001 Sep 26
1
Characters vectors, NA's and "" in merges
I often use merge with dataframes that contain character vectors which have
elements that are sometimes "NA" (meaning the string NA, not the same thing,
obviously, as NA in a numeric or factor vector). For example, the stock ticker
for Nabisco was "NA". Unfortunately (for me), it seems like merge insists on
inserting "NA" for missing values. My question: Is there some
2002 May 29
1
warning message for setAs when using class AsIs
This seemed too advanced for r-help and is related to the recent discussion of
character vectors in dataframes.
Following Brian Ripley's most excellent advice, we are moving to a world in
which character vectors in dataframes are always of class AsIs. The cool way of
doing this seemed to be the following:
> cat(c("x", "y", "z"), file = "test.txt",
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
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
2003 Apr 28
1
ylab in time series plot (PR#2869)
You get a warning message when you specify a ylab parameter while
plotting data whose x's are POSIXct values. Apparently the
`axis.POSIXct' method tries to reset the ylab---via the ...
parameter---after it has already been set by higher level methods.
Here is a function that illustrates the problem.
ylabProblem <- function() {
x <- ISOdate(2003, 4, 1:10) # POSIXct
2001 May 22
1
dates
I am just starting to play with R. What is the recommended manner for dealing
with dates? In particular, should I be using the "chron" or the "date" package
or working with some of the facilities in base R like strptime?
My needs are very limitted. I have variables that, in S+ 6.0, I treat as
timeDate objects. I rarely need to do more than read in the information from
text
2001 Oct 09
0
Problems merging with POSIXct objects and all = TRUE (PR#1121)
I am having problems using merge with all = TRUE when one of the dataframes has
objects of class POSIXct. Here is an example:
> version
_
platform sparc-sun-solaris2.6
arch sparc
os solaris2.6
system sparc, solaris2.6
status
major 1
minor 3.0
year 2001
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 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
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 Jul 23
1
colClasses = "logical" produces all FALSE when input is 1/0
It seems to me that colClasses = "logical" in read.table produces incorrect results when
the input file has `1' and `0' in it. Although, it is perhaps just as likely
that I am misunderstanding the documentation.
Here is a simple example:
> file.show("test.txt")
x
1
0
1
> read.table("test.txt", header = TRUE)
x
1 1
2 0
3 1
This result is fine.
>
2000 Jul 05
2
eigen function on Solaris2.6 (PR#595)
Full_Name: Sharon Kuhlmann
Version: 0.99
OS: solaris2.6
Submission from: (NULL) (129.16.167.231)
When I use the function > eigen(x), it gives me a "Process R bus error",
and the program quits.
I'm running the following R version:
platform sparc-sun-solaris2.6
arch sparc
os solaris2.6
system sparc, solaris2.6
status Patched
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