Displaying 20 results from an estimated 10000 matches similar to: "Converting date format"
2010 Mar 12
6
Randomly sampling subsets of dataframe variable
Fellow R users,
I am stumped on what would seem to be something fairly simple.
I have a dataframe that has a variable named 'WEEK' that takes
the numbers 1:26 (26 week time-period) with each number repeated
five times consecutively (once for each weekday, Monday through
Friday). Ex. 111112222233333.....2626262626. I would like to
randomly extract two weekdays per five day week for
2007 Aug 07
1
how to convert decimal date to its equivalent date format(YYYY.mm.dd.hr.min.sec)
Hello R Users,
How to convert decimal date to date as YYYY.mm.dd.hr.min.sec
For example, I have decimal date in one column , and want to convert and
write it in equivalent date(YYYY.mm.dd.hr.min.sec) in another next six
columns.
1979.000000
1979.020833
1979.041667
1979.062500
Is it possible in R ?
Kindly help,
Regards,
Yogesh
--
Dr. Yogesh K. Tiwari,
Scientist,
Indian Institute
2011 Mar 22
2
Infinite loop
R experts,
Hello, I am trying to sample a vector 1:40 without replacement such that no element in the new vector
is within 7 units of either of its immediate neighbors. This is part of a larger program I am working
on. The following code works well about 65 % of the time (14/40). The problem I encounter happens when
the last element remaining to be sampled from the vector STRATA is within 7
2010 Apr 19
1
Week number calculation
R community,
How could I extract the week number from a date vector
(in class Date) such that week numbering (week 1...2...)
begins (May 01) and ends (October 31) on the same specific
dates each year?
Thank you,
Mike
2017 Jan 12
3
rgl
----Original Message-----
From: Martyn Plummer [mailto:plummerm at iarc.fr]
Sent: Thursday, January 12, 2017 3:36 AM
To: Weiner, Michael <weinerm at ccf.org>; r-sig-fedora at r-project.org
Subject: Re: [R-sig-Fedora] rgl
>One possibility is that you have the 32-bit version of mesa-libGL-devel installed. This will provide the headers but not the 64-bit l>ibrary which is what you need
2010 Mar 15
1
Assigning a sequence to a subsetted data frame variable
Hey folks,
I have a difficult (at least for me) problem that I was hoping
one of you may know how to solve. I want to assign a sequence
to subsets of a variable in a data frame based on date.
The variable is 'SITE1' and the date is a unique day (DD) and
month (MM) combination. The sequence contains site numbers 101:104,
and each day-month combination takes four site numbers from that
2010 Mar 02
2
Row-wisely converting a data frame into a list
Hello,
is there an elegant way, how I can convert each row of a data frame into
distinct elements of a list?
In essence, what I'm looking for is something like
rows.to.lists <- function( df ) {
ll <- NULL
for( i in 1:nrow(df) )
ll <- append( ll, list(df[i,]) )
return (ll)
}
but more done more efficiently (the data frame may contain ten-thousands
of rows). I thought about
2010 Jul 20
1
ifelse() and missing values in test conditions
R experts,
I have been unable to get the following ifelse statement to work as desired when applied
to my data frame.
Example:
DF$ANYEF <- with(DF,ifelse(PSOUGHT1=='ANY'|PSOUGHT2=='ANY'|PSOUGHT3=='ANY',PEFF,0))
##### this statement will be replicated 16 times for 16 unique _EF variables ###
Basically, I want each ANYEF for each row to equal the corresponding row
2010 Mar 17
3
Adding minutes to 24 hour time
Hi,
Does anyone know how to add minutes (up to 100 min) to a 24 hour time, to create a new 24 hour time? I can't seem to find any documentation or examples explaining how to do this. The variables of interest are 'ARRIVE','WAIT', and 'DEPART' in the attached partial dataframe. I want 'DEPART' to be the "sum" of 'ARRIVE' and 'WAIT' in
2010 Mar 16
2
Retrieving latitude and longitude via Google Maps API
Does anyone have any experience retrieving latitutde and longitude for
an address from the Google Maps API?
I'd like to have an R script that submits a street address, city, state,
and zip code and returns the coordinates. So far, I've been submitting
the coordinates from another program, then loading the coordinates in R
and merging them back into the data frame I want to use.
2006 Feb 16
3
How to convert SPSS date data to dates?
Dear R Helpers,
I have imported an SPSS file that contains date data.
The data appear in R in a numeric format, as follows:
10485849600 10477641600 10561104000 10562745600 etc.
I'd be extremely grateful if someone could tell me
how to make these numbers into comprehensible dates!
Thanks,
Jonathan Williams
2003 Nov 19
5
ISOdate returns incorrect date?
Dear all,
I have found the following (for me) incomprehensible behaviour of
ISOdate (POSIXct):
> ISOdate(1900,6,16)
[1] "1900-06-15 14:00:00 Westeurop?ische Sommerzeit"
> ISOdate(1950,6,16)
[1] "1950-06-16 14:00:00 Westeurop?ische Sommerzeit"
Note that in the first case I get the 15th of June back, not the 16th as
I would have expected!
This happened under R-1.7.1 on
2018 Jan 22
2
Manipulating two large dataset differing by date and time
Dear Members,
Compliments of the Season!!
Below is a part of a code I use for Fourier analysis of signals. The code
handles data with the format 05 01 01 8628 (year, month, day and count)
05 01 02 8589 (year, month, day and count)
The sample data is attached as 2005daily.txt.
I would like to adapt the code to handle data of the form:
05 01 01 00 4009
2003 Sep 12
2
Sorting a vector by date
Hello out there....
Again I have a problem and I stuck...
How can I sort a vector of dates?
For example I have the vector
a<-ISOdate(2001, 1, 1) + 70*86400*runif(10)
How can this vector be sorted chronological?
And what's the function I should work with to handle these entries?
(in sense of: which(a>2001-01-04) or somehting like that)
Thank you for helping
M.Kirschbaum
2017 Jan 11
2
rgl
I have a Fedora linux 24 64bit workstation I am trying to install rgl on and I keep running into this error:
trying URL 'https://cran.cnr.berkeley.edu/src/contrib/rgl_0.97.0.tar.gz'
Content type 'application/x-gzip' length 2369444 bytes (2.3 MB) ==================================================
downloaded 2.3 MB
* installing *source* package 'rgl' ...
** package
2002 May 01
1
converting #sec to POSIX* format
Sure I'm missing something simple here, but I haven't been able to find a
easy way to convert a pure numeric (# of seconds since the beginning of
1970) back into a POSIX* object.
ex.
> z<-as.POSIXct(Sys.time())
> z
[1] "2002-05-01 10:33:56 Mountain Daylight Time"
> x<-unclass(z)
> x
[1] 1020270836
Is there a simple way to transform x back into a POSIX*
2018 Jan 22
0
Manipulating two large dataset differing by date and time
Hi Ogbos,
You can just use ISOdate. If you pass more values, it will process them:
ISOdate(2018,01,22)
[1] "2018-01-22 12:00:00 GMT"
> ISOdate(2018,01,22,18,17)
[1] "2018-01-22 18:17:00 GMT"
Add something like:
if(is.null(data$hour),data$hour<-12
then pass data$hour as it will default to the same value as if you
hadn't passed it.
Jim
On Mon, Jan 22, 2018 at 6:01
2008 Dec 11
1
How to generate a prediction equation for a stratified survival model that was fitted by cph() in Design package
Dear all,
I used cph() function from Frank harrell's Design package to create a
survival model, then used functions 'Function' and 'sascode' to generate
prediction equation based on the saved survival model. But it failed. I
included a stratified variable in the model. If I removed the
stratification, they were working well. Does that mean that function
'Function'
2010 Feb 23
1
Circles around letters or numbers in plot title
Has anyone ever tried putting a circle around a letter or a number in a
plot title?
For instance, if I have a plot title "Scatterplot for Subject 24", I
want to put a circle around 24 to distinguish that plot from the other
30 I've generated. Any tips or ideas beyond plotting a circle in the
margin?
Benjamin
Benjamin Nutter | Biostatistician | Quantitative Health
2017 Jan 12
2
rgl
-----Original Message-----
From: Tom Callaway [mailto:tcallawa at redhat.com]
Sent: Thursday, January 12, 2017 8:25 AM
To: Weiner, Michael <weinerm at ccf.org>; r-sig-fedora at r-project.org
Subject: Re: [R-sig-Fedora] rgl
On 01/12/2017 08:01 AM, Weiner, Michael wrote:
> I resolved this by reinstalling mesa-libGL (dnf reinstall libGL) seems /lib64/libGL.so.1.2.0 was missing off the