Displaying 20 results from an estimated 6000 matches similar to: "Seek general information about time/date storage and functions in R"
2006 Sep 27
3
Space required by object?
Does R provide a function analogous to LS() or str() that reports the
storage space, on disk or in memory, required by objects?
Ben Fairbank
2006 Dec 14
5
Better way to change the name of a column in a dataframe?
Hello R users --
If I have a dataframe such as the following, named "frame" with the
columns intended to be named col1 through col6,
> frame
col1 col2 cmlo3 col4 col5 col6
[1,] 3 10 2 6 5 7
[2,] 6 8 4 10 7 1
[3,] 7 5 1 3 1 8
[4,] 10 6 5 4 9 2
and I want to correct or otherwise change the
2007 Jan 19
4
Newbie question: Statistical functions (e.g., mean, sd) in a "transform" statement?
Greetings listeRs -
Given a data frame such as
times
time1 time2 time3 time4
1 70.408543 48.92378 7.399605 95.93050
2 17.231940 27.48530 82.962916 10.20619
3 20.279220 10.33575 66.209290 30.71846
4 NA 53.31993 12.398237 35.65782
5 9.295965 NA 48.929201 NA
6 63.966518 42.16304 1.777342 NA
one can use "transform" to
2007 Apr 24
4
Size of an object in workspace
Hi folks,
Is there a function to show the size of an R object? eg. in Kbytes?
Couple months ago Bendix Carstensen posted this marvelous little function lls(), which shows all objects in the current workspace by mode, class and 'size'. This is a wonderful enhancement to the build-in ls() already and I now have it sourced in my Rprofile.site at startup.
The only drawback is,
2006 Jan 05
2
Splitting the list
I've changed the heading because this really is another thread. I
think it inevitable that there will, in the course of time, be other
lists that are devoted, in some shape or form, to the concerns of
practitioners (at all levels) who are using R. One development I'd
not like to see is fracture along application area lines, allowing
those who are comfortable in coteries whose
2008 Jun 20
2
The Green Book and its relevance to R
I bogged down about half way through reading the Green Book, in part
because it became increasingly difficult to understand how some of the
ideas related to R, as opposed to S (which I have not used). Does any
reader know whether there is a document that points out differences
between S and R that would be helpful in reading the Green Book?
Ideally, perhaps, I need a "crib sheet" to
2006 May 13
2
What does it mean to be "masked from data" when attaching? (Newbie question)
I have several data frames, each with six variables and several hundred
cases broken out from a larger dataframe by eleven values of a factor
called "Division". I have to perform the same analysis on each one. I
would like to do it by creating a data frame called data2 eleven times,
once with data corresponding to each value of the factor, and performing
the same analysis on each of
2024 Oct 10
1
Typo in DateTimeClasses.Rd
Hello,
When following a thread that started today [1], I read the documentation
for DateTimeClasses {base} more carefully and noticed a typo in the
"Details on POSIXlt" section, in the paragraph right after the
components list.
The original and corrected are "he" instead of "the".
From earlier versions of R, he last two components will not be present
for
2008 Jan 30
1
"hist" combines two lowest categories -- is there a workaround?
When preparing a series of histograms I found that hist was combining
the two lowest categories or bins, 1 and 2. Specifying breaks, as
illustrated below, resulted in the correct histogram:
values <- sample(10,500,replace=TRUE)
hist(values)
hist(values,breaks = 0:10)
Apparently, the number of values strictly less than 1 is shown in the
first bin (and since none is less than 1,
2005 Jun 28
1
Using data frames for EDA: Insert, Change name, delete columns? (Newcomer's question)
I am finding complex analyses easier than some elementary operations in
R. In particular I want to do some low level exploratory data analyses
with data in a data frame but cannot find commands to easily insert,
remove (delete), rename, and re-order (arbitrarily, not sort) columns.
I see that the micEcon package has an insertCol command, but that is for
matrices, not data frames. I have looked
2007 Feb 12
1
'Save Workspace' gives "recursive default argument reference" -- workaround?
When signing off R or trying to save a workspace in Windows XP pro SP2,
I receive the following error message -
save.image("C:\\Program Files\\R\\R-2.4.1\\Responses3.RData")
Error in save.image("C:\\Program Files\\R\\R-2.4.1\\Responses3.RData") :
recursive default argument reference
Everything else seems to work fine, and the only function I have written
2007 Jan 16
1
RODBC: sqlQuery is successful, but a similar sqlFetch returns error
Greetings guRus --
I have successfully queried a large (24,445 rows by 281 cols.) in-house
database using the following RODBC query (without the line breaks)
testout <- sqlQuery(channel, "select idSchedule,EXCL_Total from
dbo.vwC1198_2006_RawData_With_CMPL_EXCL")
This returns a dataframe of 24445 rows and two columns (as intended),
but the following command
testout
2005 Nov 23
3
date/time arithmetic
On the help page "DateTimeClasses {base}" it says:
"One can add or subtract a number of seconds or a difftime object
from a date-time object, but not add two date-time objects."
However,
> x<-Sys.time(); y<-Sys.time()+3600
> diff<-y-x
> x; y; diff
[1] "2005-11-23 19:58:20 GMT"
[1] "2005-11-23 20:58:20 GMT"
Time difference of 1 hours
2012 Dec 06
1
Incorrect DST time changes in DateTimeClasses
Can anyone please shed any light on why R DateTimeClasses give weird times for when daylight saving time information changes, and which aren't consistent with the OS?
Example:
Expected result: in New Zealand DST stopped (NZDT -> NZST) at 03:00 NZDT on 2010-04-04, as confirmed by the OS time zone info (OS X 10.8.2):
zdump -v /etc/localtime
/etc/localtime Sat Apr 3 13:59:59 2010 UTC
2007 Jan 26
2
Use a text variable's value to specify another varaible?
Greetings guRus --
If a variable, e.g., 'varname', is a character string, e.g. varname <-
"datavector", and I want to apply a function, such as table(), to
datavector, what syntax or method will do so using only the variable
varname? This seems similar to indirect addressing, but I have not seen
a method for it in the R manuals. Is there a general name for such
indirect
2007 Mar 19
3
R4.1: seq.POSIXt, tz="AEST" (PR#9572)
Times from seq.POSIXt come out wrong in AEST timezone around Feb 29 every
leap year before 1970 (on Windows XP).
According to help(DateTimeClasses), this is handled by "our own C code".
> x <- as.POSIXct("1968-02-27") # tz="AEST"
> x.gmt <- as.POSIXct("1968-02-27", tz="GMT")
> data.frame(
GMT=seq(x.gmt, by="day",
2009 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar
date)?
And what is the recommended way to get the time of day from a POSIXct
object? (Not a string representation, but a computable representation.)
I have looked in the man page for DateTimeClasses, in the Time Series
Analysis Task View and in Spector's Data Manipulation book but haven't found
these. Clearly I can
2020 Apr 06
2
Help useRs to use R's own Time/Date objects more efficiently
> (1) Create a top-level help page with a title like "Date and Time
> Classes" to give a brief but general overview. This would mean the
> existing DateTimeClasses would need a new title.
I wanted to modify my first suggestion.
Perhaps a better idea would be to reference an external document
giving an overview of the subject.
I couldn't find a discussion of POSIXct/POSIXlt
2011 Oct 05
2
any way to convert back to DateTime class when "accidental" conversion to numeric?
Hi,
In short, I would like to know if there is any way to convert a numeric
into a date, similar to how strptime() can convert a string to a date time
class?
There are some functions, etc. which don't work well with dates, and
tend to force them into numerics. I understand that the number it spits
back is the number of seconds since the beginning of 1970 (see the first few
sentences
2005 Jan 31
4
aggregating dates
I have a frame which contains 3 columns:
"date" "defectnum" "state"
And I want to get the most recent state change for a given defect number. date is POSIXct.
I have tried:
aggregate(ev$date, by=list(ev$defectnum), max)
Which appears to be working except that the dates seem to come back as integers (presumably the internal representation of POSIXct).
When I