similar to: deprecated 'codes' function in 'factor' docs (PR#6590)

Displaying 20 results from an estimated 4000 matches similar to: "deprecated 'codes' function in 'factor' docs (PR#6590)"

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),
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
1997 Jul 22
0
R-alpha: some thoughts about factor()
Dear R-people, recently at s-news we had a discussion about factor(). I thought you might be interested in some of my thoughts about factors. Any comments welcome Best regards Jens Oehlschlaegel-Akiyoshi ------------------------------------------------------------------- I think the problem is deeper than that factors would just be handled inapprobriately by some S+ functions, the
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
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
2001 Feb 27
1
Patch to coplot.R
---1149173172-1804289383-983267779=:26068 Content-Type: TEXT/plain; charset=us-ascii Hello, and a big thank you for providing R! Please find attached a diff for coplot which you may want to consider for the next release. The diff is against R 1.2.2. The reasons for this patch are: 1. The boxes of coplot did not align very well with the panel graphs if applied to a factor 2. Putting the
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
1999 Jul 02
3
Time Sync Details
Hi, All!! Again about time sync Win and Linux. If there is a way to sync. time of Windoze and my LInux server except "net time \\flash /set /yes". That way works wonderfull and properly, but BAD user of my net DON"T want to remember their passwords.... Does anybody know what I should do? ......,Yours Alex "Flash"
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
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
2018 Sep 05
4
True length - length(unclass(x)) - without having to call unclass()?
The bottomline here is that one can always call a base method, inexpensively and without modifying the object, in, let's say, *formal* OOP languages. In R, this is not possible in general. It would be possible if there was always a foo.default, but primitives use internal dispatch. I was wondering whether it would be possible to provide a super(x, n) function which simply causes the
2013 Jan 28
1
Suggestions for 'diff.default'
I have suggestions for function 'diff.default' in R. Suggestion 1: If the input is matrix, always return matrix, even if empty. What happens in R 2.15.2: > rbind(1:2) # matrix [,1] [,2] [1,] 1 2 > diff(rbind(1:2)) # not matrix integer(0) > sessionInfo() R version 2.15.2 (2012-10-26) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United
2023 Apr 28
2
range() for Date and POSIXct could respect `finite = TRUE`
Hi all, I noticed that `range.default()` has a nice `finite = TRUE` argument, but it doesn't actually apply to Date or POSIXct due to how `is.numeric()` works. ``` x <- .Date(c(0, Inf, 1, 2, Inf)) x #> [1] "1970-01-01" "Inf" "1970-01-02" "1970-01-03" "Inf" # Darn! range(x, finite = TRUE) #> [1] "1970-01-01"