Re: [R] Format

2024-06-10 Thread Eric Berger
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

Re: [R] Format

2024-06-09 Thread Duncan Murdoch
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

Re: [R] Format

2024-06-09 Thread Rui Barradas
À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

[R] Format

2024-06-09 Thread Val
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/08/21 4 11/10/21 5 07/09/21 6 15/08/21 7

Re: [R] Format printing with R

2022-12-11 Thread Robert Baer
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(

Re: [R] Format printing with R

2022-11-22 Thread Steven T. Yen
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

Re: [R] Format printing with R

2022-11-21 Thread Ivan Krylov
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

Re: [R] Format printing with R

2022-11-21 Thread Bert Gunter
??? > 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

Re: [R] Format printing with R

2022-11-21 Thread Jeff Newmiller
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.

Re: [R] Format printing with R

2022-11-21 Thread Steven T. Yen
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()

Re: [R] Format printing with R

2022-11-21 Thread dulcalma dulcalma
,] 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

Re: [R] Format printing with R

2022-11-21 Thread Andrew Simmons
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

Re: [R] Format printing with R

2022-11-21 Thread Jeff Newmiller
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

Re: [R] Format printing with R

2022-11-21 Thread Jim Lemon
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

[R] Format printing with R

2022-11-21 Thread Steven T. Yen via R-help
Hi, I have two variables with 86 observations each. Below I print with the print command with digit=2. But, I am getting three decimal places for my first variable and two for the second. Please help. Thanks. > cbind(Mean,Std.dev)     Mean   Std.dev  [1,]  0.3107966  0.462820  [2,]  0.1

Re: [R] Format dates issues with R

2021-12-14 Thread Luigi Marongiu
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

Re: [R] Format dates issues with R

2021-12-14 Thread Micha Silver
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

Re: [R] Format dates issues with R

2021-12-14 Thread Ivan Krylov
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

Re: [R] Format dates issues with R

2021-12-14 Thread Ivan Calandra
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

[R] Format dates issues with R

2021-12-14 Thread Luigi Marongiu
Hello, I have these kind of dates: ``` > ori[[n[3]]] [1] "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" [7] "9/20/2021" "9/20/2021" "9/20/2021" "9/20/2021" "9/21/2021" "9/21/2021" [13] "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" "9/21/2021" [19] "9/21/2021"

Re: [R] Format utils::bibentry with a 'corporate name'

2021-10-29 Thread Duncan Murdoch
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

Re: [R] Format utils::bibentry with a 'corporate name'

2021-10-29 Thread Erin Hodgess
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

[R] Format utils::bibentry with a 'corporate name'

2021-10-29 Thread Sam Albers
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: entry <- utils::bibentry( bibtype = "Manual", title = "The Thing", author = "The Dat

[R] format integer numbers with leading 0

2018-01-04 Thread Marc Girondot via R-help
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(" ", "0", format(x, width=2)) But I suspect more elegant way could be done directly with format opt

Re: [R] format integer numbers with leading 0

2018-01-04 Thread Lasse Kliemann
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 ___

Re: [R] format integer numbers with leading 0

2018-01-04 Thread David Wolfskill
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("

[R] format integer numbers with leading 0

2018-01-04 Thread Marc Girondot via R-help
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(" ", "0", format(x, width=2)) But I suspect more elegant way could be done directly with format opt

Re: [R] Format y axis

2017-06-04 Thread Jim Lemon
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

[R] Format y axis

2017-06-04 Thread Pedro páramo
Hi all, I have been looking on documentation but I´m not able to find how to customize format on y axis so that for example: y value goes from 1000 to 9000 it appears on thousand position a 1,000 and on the comas with "," and two decimals. (For the previous answers many thanks) [[altern

Re: [R] Format a dataset for use with R with chunking

2015-12-28 Thread Jeff Newmiller
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

Re: [R] Format a dataset for use with R with chunking

2015-12-28 Thread William Dunlap via R-help
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

[R] Format a dataset for use with R with chunking

2015-12-28 Thread Mark Finkelstein
The problem is common, I have 100GB of data, but only 8GB of RAM. I was thinking of transforming the 100GB of data, which right now is in a nonCSV, fixed row format, to something that R could load quickly and easily in chunks - sort of like pages perhaps. I might be able to do this with some SQL s

Re: [R] Changing text file to .r format

2015-11-06 Thread Spencer Boucher
: Dear all, I am a beginner in R and want to ask a simple question. I have a code file in text format which I need to change to .r format only. For example now it is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I tried this sub("^([^.]*).*", "\\1", &

Re: [R] Changing text file to .r format

2015-11-06 Thread Pascal Oettli via R-help
ch I need to change to .r format only. For example now it > is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I tried > this > > sub("^([^.]*).*", "\\1", 'RHtestsV4.r.txt') > [1] "RHtestsV4" > > But this didn't see

Re: [R] Changing text file to .r format

2015-11-06 Thread Jeff Newmiller
question. I have a code >file >in text format which I need to change to .r format only. For example >now it >is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I >tried >this > >sub("^([^.]*).*", "\\1", 'RHtestsV4.r.txt') >[1]

Re: [R] Changing text file to .r format

2015-11-06 Thread Henrik Bengtsson
nction using source("RHtestsV4.r") The error message is Error in file(filename, "r", encoding = encoding) : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = encoding) : cannot open file 'RHtestsV4.r': No such file o

[R] Changing text file to .r format

2015-11-06 Thread Chattopadhyay, Somsubhra
Dear all, I am a beginner in R and want to ask a simple question. I have a code file in text format which I need to change to .r format only. For example now it is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I tried this sub("^([^.]*).*", "\\1", &

[R] format( "www.R-project.org" , year = 2015)

2015-03-04 Thread Martin Maechler
The R Foundation is pleased to announce that our website http://www.r-project.org/ has under gone a nice retouch (and thus arrived in the 21st century :-) Thanks to a working group of Dirk Eddelbuettel, Simon Urbanek and Hadley Wickham., the current page sources are in markdown, and the html

Re: [R] format selected columns in dataframe as character

2015-02-26 Thread MacQueen, Don
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

Re: [R] format selected columns in dataframe as character

2015-02-26 Thread JS Huang
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

[R] format selected columns in dataframe as character

2015-02-26 Thread Alain D.
Dear R-List, #I have a df with the first two cols formatted as factor. 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)) # now I want to format both factor VARs as character # I

Re: [R] format negative numbers

2014-10-22 Thread PIKAL Petr
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

Re: [R] format negative numbers

2014-10-20 Thread David Winsemius
; 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

Re: [R] format negative numbers

2014-10-20 Thread MacQueen, Don
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

Re: [R] format negative numbers

2014-10-20 Thread PIKAL Petr
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

Re: [R] format negative numbers

2014-10-20 Thread Marc Girondot
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

Re: [R] format negative numbers

2014-10-20 Thread Rainer Schuermann
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

[R] format negative numbers

2014-10-20 Thread PIKAL Petr
Dear all. Before I start fishing in (for me) murky regular expression waters I try to ask community about changing format of negative numbers. For some reason I get a file with negative numbers formatted with negative sign at end of number. something like 0.123- It is imported as factors and

[R] format of output of residual standard errors of manova()

2014-03-18 Thread Gerrit Eichner
Dear all, I wasn't successful in finding any related "bug" or "wish" report on bugs.r-project.org, svn.R-project.org/R/trunk/doc/NEWS.Rd, or RSeek regarding the following: The code of stats:::print.aov contains the two commands cat("Residual standard error: ", sapply(sqrt(ss/rdf), format), "

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-10 Thread Stefano Sofia
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

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread PIKAL Petr
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

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread arun
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

[R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread Stefano Sofia
Dear R users, I have a very long data frame (50 years, more than 1.5 million rows) of daily rainfall data from about 80 raingouges. The data frame that I have been given looks like Raingouge_number Station_number Year Month Day Rainfall 2004 2230 1951 1 1 2.60 2004 2230 1951 1 2 0.40 2004 2230 19

Re: [R] Format Sys.time()

2014-01-15 Thread arun
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

Re: [R] Format Sys.time()

2014-01-15 Thread Yuan, Rebecca
ot;) 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 know that the follo

Re: [R] Format Sys.time()

2014-01-15 Thread Mohammad Tanvir Ahamed
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() Hel

Re: [R] Format Sys.time()

2014-01-15 Thread PIKAL Petr
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

[R] Format Sys.time()

2014-01-15 Thread Yuan, Rebecca
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 %p? format(Sys.time(), "%Y_%m_%d_%I_%p") Thanks very much! Cheers, Rebecca

Re: [R] format a matrix as fractions?

2013-12-31 Thread Bert Gunter
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

Re: [R] format a matrix as fractions?

2013-12-31 Thread arun
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

[R] format a matrix as fractions?

2013-12-31 Thread Michael Friendly
Is there some way to format a matrix of fractions as fractions? I think I've seen this somewhere, but search on Rseek came up empty. Example: > outer(1/seq(1:3), 1/seq(1:3)) [,1] [,2] [,3] [1,] 1.000 0.500 0.333 [2,] 0.500 0.250 0.167 [3,] 0.333

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-26 Thread Mathieu Basille
- 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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread Mathieu Basille
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread Ista Zahn
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread William Dunlap
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread Mathieu Basille
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread William Dunlap
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-08-01 Thread Mathieu Basille
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread arun
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
c = FALSE,trim=TRUE) id2[0:100010] # [1] "0" "1" "2" "3" "4" "5" "99996" "7" #[9] "8" "9" "10" "11" "12" &

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread arun
06" "17" "18" "19" "100010" id2 <- format(1:11, scientific = FALSE,trim=TRUE) id2[0:100010] # [1] "0"  "1"  "2"  "3"  "4"  "5"  "6&quo

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
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

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread David Winsemius
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

[R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
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. Let's start with a simple data frame: df1 <- data.frame(x = r

[R] ICPSR data archive to release datasets in R format

2013-03-12 Thread John Fox
University of Michigan): -- snip --- ICPSR releases new datasets in R format ICPSR is pleased to announce that most new datasets we release will now be available in R format. Along with data files readable by software packages SAS, SPSS and Stata, data can now be downloaded as R

Re: [R] Format Integers

2013-02-14 Thread arun
o: R help Cc: Sent: Friday, February 15, 2013 1:41 AM Subject: [R] Format Integers Dear all, I would like to format the following numbers xLabel  [1] 10 1000153846 1000307692 1000461538 1000615385 1000769231  [7] 1000923077 1001076923 1001230769 1001384615 1001538462 1001692308 [1

[R] Format Integers

2013-02-14 Thread Alaios
Dear all, I would like to format the following numbers xLabel  [1] 10 1000153846 1000307692 1000461538 1000615385 1000769231  [7] 1000923077 1001076923 1001230769 1001384615 1001538462 1001692308 [13] 1001846154 100200 1002153846 1002307692 1002461538 1002615385 [19] 1002769231 1002923

Re: [R] FORMAT EDITING

2013-02-11 Thread eliza botto
"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

Re: [R] FORMAT EDITING

2013-02-11 Thread MacQueen, Don
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

Re: [R] FORMAT EDITING

2013-02-11 Thread arun
4 445.000    1924.11. 5 449.000    1924.11. 6 442.000    1924.11. 7 445.000 ",sep="",header=FALSE,stringsAsFactors=FALSE)  dat1 #    V1 V2  V3 #1 1901.11.  1 447 #2 1901.11.  2 445 #3 1901.11.  3 445 #4 1924.11.  4 445 #5 1924.11.  5 449 #6 1924.11.  6 442 #7 1924.11.  7 445 ---

[R] FORMAT EDITING

2013-02-11 Thread eliza botto
Dear R users,[IF THE FORMAT OF MY EMAIL IS NOT CLEAR, I HAVE ATTACHED A TEXT FILE FOR A CLEAR VIEW] I would like to use the R output file in Fortran. my file Is exactly in the following format. ELISA/BOTTO wATER INN FROM 1900 11 1 TO 1996 12 31 1901.11. 1 447.000 1901.11. 2

Re: [R] Format of numbers in plotmath expressions.

2012-10-07 Thread William Dunlap
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

Re: [R] Format of numbers in plotmath expressions.

2012-10-05 Thread Rolf Turner
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

Re: [R] Format of numbers in plotmath expressions.

2012-10-05 Thread Uwe Ligges
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

[R] Format of numbers in plotmath expressions.

2012-10-05 Thread Rolf Turner
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 is [1] "0.3" "0.5" "0.7" "0.9" "1.0" I can

Re: [R] Format Date with Time

2012-07-16 Thread jim holtman
> 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]] > > ___

Re: [R] Format Date with Time

2012-07-16 Thread Hasan Diwan
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:

Re: [R] Format Date with Time

2012-07-16 Thread Jessica Streicher
?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]] > >

[R] Format Date with Time

2012-07-16 Thread Lauren Vogric
How do I format "5/1/2012 8:00:00 PM" into a date? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.ht

Re: [R] Format text with outline?

2012-06-19 Thread MacQueen, Don
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-

Re: [R] Format text with outline?

2012-06-19 Thread baptiste auguie
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

[R] Format text with outline?

2012-06-19 Thread MacQueen, Don
I'm using mtext() to annotate a plot. I would like, if possible, to have the individual characters formatted with an outline or border, with a contrasting fill color inside the borders. I'd appreciate suggestions or pointers toward a way to do this. The reason is because I'm creating a graphic wi

Re: [R] Format wanted...

2012-03-25 Thread Hasan Diwan
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

Re: [R] Format wanted...

2012-03-25 Thread Duncan Murdoch
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

Re: [R] Format wanted...

2012-03-25 Thread Marc Schwartz
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

Re: [R] Format wanted...

2012-03-25 Thread Duncan Murdoch
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:

Re: [R] Format wanted...

2012-03-24 Thread J Toll
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

[R] Format wanted...

2012-03-24 Thread Duncan Murdoch
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 -> "1.2346" Drop unnecessary zeros: 1.23 -> "1.23" Force

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Jeff Newmiller
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

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread William Dunlap
quot; ".005" ".01" ".02" ".04" ".08" "-.005" [8] "-.01" "-.02" "-.04" "-.08" "1000" Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- >

  1   2   >