Displaying 20 results from an estimated 12000 matches similar to: "Finding and moving files"
2005 Dec 21
3
NextMethod causes R 2.2.0 to crash (PR#8416)
I found writing the following default method the for the generic
function "julian" causes R to crash.
julian.default <- function(x, ...) {
x <- as.Date(x)
NextMethod("julian", x, ...)
}
Here is a test example
> m <- as.Date("1972-09-27") + 0:10
> m
[1] "1972-09-27" "1972-09-28" "1972-09-29"
2010 Jul 07
3
Large discrepancies in the same object being saved to .RData
Hi developers,
After some investigation I have found there can be large discrepancies in the same object being saved as an external "xx.RData" file. The immediate repercussion of this is the possible increased size of your .RData workspace for no apparent reason.
The function and its three scenarios below highlight these discrepancies. Note that the object being returned is exactly
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500,
and I need to count the number of cells containing a count of 1 for each
of the factors values defining the first dimension.
Here is my attempt:
tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM))
tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0))
tab3<-apply(tab2,1,sum)
Computing tab2 is very slow.
Is there a faster
2006 Dec 22
5
substitute creates an object which prints incorrectly (PR#9427)
The function "substitute" seems to fail to make a genuine
substitution, although the printed verision seems fine. Here is an
example.
> m <- substitute(Y <- function(x) FUN(x+1),
+ list(Y = as.name("y"), FUN = as.name("sin")))
> m
y <- function(x) sin(x + 1)
> eval(m)
> y
function(x) FUN(x+1)
However the story doesn't end there. The
2005 Apr 30
3
as.numeric method for objects of class "difftime"
I have just become painfully aware that objects of class "difftime",
generated by the difference of two POSIXct objects, carry a "units"
attribute, which flashes by when the object is printed, for example.
The pain was occasioned when I tried to turn these objects into numberic
objects for use elsewhere as a covariate.
as.numeric(difftime object)
simply turns off the units
2008 Feb 01
6
Accessing the elements of a list
Hi R,
I wanted to know how do we access the elements of a list. In particular,
v=list(c(1,2,3,4,5),c(1,2,33,4,5),c(1,2,333,4,5),c(1,2,3333,4,5))
I want to access all the thirds items of the elements of the list. i.e.,
I want to access the elements, 3,33,333,3333. This can be done through
sapply as:
sapply(v,function(x) x[3])
But I need to access this without using
2001 Oct 30
2
moving dimnames when reassigning
Hi, all.
I've got a question that arose when I was switching some row and columns in
a matrix. I was expecting the row and column names to follow their rows and
columns, and they didn't. I think I see some logic to the behavior, but I'm
not sure whether it's intentional or not, so I thought I'd ask the list
whether this is a feature or a bug.
Here's an example (R-1.3.1,
2009 Mar 31
4
Convert Character to Date
Hello,
I have a date in the format Year-Month Name (e.g. 1990-January) and R classes it as a character. I want to convert this character into a date format, but when I try as.Date(1990-January, "%Y-%B"), I get back NA. The function strptime also gives me NA back. Thanks.
[[alternative HTML version deleted]]
2007 Jul 03
1
termplot - changes in defaults
While termplot is under discussion, here's another proposal. I'd like to
change the default for partial.resid to TRUE, and for smooth to
panel.smooth. I'd be surprised if those changes were to break existing
code.
John Maindonald email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473 fax : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
This is not so much a bug as an infelicity in the code that can easily
be fixed.
The initialize expression in the quasi family function is, (uniformly
for all links and all variance functions):
initialize <- expression({
n <- rep.int(1, nobs)
mustart <- y + 0.1 * (y == 0)
})
This is inappropriate (and often fails) for variance function
"mu(1-mu)".
2007 Nov 15
3
generate combination set
I have a set data={A,B,C,D,E,F,G}
I want to choose 2 letter from 8 letters, i.e. generate the combination set
for choose 2 letters from 8 letters.
I want to get the liking:
combination set={AB,AC,AD,....}
Does anyone konw how to do in R.
thanks,
Aimin
2000 Oct 02
9
the underscore ("_") in variable name
At 14:35 02/10/00 +0800, mohd zamri wrote:
>new to R and starting to learn to program R. The underscore ("_") did some
>suprising result. e.g
>
>> c <- c(1,2,3,4,5)
>> mean(c)
>[1] 3
>> c_mean <- mean(c)
>> c
>[1] 3
>
>having some experience in C, I thought the underscore is "always" valid in
>variable name. totally confuse
2005 Jan 28
2
Begginer with R
Hello all,
Im just beggining using R. I have read a couple of introductory documents
but they are very general. Is there a document focused on classification?
(this is what Ill be using R for). Examples would be just fine.
Thanks in advance,
Ulises
2008 Mar 25
1
peak finding
Hi all
Is there a function that can find the start and end position of peaks in a
set of numbers.
eg.
x=c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
y=somefunction(x)
y
4 14
Thanks
John
[[alternative HTML version deleted]]
2001 Jul 09
1
polynomial regression and poly
When doing polynomial regression I believe it is a good idea to use the poly
function to generate orthogonal polynomials. When doing this in Splus there
is a handy function (transform.poly I think) to convert the coefficients
produced by regression with the poly function back to the original scale.
Has somebody written something similar for R ?
Robert
2008 Mar 04
6
vector manipulations
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080304/9de37092/attachment.pl
2001 Nov 01
1
cor.test for a correlation matrix
Is there a simple way to run cor.test on for a matrix of correlations?
Of course, cor on a data frame produces a correlation matrix, but cor.test will only take two variables at a time. Is there a way to get behavior similar to that of cor with cor.test?
I suppose the programming alternative would be to run two for loops with the number of items and cor test embedded accessing the columns of
2000 May 25
1
diag() (PR#555)
Full_Name: David Duffy
Version: 1.0.1
OS: Linux
Submission from: (NULL) (152.98.96.21)
Documentation for diag() states that "If x is a vector (or a
1-d array) then diag(x) returns a diagonal matrix whose diagonal
is x."
> m<-matrix(1:4,ncol=1)
> diag(m)
[1] 1
diag(as.vector(m)) gives the advertised performance.
Fix: Change documentation.
2000 Feb 23
2
Files unavailable on CRAN
I've been trying to download from CRAN the floppy versions of the R source
files:
R-release-1.tar.gz, R-release-2.tar.gz
I tried the servers in Seattle, Madison, and the Vienna
Technical University. In each case, the file(s) were unavailable.
Anne
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070 USA
e-mail: anne.york at noaa.gov
2007 Nov 08
2
a newbie question about "data"
hi, I am reading Modern Applied Statistics with S 4th ed$B!#(B
page4 have these two lines:
> library(MASS)
> data(chem) # needed in R only
but I find withou the line " data(chem)"
I can still access chem, isn't it?
is it unnecessary or something i missed here?
thanks for the replay in advance.