similar to: style question: returning multiple arguments - structure orlist

Displaying 20 results from an estimated 20000 matches similar to: "style question: returning multiple arguments - structure orlist"

2008 Apr 13
4
R equivalent of erfcinv in matlab
I am converting some matlab code into R that use inverse of the complementary error function, erfcinv and did not find an equivalent in R, is there such a function in some contributed modules? Thanks.
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
1999 Dec 23
4
Very Large Data Sets
List, Can R handle very large data sets (say, 100 million records) for data mining applications? My understanding is that Splus can not, but SAS can easily. Thanks, Tony Fagan -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/19991222/6f333667/attachment.html
2009 Mar 11
3
Matrix Construction; Subdiagonal
I'm trying to enter a vector into the subdiagonal of a matrix but cannot find a command in R which corresponds to the MatLab version of diag(vec, k), where vec = the vector of interest, and k = the diagonal (k=0 for the diagonal; k=-1 for the subdiagonal; k=1 for superdiagonal, etc.) Is there an equivalent command in R? I'm looking for something like this: vec = seq(1, 5, 1)
2004 Mar 31
11
Zero Index Origin?
I'm very new to R and utterly blown away by not only the language but the unbelievable set of packages and the documentation and the documentation standards and... I was an early APL user and never lost my love for it and in R I find most of the essential things I loved about APL except for one thing. At this early stage of my learning I can't yet determine if there is a way to
2000 Nov 05
3
glm
Hi to all, So I'm also a new user. I downloaded the program last week and I think it's great. Thanks to those who have developed R. I have a special interest in GLM as a tool to describe fisheries and its variables and I'm just begging to study it. As I could understand there's two types of GLM sun of squares: in "type I" the factors are added in sequence and
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"
2007 Oct 21
4
Input appreciated: R teaching idea + a way to improve R-wiki
Hi all, I will be teaching a graduate-level course on R at CU Boulder next semester. I have a teaching idea that might also help improve the R wiki page... I wanted to know what you all thought of it and wanted to solicit some advice about doing it. During the latter part of the course, students will choose a topic of interest (e.g., hierarchical linear modeling), and show how to achieve it in
2009 Feb 05
2
non-numeric argument to binary operator
Hi, I compute the value of xi*xj by "for" loops, this how I try: > x1 <- c(1:3) > x2 <- c(2:4) ### to compute x1*x2 > (paste("x", 1, sep = ""))*(paste("x", 2, sep = "")) Error in (paste("x", 1, sep = "")) * (paste("x", 2, sep = "")) : non-numeric argument to binary operator > All
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 Aug 06
4
How to calculate GLM least square means?
Hello R-helpers, I would like to calculate least square means after having built a GLM with quasipoisson errors. In my model the dependent variable is continuous, I have one continuous independent variable and one categorical independent variable (that is the variable for which I would like to calculate the least square means). I've looked around for the command to calculate the least
2008 Apr 06
1
What to use for assignment, " = " or " <- "?
I've noticed an increasing tendency for people to use '=' rather than the older '<-' symbol. When '=' became available as an assignment operator in S-PLUS in the late '90s my first reaction was to switch to it as well. Brian Ripley warned me that it was not a good idea. As usual he was right, but it took a couple of pretty serious finger-burning episodes
2024 Feb 28
2
converting MATLAB -> R | element-wise operation
On Tue, 27 Feb 2024 13:51:25 -0800 Jeff Newmiller via R-help <r-help at r-project.org> wrote: > The fundamental data type in Matlab is a matrix... they don't have > vectors, they have Nx1 matrices and 1xM matrices. Also known as column vectors and row vectors. :) > Vectors don't have any concept of "row" vs. "column". They do in (numerical) linear
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
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
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]]
2008 Feb 13
4
writing a simple function
Dear lists, any suggestion on how to write a function to return a TRUE if interval [a,b] overlaps the interval [c,d]. I've tried it but an error occur saying that 'could not find function v ; in addition warning message occur'. Below is my codes.Please help me sort this problem as i'm in process of learning of writing a function. Many thanks overlap<-function(m,n){
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)".