Since you are loading lubridate it is enough to do
Atest$ddate1 <- dmy(Atest$ddate)
On Sun, Jun 9, 2024 at 11:59 PM Duncan Murdoch wrote:
>
> On 2024-06-09 4:39 p.m., Val wrote:
> > HI all,
> >
> > My
> > I am trying to convert character date (mm/dd/yy) to -mm-dd date
> > format in one of
On 2024-06-09 4:39 p.m., Val wrote:
HI all,
My
I am trying to convert character date (mm/dd/yy) to -mm-dd date
format in one of the columns of my data file.
The first few lines of the data file looks like as follow
head(Atest,10);dim(Atest)
ddate
1 19/08/21
2 30/04/18
Those a
Às 21:39 de 09/06/2024, Val escreveu:
HI all,
My
I am trying to convert character date (mm/dd/yy) to -mm-dd date
format in one of the columns of my data file.
The first few lines of the data file looks like as follow
head(Atest,10);dim(Atest)
ddate
1 19/08/21
2 30/04/18
3 28/0
And you will probably want to read the details of the ?round help, so
you understand how it handles 5 rounding. It is a little more
complicated than some of us learned in school.
On 11/22/2022 4:24 AM, Steven T. Yen wrote:
Thanks to all. And yes, Ivan, round() did it:
> dput(head(Mean))
c(
Thanks to all. And yes, Ivan, round() did it:
> dput(head(Mean))
c(afactfem = 0.310796641158209, afactblk = 0.188030178893171,
age = 45.3185794338312, nodiscfem = 0.506637018185968, discfem =
0.493362981814032,
notradgrol = 0.702915000493879)
> dput(head(Std.dev))
c(afactfem = 0.462819715443265
On Tue, 22 Nov 2022 08:15:57 +0800
"Steven T. Yen" wrote:
> Thanks to all, but no, signif() did not work:
It worked, just didn't do what you wanted it to do. I think you want
round(), not signif(). Some of your numbers (45.3185794) will be rounded
to 4 significant digits and others (0.096) w
???
> vals <- signif(cbind(c(.123,.0123), c(1.23,.00123)), digits = 2)
> print(vals)
[,1] [,2]
[1,] 0.120 1.2000
[2,] 0.012 0.0012
2 *significant* digits, but enough digits to right of decimal point to
**allow** the two significant digits to appear and have all numbers in
a column line up
Andrew's example works for him and for me.
If you want help, provide the output of
dput(head(Mean))
dput(head(Std.dev))
On November 21, 2022 4:15:57 PM PST, "Steven T. Yen" wrote:
>Thanks to all, but no, signif() did not work:
>
>> print(signif(cbind(Mean,Std.dev),digits=2))
> Mean Std.
Thanks to all, but no, signif() did not work:
> print(signif(cbind(Mean,Std.dev),digits=2))
Mean Std.dev
[1,] 0.310 0.46
[2,] 0.190 0.39
[3,] 45.000 16.00
[4,] 0.510 0.50
[5,] 0.490 0.50
[6,] 0.700 0.46
On 11/22/2022 5:41 AM, Andrew Simmons wrote:
For print()
,] 45.32 16.31
Regards
Duncan Mackay
-- Original Message --
From: "Jim Lemon"
To: "Steven T. Yen"
Cc: "R-help Mailing List"
Sent: Tuesday, 22 Nov, 2022 At 8:09 AM
Subject: Re: [R] Format printing with R
Hi Steven,
I thought that the problem might be in the
For print(), digits is the minimal number of significant digits. In
your case, rounding the first column to the 3rd decimal place gives at
least 2 sigfigs and rounding the second column to the 2nd decimal
place.
If you want to print all numbers to two significant digits, regardless
of what other n
For better reproducibility, use dput to share data. A matrix and a data frame
look similar, but they can act differently.
On November 21, 2022 1:09:55 PM PST, Jim Lemon wrote:
>Hi Steven,
>I thought that the problem might be in the two large numbers, but
>using a subset (I didn't want to edit ou
Hi Steven,
I thought that the problem might be in the two large numbers, but
using a subset (I didn't want to edit out all the line numbers), I get
what I expected:
sydf<-read.table(text="Mean Std.dev
[1,] 0.3107966 0.462820
[2,] 0.1880302 0.390736
[3,] 45.3185794 16.313635
[4,] 0.50663
Got it, thanks!
On Tue, Dec 14, 2021 at 11:59 AM Ivan Krylov wrote:
>
> On Tue, 14 Dec 2021 11:54:08 +0100
> Luigi Marongiu wrote:
>
> > "9/29/2021"
>
> > format = "%d/%m/%y"
>
> > Why the conversion did not work?
>
> The according to the format, the date above is 9th of month No. 29 in
> the ye
On 14/12/2021 12:54, Luigi Marongiu wrote:
Hello,
I have these kind of dates:
```
ori[[n[3]]]
they look to me as month, date, year so I formatted them as:
```
Looks like that to me also.
as.Date(ori[[n[3]]], format = "%D")
# or: as.Date(ori[[n[3]]], format = "%d/%m/%y")
But you form
On Tue, 14 Dec 2021 11:54:08 +0100
Luigi Marongiu wrote:
> "9/29/2021"
> format = "%d/%m/%y"
> Why the conversion did not work?
The according to the format, the date above is 9th of month No. 29 in
the year 2020, followed by junk characters "21". Swap %m and %d to make
them follow the actual o
Dear Luigi,
Quickly, I spot two problems:
1) "09/20/2021" can only be month/day/year (and not day/month/year as
you specified).
2) The year is given with century, so it should be upper case Y
So
as.Date(ori[[n[3]]], format = "%m/%d/%Y")
should work.
HTH,
Ivan
--
Dr. Ivan Calandra
Imaging lab
On 29/10/2021 1:21 p.m., Sam Albers wrote:
Hi all,
Does anyone know of a way to force utils::bibentry to mimic the BibTex
behaviour of using double { to force a "corporate name" in the author
field to print correctly? For example take this bibentry:
Enter it like this:
entry <- utils::bibentr
Maybe use \{ for the second one?
On Fri, Oct 29, 2021 at 11:22 AM Sam Albers
wrote:
> Hi all,
>
> Does anyone know of a way to force utils::bibentry to mimic the BibTex
> behaviour of using double { to force a "corporate name" in the author
> field to print correctly? For example take this biben
Marc Girondot via R-help writes:
> I would like format integer number as characters with leading 0 for a
> fixed width, for example:
>
> 1 shoud be "01"
> 2 shoud be "02"
> 20 should be "20"
formatC(x, width=2, flag="0")
signature.asc
Description: PGP signature
___
On Thu, Jan 04, 2018 at 09:12:12PM +0100, Marc Girondot via R-help wrote:
> Dear R-er,
>
> I would like format integer number as characters with leading 0 for a
> fixed width, for example:
>
> 1 shoud be "01"
> 2 shoud be "02"
> 20 should be "20"
>
> Now I use:
>
> x <- c(1, 2, 20)
>
> gsub("
Hi Pedro,
Try this:
par(mar=c(5,5,4,2))
plot(seq(0,9000,1000),yaxt="n",ylab="")
axis(2,seq(1000,9000,1000),
labels=formatC(seq(1000,9000,1000),format="f",
big.mark=",",digits=2),las=2)
Jim
On Sun, Jun 4, 2017 at 7:11 PM, Pedro páramo wrote:
> Hi all,
>
> I have been looking on documentation
Have you looked at the High Performance Computing Task View on CRAN?
Whatever you do, keep in mind that the algorithms you intend to apply will
have a strong impact on which data management approach is going to work best.
Start small before diving in with all your data, and try successively lar
What do you hope to do with this data while it is in R?
E.g., do you want to plot it, fit a model to it, to select a few
rows or columns from it, sort it, summarize lots of small subsets
of it, or something else?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Dec 28, 2015 at 1:39 PM, Mark F
Of course you could have created them as character vectors in the first
place:
dfx <- data.frame(
group = c(rep('A', 8), rep('B', 15), rep('C', 6)),
sex = sample(c("M", "F"), size = 29, replace = TRUE),
age = runif(n = 29, min = 18, max = 54),
stringsAsFactors=FALSE
)
But if that is no
Try as.character like the following shows.
> dfx <- data.frame(
+ group = c(rep('A', 8), rep('B', 15), rep('C', 6)),
+ sex = sample(c("M", "F"), size = 29, replace = TRUE),
+ age = runif(n = 29, min = 18, max = 54))
> dfx
group sex age
1 A M 41.35554346
2 A F 47.7
ginal Message-
> From: David Winsemius [mailto:dwinsem...@comcast.net]
> Sent: Monday, October 20, 2014 11:04 PM
> To: PIKAL Petr
> Cc: Marc Girondot; r-help@r-project.org
> Subject: Re: [R] format negative numbers
>
>
> On Oct 20, 2014, at 4:32 AM, PIKAL Petr wrote:
>
&g
; already invented clever way how to deal with such numbers.
>
> Cheers
> Petr
>
>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
>> project.org] On Behalf Of Marc Girondot
>> Sent: Monday, October 20, 2014 12:5
You could do it with minimal use of regular expressions, along the lines
of this example:
x <- c('123','2.31','2.313-', '45-')
is.neg <- grepl('-',x)
xn <- x
xn[is.neg] <- paste0( '-', substring(x[is.neg],1, nchar(x[is.neg])-1))
xn <- as.numeric(xn)
I made a copy, 'xn', so that
d clever way how to deal with such numbers.
Cheers
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Marc Girondot
> Sent: Monday, October 20, 2014 12:53 PM
> To: r-help@r-project.org
> Subject: Re: [R] form
Is it what you want?
> st <- "0.123-"
> gsub("(.+)(-)", "\\2\\1", st)
[1] "-0.123"
> st <- "0.123"
> gsub("(.+)(-)", "\\2\\1", st)
[1] "0.123"
Sincerely
Marc
Le 20/10/2014 09:03, PIKAL Petr a écrit :
Dear all.
Before I start fishing in (for me) murky regular expression waters I try to ask
co
Maybe not the most elegant way but at least works:
library( stringr )
x <- as.factor( "123.4-" )
x <- -as.numeric( str_replace( as.character( x ), "-", "" ) )
x
[1] -123.4
On Monday 20 October 2014 09:03:36 PIKAL Petr wrote:
> Dear all.
>
> Before I start fishing in (for me) murky regular expr
ime(as.character(dat1$Date), "%Y-%m-%d")
dat1$Date1txt <- format(dat1$Date1, "%Y%m%d")
Stefano
Da: arun [smartpink...@yahoo.com]
Inviato: martedì 4 marzo 2014 17.06
A: r-help@r-project.org
Cc: Stefano Sofia
Oggetto: Re: [R] format
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Stefano Sofia
> Sent: Tuesday, March 04, 2014 11:58 AM
> To: r-help@r-project.org
> Subject: [R] format for as.Date and inserting missing rows in a data
> frame
>
> Dear R use
Hi,
May be this helps:
dat <- read.table(text="Raingouge_number Station_number Year Month Day Rainfall
2004 2230 1951 1 1 2.60
2004 2230 1951 1 2 0.40
2004 2230 1951 1 3 0.00
2004 2230 1951 1 4 0.00
2004 2230 1951 1 5 0.20
2004 2230 1951 1 6 0.00
2004 2230 1951 1 7 0.00
2004 2230 1951 1 9 0.00
2004
Hi,
Would this work?
format(Sys.time(), "%Y_%m_%d_%I_%M_%p")
A.K.
On Wednesday, January 15, 2014 10:37 AM, "Yuan, Rebecca"
wrote:
Hello all,
I know that the following code will give me the format of the Sys.time() till
hour (%I), how can I get that till min? what shall I add between %I and
Hello Petr,
Thanks very much! This works!
Cheers,
Rebecca
-Original Message-
From: PIKAL Petr [mailto:petr.pi...@precheza.cz]
Sent: Wednesday, January 15, 2014 10:01 AM
To: Yuan, Rebecca; R help
Subject: RE: Format Sys.time()
Hi
format(Sys.time(), "%Y_%m_%d_%I_%M%p")
Petr
> -O
HI !!
try it
format(Sys.time(), "%Y_%m_%d_%X")
Best regards
...
Tanvir Ahamed
Göteborg, Sweden
From: "Yuan, Rebecca"
To: R help
Sent: Wednesday, 15 January 2014, 15:56
Subject: [R] Format Sys.time()
Hello all,
I know that th
Hi
format(Sys.time(), "%Y_%m_%d_%I_%M%p")
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Yuan, Rebecca
> Sent: Wednesday, January 15, 2014 3:56 PM
> To: R help
> Subject: [R] Format Sys.time()
>
> Hello all,
>
> I kno
I find that google is usually a better search engine for R topics
Google on "R fractions".
(I got, e.g.
http://stackoverflow.com/questions/5046026/print-number-as-reduced-fraction-in-r
)
-- Cheers,
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Informa
library(MASS)
fractions(outer(1/seq(1:3), 1/seq(1:3)))
# [,1] [,2] [,3]
#[1,] 1 1/2 1/3
#[2,] 1/2 1/4 1/6
#[3,] 1/3 1/6 1/9
A.K.
On Tuesday, December 31, 2013 10:27 AM, Michael Friendly
wrote:
Is there some way to format a matrix of fractions as fractions? I think
I've seen
-
From: Mathieu Basille [mailto:basille@ase-research.org]
Sent: Thursday, August 01, 2013 10:31 AM
To: R help
Cc: William Dunlap
Subject: Re: [R] 'format' behaviour in a 'apply' call depending on
'options(digits = K)'
Nicely spotted, Bill! You went much far
a R bug, or a OS-related bug, I don't know). Should I forward it to R-devel,
or some other place where R gurus may have a chance to look at it?
Mathieu.
Le 07/30/2013 02:34 PM, arun a écrit :
Hi Mathieu
yes, the original problem occurs in my system too. I am using R 3.0.1 on
linux mint 15. I
mint 15. I guess the default case would be trim=FALSE, but still it
>> looks very strange especially in ?apply(), as it starts from " 5"
>> onwards.
>>
>> sessionInfo()
>> R version 3.0.1 (2013-05-16)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
&g
William Dunlap
> Subject: Re: [R] 'format' behaviour in a 'apply' call depending on
> 'options(digits = K)'
>
> Nicely spotted, Bill! You went much farther than I could have. We can
> basically summarize the problem with the following simple example:
&g
arun a écrit :
Hi Mathieu
yes, the original problem occurs in my system too. I am using R 3.0.1 on linux
mint 15. I
guess the default case would be trim=FALSE, but still it looks very strange
especially in
?apply(), as it starts from " 99995" onwards.
sessionInfo()
R version 3.0.1 (2013-05-16
quot; " 4" " 5" " 6" " 7" " 99998" " 9"
> print(x[i], digits=3)
[1] 1e+04 1e+04 1e+04 1e+04 1e+04 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05
[13] 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+05 1e+0
t attached):
[1] plyr_1.8tools_3.0.1
- Original Message -
From: Mathieu Basille
To: arun
Cc: R help
Sent: Tuesday, July 30, 2013 2:29 PM
Subject: Re: [R] 'format' behaviour in a 'apply' call depending on
'options(digits = K)'
Thanks Arun for you
ached):
[1] plyr_1.8 tools_3.0.1
- Original Message -
From: Mathieu Basille
To: arun
Cc: R help
Sent: Tuesday, July 30, 2013 2:29 PM
Subject: Re: [R] 'format' behaviour in a 'apply' call depending on
'options(digits = K)'
Thanks Arun for your ans
c = FALSE,trim=TRUE)
id2[0:100010]
# [1] "0" "1" "2" "3" "4" "5" "99996" "7"
#[9] "8" "9" "10" "11" "12" &
06" "17" "18" "19" "100010"
id2 <- format(1:11, scientific = FALSE,trim=TRUE)
id2[0:100010]
# [1] "0" "1" "2" "3" "4" "5" "99996&quo
Thanks David for your interest. I have to admit that your answer puzzles me
even more than before. It seems that the underlying problem is way beyond
my R skills...
The generation of id2 is indeed quite demanding, especially compared to a
simple 'as.character' call. Anyway, since it seems to b
On Jul 30, 2013, at 9:01 AM, Mathieu Basille wrote:
> Dear list,
>
> Here is a simple example in which the behaviour of 'format' does not make
> sense to me. I have read the documentation and searched the archives, but
> nothing pointed me in the right direction to understand this behaviour. L
Hi,
Try
vec1<- c(10, 1000153846, 1000307692, 1000461538, 1000615385)
round(vec1/1e6,2)
#[1] 1000.00 1000.15 1000.31 1000.46 1000.62
#or
as.numeric(sprintf("%.2f",vec1/1e6))
#[1] 1000.00 1000.15 1000.31 1000.46 1000.62
A.K.
- Original Message -
From: Alaios
To: R help
Cc:
S
"array
bound exceeded". Does it has to do anything with the operating system? Does it
make any difference?
i hope there wont be any problemThanks in advance
Eliza
> From: macque...@llnl.gov
> To: eliza_bo...@hotmail.com; r-help@r-project.org
> Subject: Re: [R] FORMAT EDITING
You say, "Š use the R output file in Fortran Š "
I guess that means that R is writing an output file which will then be
used as an input file for a fortran program.
In that case, you need to go back to how R is writing the output file,
find out why it is writing blank lines, and correct it. As far
Hi Elisa,
It seems also that there are spaces between the second '.' and the number
(1901.11. 1).
You could do something like:
Lines1<-readLines(textConnection("1901.11. 1 447.000
1901.11. 2 445.000
1901.11. 3 445.000
1924.11. 4 445.000
1924.11. 5 449.000
1924.11. 6 442.000
ges
> Cc: r-help@r-project.org
> Subject: Re: [R] Format of numbers in plotmath expressions.
>
>
>
> Thanks Uwe. I think your recipe is substantially sexier than mine.
>
> However I will, I believe, ***NEVER*** understand how to put together
> plotmath con
Thanks Uwe. I think your recipe is substantially sexier than mine.
However I will, I believe, ***NEVER*** understand how to put together
plotmath constructs. They seem to require some subset of:
* expression()
* bquote()
* substitute()
* parse()
* paste()
* as.express
On 05.10.2012 09:30, Rolf Turner wrote:
I want to do something like:
TH <- sprintf("%1.1f",c(0.3,0.5,0.7,0.9,1))
plot(1:10)
legend("bottomright",pch=1:5,legend=parse(text=paste("theta ==",TH)))
Notice that the final "1" comes out in the legend as just plain "1" and NOT
as "1.0" although TH i
> as.POSIXct("5/1/2012 8:00:00 PM", format = "%m/%d/%Y %I:%M:%S %p")
[1] "2012-05-01 20:00:00 EDT"
On Mon, Jul 16, 2012 at 9:26 AM, Lauren Vogric
wrote:
> How do I format "5/1/2012 8:00:00 PM" into a date?
>
>
> [[alternative HTML version deleted]]
>
> ___
Ms Vogric,
as.POSIXct should be able to help there...
On 16 July 2012 06:40, Jessica Streicher wrote:
> ?Date
> ?POSIXct
>
> and here you can find the formatting symbols:
> http://stat.ethz.ch/R-manual/R-patched/library/base/html/strptime.html
>
>
> On 16.07.2012, at 15:26, Lauren Vogric wrote:
?Date
?POSIXct
and here you can find the formatting symbols:
http://stat.ethz.ch/R-manual/R-patched/library/base/html/strptime.html
On 16.07.2012, at 15:26, Lauren Vogric wrote:
> How do I format "5/1/2012 8:00:00 PM" into a date?
>
>
> [[alternative HTML version deleted]]
>
>
Thank you, that's very useful.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 6/19/12 1:11 PM, "baptiste auguie"
wrote:
>Have a look at this:
>
>http://stackoverflow.com/questions/7734535/control-font-thickness-without-
Have a look at this:
http://stackoverflow.com/questions/7734535/control-font-thickness-without-changing-font-size
and
http://stackoverflow.com/questions/10686054/outlined-text-with-ggplot2
which refers to a base graphics version.
HTH,
b.
On 20 June 2012 07:58, MacQueen, Don wrote:
> I'm usin
Duncan,
On 25 March 2012 15:28, Duncan Murdoch wrote:
> In case anyone is interested, I want to output code in a language (GLSL)
> that sees 1 and 1. as different types. I want a floating point value, so I
> need the decimal point.
GLSL, assuming it's the one that I'm looking at[1], supports im
On 12-03-25 10:45 AM, Marc Schwartz wrote:
On Mar 25, 2012, at 7:14 AM, Duncan Murdoch wrote:
On 12-03-24 10:47 PM, J Toll wrote:
On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch
wrote:
Do we have a format that always includes a decimal point and a given number
of significant digits, but o
On Mar 25, 2012, at 7:14 AM, Duncan Murdoch wrote:
> On 12-03-24 10:47 PM, J Toll wrote:
>> On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch
>> wrote:
>>> Do we have a format that always includes a decimal point and a given number
>>> of significant digits, but otherwise drops unnecessary charac
On 12-03-24 10:47 PM, J Toll wrote:
On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch
wrote:
Do we have a format that always includes a decimal point and a given number
of significant digits, but otherwise drops unnecessary characters? For
example, if I wanted 5 digits, I'd want the following:
On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch
wrote:
> Do we have a format that always includes a decimal point and a given number
> of significant digits, but otherwise drops unnecessary characters? For
> example, if I wanted 5 digits, I'd want the following:
>
> Round to 5 digits:
> 1.234567
Omitting the leading zero is dangerous, since the decimal point can disappear
in a poor hardcopy leading to later misinterpretation.
---
Jeff NewmillerThe . . Go Live...
DCN:B
quot; ".005" ".01" ".02" ".04" ".08" "-.005"
[8] "-.01" "-.02" "-.04" "-.08" "1000"
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
>
.. and if you want to simultaneously handle possible multiple trailing
zeros (not sure whether this could even happen)
(somewhat but not completely tested)
> lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08)
> gsub("^0(\\..*[^0])0*$","\\1",lambda)
[1] "0"".005" ".01" ".02" ".04" ".08"
Note th
Here's one way to get rid of leading zeros before the
decimal point:
> gsub("^0\\.", "\\.", as.character(lambda))
[1] "0"".005" ".01" ".02" ".04" ".08"
Sarah
On Tue, Nov 29, 2011 at 12:04 PM, Michael Friendly wrote:
> A simple question, but I can't find something to do what I want:
>
> G
On May 4, 2011, at 5:57 AM, Ben Bolker wrote:
smoff boku.ac.at> writes:
My problem is that I have a table containing dates in the first
column of 10
years. These dates have the format ddmm at least in the csv-
file. After
importing the file using read.table() R deletes the first charac
On May 4, 2011, at 5:57 AM, Ben Bolker wrote:
smoff boku.ac.at> writes:
My problem is that I have a table containing dates in the first
column of 10
years. These dates have the format ddmm at least in the csv-
file. After
importing the file using read.table() R deletes the first charac
smoff boku.ac.at> writes:
> My problem is that I have a table containing dates in the first column of 10
> years. These dates have the format ddmm at least in the csv-file. After
> importing the file using read.table() R deletes the first character if it is
> a zero.
[snip]
> How do I solv
Dennis,
Thanks for your answer. That is working nicely!
Br,
Jack
2010/11/23 Dennis Murphy
> Hi:
>
> Borrowing an idea from a post by Baptiste Auguie a few weeks ago on the
> ggplot2 list, try this:
>
> http://groups.google.com/group/ggplot2/browse_thread/thread/46a78ab3315fdb7/f2ad305ae935a862
Hi:
Borrowing an idea from a post by Baptiste Auguie a few weeks ago on the
ggplot2 list, try this:
http://groups.google.com/group/ggplot2/browse_thread/thread/46a78ab3315fdb7/f2ad305ae935a862?lnk=gst&q=formatter#f2ad305ae935a862
mysep <- function(x, ...)
format(x, big.mark = ' ', trim = TRUE,
Thanks for your help, David! Somehow I just could not find this
information in the documentation!
Jannis
David Winsemius schrieb:
On Nov 16, 2010, at 2:32 PM, Jannis wrote:
Dear List,
this may be a Newbi question and may have been asked several times,
but i am too stupid to find the po
On Nov 16, 2010, at 2:32 PM, Jannis wrote:
Dear List,
this may be a Newbi question and may have been asked several times,
but i am too stupid to find the posts.
I have a plot of values against POSIXct time steps. If I want to add
a second x axis to the top margin of the plot, only numb
Phil
you're right Mthticker is not a table.
Mthticker is a list. I am trying to reformat all elements in the list. or
i can reformat one element and do a loop around it.
Thanks
Cameron
Mthticker
str
List of 5
$ :'zoo' series from 01/02/04 to 11/01/10
Data: chr [1:83] "LHG04 " "LHJ04
Cameron -
Are you sure Mthticker is a table? It looks like a
list containing named vectors. Are you trying to reformat
the list (Mthticker), or to reformat one element in the
list (MthTicker[[i]]).
- Phil Spector
On 11/10/2010 07:55 PM, Santosh Srinivas wrote:
Basic question ... checked the help page but the only answer was to use
paste!
Is there any way to format as %?
degree = c(0.20,0.5)
degree
[1] 0.2 0.5
print(degree)
[1] 0.2 0.5
Hi Santosh,
If you want to scale proportions to percentages, you
On Nov 10, 2010, at 5:13 AM, Jim Lemon wrote:
On 11/10/2010 07:55 PM, Santosh Srinivas wrote:
Basic question ... checked the help page but the only answer was to
use
paste!
Is there any way to format as %?
> sprintf("%1.0f %%",10)
[1] "10 %"
> sprintf("%1.0f%%",10)
[1] "10%"
degree =
Thank you this was worked great. Thank you for the additional
information as well. Knowledge is power.
Cheers,
Michael
On Fri, Oct 1, 2010 at 5:34 AM, Dennis Murphy wrote:
>
> Hi:
>
> CW.lm <- lm(weight ~ Diet, ChickWeight)
> resid.CW.lm <- resid(CW.lm)
> as.data.frame(resid(CW.lm))[1:10, ]
Hi:
CW.lm <- lm(weight ~ Diet, ChickWeight)
resid.CW.lm <- resid(CW.lm)
as.data.frame(resid(CW.lm))[1:10, ] # (nope)
[1] -60.645455 -51.645455 -43.645455 -38.645455 -26.645455 -9.645455
[7] 3.354545 22.354545 46.354545 68.354545
# convert residuals to one column matrix, then convert t
Hi:
This isn't the most elegant way, I'm sure, but here's one approach.
library(reshape)
# read in your data...I had to surround the text strings with quotes because
of the spaces
df <- read.table(textConnection("
TractID StandID Species CruiseDate DBHClassTreesPerAcre
'Carbon Stand
On Apr 16, 2010, at 9:28 AM, kafkaz wrote:
Hello,
I use format() function to get number of the week, like this:
format(tmp,'%U')
Recently, I have spotted something bizarre. For example, I have such
object:
(index(tmp$x.delta['2009'][1:16]))
[1] "2009-01-02 CET" "2009-01-09 CET" "2009-01-1
Were you expecting "01", and is that why you are puzzled?
See ?strftime and the explanation of the %U format. It depends on
where the first Sunday of the year happens to fall.
-Don
At 5:28 AM -0800 4/16/10, kafkaz wrote:
Hello,
I use format() function to get number of the week, like this:
fo
On Mar 13, 2010, at 10:46 AM, Javier wrote:
>
> Dear users,
>
> Is anyone out there on a Saturday to answer this easy question?
>
> I have the "yo" object data in a "list" format:
It is not a list, it is a matrix. The dimnames attribute is a list.
>> str(yo)
> num [1:259, 1:173] 16.3 NA NA
On Sat, Mar 13, 2010 at 4:46 PM, Javier wrote:
>
> Dear users,
>
> Is anyone out there on a Saturday to answer this easy question?
>
> I have the "yo" object data in a "list" format:
>
>> str(yo)
> num [1:259, 1:173] 16.3 NA NA NA NA ...
> - attr(*, "dimnames")=List of 2
> ..$ x: chr [1:259] "3
On Mar 13, 2010, at 11:46 AM, Javier wrote:
Dear users,
Is anyone out there on a Saturday to answer this easy question?
I have the "yo" object data in a "list" format:
str(yo)
num [1:259, 1:173] 16.3 NA NA NA NA ...
- attr(*, "dimnames")=List of 2
..$ x: chr [1:259] "367319" "367329" "36
maybe you are looking for:
format(x,drop0trailing=TRUE)
Bart
--
View this message in context: http://n4.nabble.com/format-tp1457899p1457952.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat
how about round?
?round
--
View this message in context: http://n4.nabble.com/format-tp1457899p1457938.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEAS
Being more specific:
On Fri, 2009-09-11 at 17:03 +0200, Tomas Lanczos wrote:
> Good day,
>
> I read some data from a PostgreSQL database by a following script:
>
> library(Rdbi)
> library(RdbiPgSQL)
> # conn becomes an object which contains the DB connection:
> conn <- dbConnect(PgSQL(), host="l
library(chron)
Lines <- " ID Target Actual Date Time
1 2030 0 -57.0 12/20/08 17:03:00
2 2030 90 90.0 12/20/08 18:41:00
3 2030 45 43.8 12/21/08 14:36:00
4 2030 0 -23.8 12/21/08 19:30:00
5 2030 90 90.2 12/21/08 21:48:00
6 2030 45 48.6 12/22/08 13:02:00"
DF
On Mar 14, 2009, at 8:52 AM, Aimin Yan wrote:
I have a data set like this:
> head(FormatedData)
ID Target Actual Date Time
1 2030 0 -57.0 12/20/08 17:03:00
2 2030 90 90.0 12/20/08 18:41:00
3 2030 45 43.8 12/21/08 14:36:00
4 2030 0 -23.8 12/21/08 19:30:00
5 20
marc:
Thanks for the quick reply. I learned something new today, I wasn't aware of
the big.mark argument.
--- On Fri, 2/6/09, Marc Schwartz wrote:
> From: Marc Schwartz
> Subject: Re: [R] format \Sexpr{}
> To: mazatlanmex...@yahoo.com
> Cc: r-h...@stat.math.ethz.ch
> Da
on 02/06/2009 02:32 PM Felipe Carrillo wrote:
> Hi everyone: It is probably something simple but I can't find
> anything related to this. Could someone show me how to format the sum
> of x. the result is 1 but I need comma formatted like this:
> 10,000. Since I am going to be using this number
1 - 100 of 125 matches
Mail list logo