Displaying 20 results from an estimated 20000 matches similar to: "codes() has been deprecated"
2003 Jan 03
1
Take care with codes()! (was type of representation)
Ahh yes, sorry about that.
Here's the corrected snippet:
# Create an Example Data Frame Containing Car x Color data
carnames <- c("bmw","renault","mercedes","seat")
carcolors <- c("red","white","silver","green")
datavals <- round(rnorm(16, mean=10, sd=4),1)
data <- data.frame(Car=rep(carnames,4),
2006 Mar 18
0
No subject
Normally `codes' is not the appropriate function to use with an
unordered factor. Use `unclass' or `as.numeric' to extract the
codes used in the internal representation of the factor, as these
do not assume that the codes are sorted.
and this is one of the `normally' cases. Your code will only work
correctly if the levels are in alphabetical order (in the locale
2003 Mar 08
0
RE: Text Rotation (was: Take care with codes()!)
You can use the graphics parameter "srt" to rotate displayed text by a
specified number of degrees, e.g. srt=45 to put it on an angle, srt=90 to
put it vertical.
If you do this, may need to modify the call to text to increase ylim and
change the plot location to give you more room.
I'm working to update the 'balloonplot' function in the gregmisc package now
to handle this
2003 Mar 08
0
RE: Text Rotation (was: Take care with codes()!)
I've just uploaded gregmisc_0.8.2.tar.gz to CRAN. It should show up in the
package repository in a day or two.
This version of the gregmisc package provides an enhanced 'balloonplot'
function with 'rowsrt', 'colsrt' arguments to control rotation of the
labels, and 'rowmar', 'colmar' to control the amount of space reserved for
the labels.
Here's
2004 Feb 17
1
deprecated 'codes' function in 'factor' docs (PR#6590)
Full_Name: Andrew Stryker
Version: 1.8.1
OS: Linux/Win XP
Submission from: (NULL) (65.124.252.58)
>From ?factor:
See Also:
'[.factor' for subsetting of factors.
'gl' for construction of "balanced" factors and 'C' for factors
with specified contrasts. 'levels' and 'nlevels' for accessing the
levels, and
2007 May 01
0
[Fwd: Re: [R-downunder] Beware unclass(factor)] (PR#9641)
It really is unclear what is claimed to be a bug here. But see
https://stat.ethz.ch/pipermail/r-devel/2007-May/045592.html
for why the bug is not in R: your old and new data do not match.
Your fit is to a category.
[The problem with the web interface to R-bugs was reported last week: it
is being worked on.]
On Mon, 30 Apr 2007, r.darnell at uq.edu.au wrote:
> This is a multi-part
2002 Nov 24
1
gcc 3.2.1
gcc 3.2.1 is out and avoids the warnings about -I/usr/local/include
shown by 3.1 and 3.2.
Unfortunately, it seems to generate invalid code on 32-bit Solaris 2.7.
(64-bit code via -m64 is OK.) On two separate installations
example(Bessel) crashes in graphics.c because dd is not being passed down
from clipText correctly. I don't think that is all, as compiling
graphics.c under gcc-3.2 leads
2007 Mar 29
0
(PR#9578) rbind.data.frame reacts on levels without
In your data frames, 'y' is a category and the following comment in the
code makes clear this is deliberate.
if( !is.null(levels(xj)) ) {
all.levs[[j]] <- levels(xj)
facCol[j] <- TRUE # turn categories into factors
} else facCol[j] <- is.factor(xj)
The behaviour is compatible with S apart from the comment in the R help
2003 Nov 25
0
AW: ISOdate() and strptime()
Thanks for this clarification.
I have learned in the meantime that it is necessary to be very careful when
using all these POSIX things.
As another example, here is something that made me scratch my head just
yesterday:
When I create a sequence of days that happens to start before and ends in
daylight savings time, I seem to lose a day:
> seq(from = strptime("20030329",
2009 Nov 27
0
Long execution time for quantile() and difftime objects (PR#14092)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--27501778-1317196171-1259330723=:5696
Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-7; format=flowed
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.LFD.2.00.0911271406411.5696 at toucan.stats.ox.ac.uk>
Did you read the help page?
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
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()
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"
>
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
2006 Dec 15
1
Switching labels on a factor
Hi All,
I'm perplexed by the way the unclass function displays a factor whose
labels have been swapped with the relevel function. I realize it won't
affect any results and that the relevel did nothing useful in this
particular case. I'm just doing it to learn ways to manipulate factors.
The display of unclass leaves me feeling that the relevel had failed.
I've checked three books
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
2005 Apr 30
2
(PR#7826) segfault during build of 2.1.0 on RH9; print.POSIXct
1) Why did you submit this *twice*, as PR#7826 and PR#7827? Please don't
be so careless of the volunteers' time.
2) > print.POSIXct
function (x, ...)
{
print(format(x, usetz = TRUE, ...), ...)
invisible(x)
}
is definitely *not* implicated. (Use of ... in two places is correct.)
3) On FC3:
> unusual_and_faults
Error: protect(): protection stack overflow
>
2011 Feb 01
1
dotchart {graphics} 2.11.1 vs. 2.12.1 [followed up from Rhelp]
Dear List,
With the R 2.12.0 addition of table methods for points(), dotchart()
struggles with tables. I found several possible solutions, but it is
beyond my skill to decide what is "best". Here is a small example:
#############################################
x <- table(infert$education)
y <- 1:3L
dotchart(x) # error about incorrect plot type
## moving closer to the cause,
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