Displaying 20 results from an estimated 6000 matches similar to: "Change in how R handles assignments?"
2003 Dec 09
1
How to append to a data.frame?
Hi,
I have a data.frame that I need to construct iteratively.
At the moment, I'm doing:
d<-data.frame(x=c(),y=c(),z=());
# {and, within some loop}
d<-rbind(d,data.frame(x=newx,y=newy,z=newz);
While this works, it is horribly verbose and probably not efficient, either.
My real data.frame has, of course, many more columns, which can be of
different modes.
I vaguely recall that
2005 Aug 29
2
test for readline installation fails if installation location non-standard (PR#8104)
Full_Name: D Kreil
Version: 2.1.1
OS: HP-UX B.11.23 U ia64 0029870451 unlimited-user license
Submission from: (NULL) (62.178.15.60)
When the dependency readline is installed in a non-standard location the
installation procedure fails.
If using a non-standard installation location like
--prefix=/bi/common --exec-prefix=/bi/arch
the configure script default include and library paths should
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2005 Aug 29
1
"finite" vs "R_FINITE" in colors.c (PR#8108)
Full_Name: D Kreil
Version: 2.1.1
OS: HP-UX B.11.23 U ia64 0029870451 unlimited-user license
Submission from: (NULL) (62.178.15.60)
During compiliation, I get:
ld: Unsatisfied symbol "finite" in file colors.o
Fix: replace "finite" with R_FINITE in colors.c line 269.
I have, this time, searched through the R-admin.html, but not found a mention.
This is all a bit hard for me
2011 Jun 11
1
Is there an implementation loess with more than 4 parametric predictors or a trick to similar effect?
Dear R experts,
I have a problem that is a related to the question raised in this earlier
post
https://stat.ethz.ch/pipermail/r-help/2007-January/124064.html
My situation is different in that I have only 2 predictors (coordinates x,y)
for local regression but a number of global ("parametric") offsets that I
need to consider.
Essentially, I have a spatial distortion overlaid over a
2011 Jun 24
2
Is there an implementation of loess with more than 3 parametric ...
Dear John,
> I suggest that you look at the abilities of the mgcv package.
> There are notes of mine at
>
> http://www.maths.anu.edu.au/%7Ejohnm/r-book/xtras/autosmooth.pdf
>
> that may help you get started.
Thank?you very much for the suggestion and the link to your write-up,
it was indeed very helpful!
I have experimented with this library for a while now and am really
happy
2005 Apr 02
4
factor to numeric in data.frame
Dear All,
Assume I have a data.frame that contains also factors and I would like to
get another data.frame containing the factors as numeric vectors, to apply
functions like sapply(..., median) on them.
I read the warning concerning as.numeric or unclass, but in my case this
makes sense, because the factor levels are properly ordered.
I can do it, if I write for each single column
2003 Aug 16
4
unclass
Have I been sleeping in class?
rw1071 from CRAN, windows XP
incidencia is made by a call to tapply
> class(incidencia)
[1] "array"
> incidencia <- unclass(incidencia)
> class(incidencia)
[1] "array"
Kjetil Halvorsen
2012 Dec 21
2
Why can't I "unclass" an array?
In a real example I was trying to remove the class from the result of table, just because
it was to be used as a building block for other things and a simple integer vector seemed
likely to be most efficient.
I'm puzzled as to why unclass doesn't work.
> zed <- table(1:5)
> class(zed)
[1] "table"
> class(unclass(zed))
[1] "array"
>
2012 Dec 21
2
Why can't I "unclass" an array?
In a real example I was trying to remove the class from the result of table, just because
it was to be used as a building block for other things and a simple integer vector seemed
likely to be most efficient.
I'm puzzled as to why unclass doesn't work.
> zed <- table(1:5)
> class(zed)
[1] "table"
> class(unclass(zed))
[1] "array"
>
2018 Aug 24
5
True length - length(unclass(x)) - without having to call unclass()?
Is there a low-level function that returns the length of an object 'x'
- the length that for instance .subset(x) and .subset2(x) see? An
obvious candidate would be to use:
.length <- function(x) length(unclass(x))
However, I'm concerned that calling unclass(x) may trigger an
expensive copy internally in some cases. Is that concern unfounded?
Thxs,
Henrik
2008 Feb 16
3
Arithmetic bug? (found when use POSIXct) (PR#10776)
Full_Name: Bo Zhou
Version: 2.6.1 (2007-11-26)
OS: Windows XP
Submission from: (NULL) (207.237.54.242)
Hi,
I found an arithmetic problem when I'm doing something with POSIXct
The code to reproduce it is as follows (This is the recommended way of finding
out time zone difference on R News 2004-1 Page 32 URL
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf)
a=Sys.time()
2002 Jun 24
1
problems with assigning a class to an environment
I was surprised to find that calling str() on an environment can remove
attributes from it, as in
> a <- new.env()
> class(a) <- "jens"
> class(a)
[1] "jens"
> str(a)
Class 'jens' length 0 <environment>
> class(a)
NULL
then I found in the R-Language-Manual in chapter 2.1.10 Environments the
sentence:
"In particular, assigning
2003 May 09
1
codes() has been deprecated
We have deprecated codes() in R-devel. One we started looking into this,
we found that *all* the uses of codes() in the R sources and probably all
the uses in CRAN packages were not what we think was intended.
For an ordered factor, codes() is the same as
unclass/as.vector/as.integer and so was unneeded.
For an unordered factor, codes() does *not* retrieve the internal codes.
It
2005 Apr 07
2
axis colors in pairs plot
The following command produces red axis line in a pairs
plot:
pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species",
pch = "+", col = c("red", "green3", "blue")[unclass(iris$Species)])
Trying to fool pairs in the following way produces the
same plot as above:
pairs(iris[1:4], main = "Anderson's Iris Data -- 3
2005 May 08
3
Light-weight data.frame class: was: how to add method to .Primitive function
Hi,
Encouraged by a tip from Simon Urbanek I tried to use the S3 machinery
to write a faster version of the data.frame class.
This quickly hits a snag: the "[.default"(x, i) for some reason cares
about the dimensionality of x.
In the end there is a full transcript of my R session. It includes the
motivation for writing the class and the problems I have encountered.
As a result I see
2014 Apr 10
3
Unión de subconjuntos procedentes de bucles
Buenas tardes a todos los participantes del foro.
Me dirijo a vosotros porque estoy atascado con una duda de programación respecto al data frame:
> dd # Data frame de 5 variables, leído de un archivo txt
id sexo nacim origen final
1 1 0 02/09/1955 01/04/1985 01/02/2014
2 2 1 29/10/1951 15/08/1996 01/05/2009
3 3 0 30/10/1942 02/08/2000 01/02/2014
4 4 1
2011 Jun 16
0
Update: Is there an implementation of loess with more than 3 parametric predictors or a trick to a similar effect?
Dear R developers!
Considering I got no response or comments in the general r-help forum
so far, perhaps my question is actually better suited for this list? I
have added some more hopefully relevant technical details to my
original post (edited below).
Any comments gratefully received!
Best regards,
David Kreil.
----------
Dear R experts,
I have a problem that is a related to the question
2018 May 16
2
Date method of as.POSIXct does not respect tz
R 3.5.0
Is it intended that the Date method of as.POSIXct does not respect the
tz parameter? I suggest changing as.POSIXct.Date to this:
function (x, tz = "", ...)
.POSIXct(unclass(x) * 86400, tz = tz)
Currently, the best workaround seems to be using the character method if
one doesn't want the default timezone (which is often an annoying DST
timezone).
This came up on