Displaying 20 results from an estimated 5000 matches similar to: "interpreting date-related error message"
2012 Nov 01
2
Name assignment in for loop
Dear helpeRs-
I'm using a for loop to create a series of models.
I'm trying to assign a name to each model created,
using the loop index. The loop gets stuck at the name
of the model, giving the error "target of assignment
expands to non-language object". The linear model runs
without error; only the name is problematic.
Here is the current loop syntax. The use of dat
2025 May 27
1
Bug in prettyNum
Thanks for the contribution Mikko!
For testing future patches, you can actually do it right in the web
browser, thanks to Heather Turner's R Dev Container, see instructions here
https://contributor.r-project.org/r-dev-env/container_setup/
Best
Toby
On Mon, May 26, 2025 at 6:28?PM Martin Maechler <maechler at stat.math.ethz.ch>
wrote:
> Thank you, Marttila and Ivan,
>
> As
2010 Aug 12
4
conditional selection of dataframe rows
Dear helpeRs,
I have a dataframe (14947 x 27) containing measurements collected
every 5 seconds at several different sampling locations. If one
measurement at a given location is less than zero on a given day, I
would like to delete all measurements from that location on that day.
Here is a toy example:
toy <- data.frame(CH = rep(3:5,3), DAY = c(rep(4,5), rep(5,4)),
SLOPE =
2006 Dec 20
1
Reformat meteorological data
Dear HelpeRs:
I have a data set in the following format,
which will be familiar to those of you working
with NCDC climate data.
Example:
Year <- rep(1:3, each = 3)
Year <- c(Year,Year)
ID <- rep(1:2, each = 9)
Jan <- runif(18, min = 0, max = 20)
Feb <- runif(18, min = 0, max = 20)
Mar <- runif(18, min = 0, max = 20)
var <- gl(3,1,18,label =
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
>
2009 Nov 13
2
format (PR#14062)
Full_Name: Dirk Jacob
Version: R 2.8.1 and 2.9.1
OS: Win XP
Submission from: (NULL) (153.96.32.62)
I want to convert numbers to strings
like:
> inputs= c(0.3+0*(1:12) )
> (format(inputs,digits=3,scientific=T,collapse=" "))
and it works
[1] "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01"
2010 Sep 28
2
Reshape
Hello, helpeRs,
I've been trying, unsuccessfully, to change a dataframe from long to
wide format using reshape (the original). I would appreciate it if
someone could demonstrate the correct syntax. The script below will
create a toy example. The new wide data should have a column name
for each unique entry in the "fame" column. Under each column
should be either the
2008 Aug 07
1
Bug in format.default(): na.encode does not have any effect for (PR#12318)
Hi!
If I use format() on numeric vector, na.encode argument does not have any e=
ffect. This
was reported before:
- https://stat.ethz.ch/pipermail/r-help/2007-October/143881.html
- http://tolstoy.newcastle.edu.au/R/e2/devel/06/09/0360.html
It works for other (say character) classes!
> format(c("a", NA), na.encode=3DTRUE)
[1] "a " "NA"
>
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) :
>
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,
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
2007 Jun 13
5
Confusion with sapply
Hi,
I have some confusion in applying a function over a column.
Here's my function. I just need to shift non-March month-ends to March
month-ends. Initially I tried seq.dates, but one cannot give a negative
increment (decrement) here.
return(as.Date(seq.dates(format(xdate,"%m/%d/%Y"),by="months",len=4)[4])
)
Hence this simple function:
> mydate <-
2010 Feb 14
4
Newbie woes with *apply
Dataframe cust has Date-type column open.date. I wish to set up another
column, with (first day of) the quarter of open.date.
To be comprehensive (of course, improvement suggestions are welcome),
month = function(date)
{
return(as.numeric(format(date,"%m")))
}
first.day.of.month = function(date)
{
return(date + 1 - as.numeric(format(date,"%d")))
}
first.day.of.quarter =
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
2006 May 01
1
format.info() versus format.default(): Comments please
The format.info() function currently takes args (x, digits = NULL,
nsmall = 0), while format.default() takes many more:
function (x, trim = FALSE, digits = NULL, nsmall = 0, justify = c("left",
"right", "centre", "none"), width = NULL, na.encode = TRUE,
scientific = NA, big.mark = "", big.interval = 3, small.mark = "",
2012 Apr 14
1
R Error/Warning Messages with library(MASS) using glm.
Hi there,
I have been having trouble running negative binomial regression (glm.nb)
using library MASS in R v2.15.0 on Mac OSX.
I am running multiple models on the variables influencing the group size of
damselfish in coral reefs (count data). For total group size and two of my
species, glm.nb is working great to deal with overdispersion in my count
data. For two of my species, I am getting a
2010 Aug 18
1
syntax for batching rbind process
Dear helpeRs,
I am attempting to read in a series of csv files so I can bind them
into one large dataframe. I have written the following script:
test <- list.files(".", pattern = "csv") #lline 1
imp <- list() #line 2
for (i in 1:length(test)) { #line 3
imp[i] <- read.csv(test[i]) #line 4
}
2010 Feb 15
2
Printing 2 digits after decimal point
Hi there,
i'm not getting along with the following problem.
I'd like to print a real number, e.g.
x <- 12.3
with exactly two digits after the decimal point, e.g.
12.30
I've tried the whole format(), formatC() and prettyNum() functions but
did not have any success with it.
This should work with all real numbers, in case even with 0.0 (-> 0.00).
For cracks this thing is pretty
2012 Jun 20
2
reshape
Hello, helpeRs,
I am attempting to reshape (either base R or package reshape) multiple .csv
spreadsheets from a very unfortunate wide format to long format. ?Each spreadsheet
looks something like this, after being read in to R:
toy <- data.frame(year = rep(2007:2008,each = 20), month = rep(1:5,each = 4, length = 40),
day = rep(1:2,each = 2,length = 40), hhmm = rep(1100:1101,length = 40),
2008 Jun 24
1
Error message: Bad value
Dear R help,
In the middle of my session, I started receiving the error
message "bad value"
regardless of what I entered. I had to close R and restart
it. When the error
occurred, I was creating basic lattice plots, with no other
add-on packages running.
I am running R through John Fox's XEmacs interface, XEmacs
version
21.4.20 on a Windows XP Pro machine with 2 GB of RAM. I
have