It works, thanks a lot!
Cheers
-Original Message-
From: jim holtman [mailto:jholt...@gmail.com]
Sent: Monday, July 26, 2010 4:04 PM
To: Olivier Coupiac
Cc: r-help@r-project.org
Subject: Re: [R] search and replace in a list of strings
The most "usable" form is to convert it
The most "usable" form is to convert it to POSIXct since most of the
plotting routines know how to handle date/time. You could do:
myDate <- as.POSIXct(paste(WD$date, WD$time), format='%m.%d.%Y %H:%M:%S')
e.g.,
> as.POSIXct('07.07.2010 12:34:15', format='%m.%d.%Y %H:%M:%S')
[1] "2010-07-07 12:3
Hi everybody,
I have a 4*4 matrix WD of wind data of the following form:
> WD
$date
[1] "07.07.2010" "07.07.2010" "07.07.2010" "07.07.2010"
$time
[1] "00:00:00" "00:10:00" "00:20:00" "00:30:00"
$CH1Avg
[1] 3.02 3.04 2.94 2.71
I would like to transform the date and time strings in usable number
Dennis -- it does! However, how can a more generic situation be handled
where
South,North,East,West are replaced by x2,d6,qqw,mQ respectively? Thanks.
On Wed, Apr 14, 2010 at 11:41 PM, Dennis Murphy wrote:
> Hi:
>
> Does this work for you?
>
[[alternative HTML version deleted]]
_
Chuck wrote:
I have a dataframe with almost a million rows which has one column
with strings. That column has several entries with the words "South",
"North", "East" and "West" which I would like to replace with S, N, E,
and W, respectively. Obviously, I can use gsub multiple times df
$col2 <-
Hi:
Does this work for you?
> x <- sample(c('AB', 'ABC', 'ABCD', 'East', 'West', 'North', 'South'),
+ 100, replace = TRUE)
> table(x)
x
AB ABC ABCD East North South West
14111514131617
> x2 <- ifelse(x %in% c('East', 'West', 'North', 'South'), strt
I have a dataframe with almost a million rows which has one column
with strings. That column has several entries with the words "South",
"North", "East" and "West" which I would like to replace with S, N, E,
and W, respectively. Obviously, I can use gsub multiple times df
$col2 <- gsub("West", "W
7 matches
Mail list logo