similar to: aggregate, by tapply

Displaying 20 results from an estimated 10000 matches similar to: "aggregate, by tapply"

2003 May 20
3
plot POSIX class and identify
Hallo all just a small question I did not find an answer in help pages. Is it possible to use identify() after plotting with plot.POSIX to label points and/or to find out some points? Thanks a lot. Best regards Petr Pikal petr.pikal at precheza.cz p.pik at volny.cz
2003 Jul 24
3
trellis plot question
Greetings, Does anyone know how to get an id number in the little header above each individual plot within a trellis plot? The default seems to be to print the word id and add a line indicating on a linear scale where the current id sits. Thanks in advance for any help you can send, Suzette ================================= Suzette Blanchard, Ph.D. Research Scientist Frontier Science
2002 Sep 19
5
how to use if statement in function correctly
Dear all I try to persuade if statement in my function to work as I want (but I am not very successful:( My question is why my function with if statement is evaluated correctly in case of atomic variables and incorrectly in case of vector variables. Here is an example: #function with if statement fff <- function(otac,sklon) { test <- (otac *
2003 Feb 21
2
how to chage values in data frame to NA iside a function
Dear all I have a function in which I would like to change some values to NA according to some condition. dropout<-function(y, nahr=FALSE,...) { <some stuff for computing an index> if (nahr) y[index]<<-NA invisible(index) } in case y is a vector all works OK but if it is a part of data frame by calling dropout(df$y) or dropout(df[,number]) no change is done. Please can you
2001 Aug 14
2
RODBC connection - mixed data types
Dear R users I use R (1.3.0) Windows version usually with connection to Excel sheets via RODBC Version: 0.8-2. Everything is OK until I use mixed data types (numeric and character) in one column. In that case I will get a particular column of data frame with NA's. Example vzorek lpas apas NA 51.240 20.26 NA 51.340 20.42 NA 49.770 22.05 RB 12 49.840 19.30 RB 12 49.880
2003 Mar 12
7
R help
Dear friends, I work with Matlab and now a bit in trouble with getting used to R. Could you give me some help with the following questions: 1. how to generate the random matrix mxn with constant mean and variance, say N(0,1)? 2. how to create a code (function), say “myfunction”, and make it available for use every time I run R? 3. how to make a package, say “e1071”, available for use
2001 Oct 18
1
tapply problem
Hello everybody. I have a question that has stumped me and the usual "apply" tricks don't seem to work. I run a course where each student's performance is marked by one or more assessors. I have a data frame containing students' names, assessors' names and their marks, arranged as follows: ID student assessor Q1A Q1B Q1C Q2A Q2B Q3 1 2152833
2003 May 15
2
strptime and non ISO date format
Dear all I have a character vector of dates something like: timevec<-c("15.5.2003 00:00", "15.5.2003 00:01", "15.5.2003 00:02", "15.5.2003 00:03","15.5.2003 00:04") and I would like to transform it to some more convenient date class. Is there a way how to do it directly without previous reformating to ISO like structure and adding a
2003 Jun 17
1
cut.POSIXct problem
Dear all I would like to aggregate a data frame in a three minute interval. I have a time vector: > str(cas.param) `POSIXct', format: chr [1:181] "2003-06-12 09:00:00" "2003-06-12 09:01:00" "2003-06-12 09:02:00" and I want to turn it into a factor by cut. It works if I want to break it in let say hours > str(cut(cas.param,breaks="hour"))
2002 Jul 23
3
Aggregate: assembling the "by" part on the fly
Dear R users, I'm having trouble using aggregate() and would greatly appreciate your advice. I am using R 1.5.1 on Windows 2000. I want to call my function in the following way extract.data(x=dat[, "Age", "Year"]) where extract.data() uses aggregate() to count the number of cases for each combination of "Age" and "Year". I've defined
2003 Apr 10
1
how to estimate parameters of multimodal distribution
Dear all Please, is there any function or package for dealing with multimodal distributions? I try to fit multimodal distribution or more precisely to find out mixture of normal distributions which can lead to my actual data. I use optim to find (in that case) two parameters but what I want is to let the function find out arbitrary number of normal distributions underlaying my actual data
2006 Oct 20
6
summing elements in a list of functions
Dear all, I have looked for an answer for a couple of days, but can't come with any solution. I have a set of functions, say: > t0 <- function(x) {1} > t1 <- function(x) {x} > t2 <- function(x) {x^2} > t3 <- function(x) {x^3} I would like to find a way to add up the previous 4 functions and obtain a new function: > rrr <- function(x) {1+x+x^2+x^3} without,
2017 Oct 31
2
Help with Nesting
How do i resolve this? symbol <- c('RRR' ,'GGG') for(i in seq_along(symbol)) { dat <- Quandl("LLL/symbol[i]") } required solutionis a loop where Quandl is a function and it loops as flows, Quandl("LLL/RRR") Quandl("LLL/GGG")
2003 Apr 22
7
Subject: Eliminate repeated components from a vector X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Reply-To: fjmolina at lbl.gov FCC: /home/f/.xemacs/mail/sent Does anyone know how I can eliminate repeated elements from a vector?
2002 Dec 10
2
Variance of a single number
Just out of curiosity, can some please explain the following return NA. x <- 6 var(x) y <- c( NA, NA, 10000 ) var(y, na.rm=T) Unless I am seriously misguided, I believe that the variance of a single number (i.e. a constant) should be zero. Thanks. Regards, Adai.
2002 Dec 10
1
Lognormal distribution
I am trying to fit a lognormal distribution to a set of data and test its goodness of fit with regard to predicted values. I managed to get so far: > y <- c(2,6,2,3,6,7,6,10,11,6,12,9,15,11,15,8,9,12,6,5) > library(MASS) > fitdistr(y,"lognormal",start=list(meanlog=0.1,sdlog=0.1)) meanlog sdlog 1.94810515 0.57091032 (0.12765945) (0.09034437) But I would
2003 Jan 20
2
ave across columns
Hi: How do I find average across three columns such as weight1, weight2, weight3 (20 people, each person has three different measures)? They have NA's also. Thanks Tom, Univ of Pittsburgh, ttrut at yahoo.com
2003 Aug 13
1
Contour plot for arbitrary (x,y,z)
Hello. Is there an easy-to-use contour plot function analogous to scatterplot3d that can draw handle a dataset of arbitrary (x,y,z) triplets? That is, say x, y, and z are each measured quanties, and exhibit neither order nor regularity. I looked at the lattice package function "contourplot" but it seems complicated, and it's not clear from the documentation whether it can
2003 May 14
2
how to include 'NA's in xtabs?
Hello! I have a dataset with NA's in some variables (factors), for example: $ P67 : Factor w/ 2 levels "-","+": NA 2 1 NA NA 2 1 1 2 NA ... I need to use 'xtabs' like xtabs(~x$P67) It works well and produces something like this: x$P67 - + 779 1318 but i want to compute NA's too, like this: x$P67 - + NA 779 1318 137 I am trying
2003 Feb 26
3
multiple plot overlay - dataframe
I hope you could help me with this. I have a dataframe with 5 columns, the first column determining the X values, and the rest four determining four separate Y vectors. How can I plot them on the same graph, overlaying each other? Thanks. Elena Zheleva