similar to: Newbie: Formatting numbers with commas

Displaying 20 results from an estimated 1000 matches similar to: "Newbie: Formatting numbers with commas"

2008 Sep 24
2
print.data.frame : row.name = FALSE not having intended effect
Hi, Does anybody know if row.name = FALSE actually works in v2.6.2? Because it isn't working for me... here is some sample code and output: ====+====+====+====+====+====+====+====+====+====+ > print(x,row.names = FALSE) party_abbr candidate_name votes_candidate 2 DFL AMY KLOBUCHAR 1,278,849 5 R MARK KENNEDY 835,653 4 IP
2008 Sep 26
3
Newbie: Ranking a data frame, grouped by 2 or more columns
Hi, I'd like to rank obs in a data frame as subset by 2 or more columns... The example input would look like the following: ====+====+====+====+ x y v -- -- -- a w 200 a w 100 b w 500 b w 200 b z 300 b z 400 ====+====+====+====+ And the data frame I want to create is below: ====+====+====+====+ x y v rank -- -- -- ---- a w 200 1 a w 100 2
2008 Sep 22
1
Hmisc and Ubuntu (aptitude install)
Hi, I'm trying to get the Hmisc module on my Ubuntu Hardy Heron install. I tried getting Hmisc from within R by issuing the standard 'install.packages' command, but it said I needed 'gfortran' to compile. I thought I could circumvent this by using 'aptitude' to get the package 'r-cran-hmisc', but when I got it, the package had critical missing parts (got
2008 Sep 25
2
Equivalent of 'first.var' or 'last.var' from SAS in R?
Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the "by" group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas
2008 Sep 12
2
Newbie: 'table' output in columns rather than matrix
Hi, Coming to R from SAS... I have a data.frame A with 2 long factors "x" and "y". I want to get a count of the number of rows with each level of "x" and "y" jointly. 'table' seemed like it would work, but as I have many levels, the matrix output is pretty useless to me (and I don't care about zero values). How can I get output that looks
2008 Sep 18
1
Reporting with down and across variables
Hi, I have a dataframe like the following: xfact yfact zfact response ------- ------- ------- -------------- x1 y1 z1 r1 x1 y1 z2 r2 ... I want output that looks like: ___ zfac levels___ xfact yfact z1 z2 ... zn ------- ------- ---- ---- ... ---- x1 y1 r1 r2 rn .... How can I go about
2002 May 13
1
prettyNum inserts leading commas (PR#1548)
Under R-1.5.0 on Solaris 2.6: R> prettyNum(123456789, big.mark=",") [1] ",123,456,789" and that bad behavior (leading comma) spills into formatC as well: R> formatC(123456789, digits=0, format="f", big.mark=",") [1] ",123,456,789" Looks to me like a bug in src/library/base/R/format.R, in function prettyNum: B.[i.big] <-
2025 May 23
1
Formatting zeroes with prettyNum
You fed it two characters, "dash" and "space" and it only wanted one character so it truncated to the first character and warned you that that's what it did. If you had your space before the dash, it would have used that as your replacement character > prettyNum(0, zero.print = " - ", replace = TRUE) [1] " " Warning message: In .format.zeros(x,
2025 May 23
1
Formatting zeroes with prettyNum
Dear list, Have I stumbled upon a bug, or am I holding `prettyNum()` wrong? Please see below. Best, Mikko > prettyNum(0, zero.print = "- ", replace.zero = TRUE) [1] "-" Warning message: In .format.zeros(x, zero.print, replace = replace.zero) : 'zero.print' is truncated to fit into formatted zeros; consider 'replace=TRUE' > prettyNum(0, zero.print =
2025 May 23
1
Formatting zeroes with prettyNum
Tim, The purpose of the `replace.zero` argument is to allow longer replacements. See for example the behaviour with a character vector input: > prettyNum("0", zero.print = "- ", replace.zero = TRUE) [1] "- " I'm pretty sure this is a bug, and have now posted the relevant details on r-devel. A fix would be below. Best, Mikko diff --git
2002 Mar 13
1
Commas in formatC
formatC() is great for formatting numbers! But it would be even better if it could optionally insert commas (or semicolons), e.g. R> formatC(1234567.89, digits=2, format="f", commas=T) [1] "1,234,567.89" Here's a snippet of code that does that, which could more or less just be inserted into at the end of formatC if any R-core guru were so inclined. "r"
2010 Sep 01
1
Transparent File Caching
This is not really a samba question, but if anyone would know that answer, it would be this group. :) Are there any Open Source projects that offer network file caching for SMB/CIFS? Something like what Squid does for HTTP. If not, do you think it would be difficult to position Samba into such a role? We are going to use Cisco WAAS for branch locations, but I think the cache in the devices may
2007 Nov 27
2
exporting clustering results to table
Hello list, the following approach did not work: clustersA <- pam(distances, nkA, diss=TRUE); gc(); filenameclu = paste("filenameclu", ".txt"); write.table(clustersA , file=filenameclu,sep=","); although it worked with clustersA <- hclust(distances, method="ward"); and a consecutive kclassA <- cutree(clustersA, k=nkA); filename =
2019 Mar 21
3
prettyNum digits=0 not compatible with scientific notation
R developers, Seems I get a bad result ("%#4.0-1e" in particular) when trying to use prettyNum digits=0 with scientific notation. I tried on both my Linux box and on an online R evaluator and saw the same problem, so it's not limited to my box at least. I see the problem in both R 3.5.3 and R 3.3.2. options(scipen=-100) prettyNum(1, digits=0) [1] "%#4.0-1e" prettyNum(2,
2019 Oct 18
4
Centos 8 Mate?
On 10/17/19 4:08 PM, Johnny Hughes wrote: > On 9/24/19 2:41 PM, Frank Cox wrote: >> Without wanting to sound too pushy, I'm wondering if there is any update on the status of Mate now that Centos 8 has been released? >> >> I would love to jump on C8 and start playing with it, but the lack of Mate is kind of a showstopper for me at the moment. >> > > Is gnome3
2008 Oct 17
2
Beginner's question: number formatting
Hello R-helpers, I have a problem with formatting a single number to show leading zeros. For example, I want "2" displayed as "002". My numbers have 1 to 3 digits and I would like them all to display 3 digits for printing. I know I could use "paste" in a loop with several "if"s, but I was wondering if there is a single function that can do this. I have
2019 Mar 22
2
prettyNum digits=0 not compatible with scientific notation
FWIW, it doesn't seem to be happening on Mac OS: > format(2^30, digits=0) [1] "1.e+09" > prettyNum(12345.6, digits=0) [1] "1.e+04" A glibc misfeature? -pd > On 22 Mar 2019, at 10:10 , Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > Thank you, Robert for raising this here ! > >>>>>> Robert McGehee
2025 May 23
1
Bug in prettyNum
? Fri, 23 May 2025 11:47:33 +0000 Marttila Mikko via R-devel <r-devel at r-project.org> ?????: > When called with a numeric vector, the `replace.zero` argument is > disregarded. > > > prettyNum(0, zero.print = "- ", replace.zero = TRUE) > [1] "-" > Warning message: > In .format.zeros(x, zero.print, replace = replace.zero) : >
2025 May 23
1
Bug in prettyNum
Dear list, I'd like to report a bug in `prettyNum()`. When called with a numeric vector, the `replace.zero` argument is disregarded. > prettyNum(0, zero.print = "- ", replace.zero = TRUE) [1] "-" Warning message: In .format.zeros(x, zero.print, replace = replace.zero) : 'zero.print' is truncated to fit into formatted zeros; consider 'replace=TRUE' A
2025 May 26
1
Bug in prettyNum
Thank you, Marttila and Ivan, As the original author of prettyNum() {etc ..}, I will commit such a bug fix to R-devel (and probably port it to R 4.5.0 patched) quite soon (but not yet today). Best regards, Martin Maechler >>>>> Ivan Krylov via R-devel >>>>> on Fri, 23 May 2025 17:14:57 +0300 writes: > ? Fri, 23 May 2025 11:47:33 +0000 >