Displaying 20 results from an estimated 6000 matches similar to: "aggregate function with 'NA'"
2008 Oct 09
1
Basic aggregate help
>From what I read this should work. So please help my misunderstanding:
> x <- data.frame(Name=c("A","A","C"), Category=c("a","a","b"), Quantity=c(1,2,3))
> x
Name Category Quantity
1 A a 1
2 A a 2
3 C b 3
> aggregate(x,
2006 Oct 02
3
line plot through NA
Dear R-help list,
I hope I did not miss something obvious, because my question seems very
simple, but I couln't figure out how to do it.
If I have the following data:
Day<-c(1,2,3,4,5,6,7)
V<-c(5,NA,10,30,45,NA,10)
than the line in plot
plot(V~Day, type="b")
will start with the 3rd value and stop stop at the 5th value because all NA
are omitted. Is there now a parameter
2010 Aug 07
1
Data frame reordering to time series
Given a data frame, or it could be a matrix if I choose to.
The data consists of an ID, a year, and data for all 12 months.
Missing values are a factor AND missing years.
Id<-c(rep(67543,4),rep(12345,3),rep(89765,5))
Years<-c(seq(1989,1992,by =1),1991,1993,1994,seq(1991,1995,by=1))
Values2<-c(12,NA,34,21,NA,65,23,NA,13,NA,13,14)
Values<-c(12,14,34,21,54,65,23,12,13,13,13,14)
2006 Jun 16
1
R in ConTeXt
In case there are users of the TeX macro package ConTeXt on this list,
they may be interested to know that it is now possible to include R
code in a ConTeXt document and have the code evaluated while
compiling. The inverse of Sweave, as it were. The advantage is that
there is then only one file to keep track of (.tex vs .rnw and .tex),
while a drawback is speed, since each code snippet is
2005 Oct 11
2
Two factor (or more) non-parametric comparison of means
Can anyone suggest a good non-parametric test, and an R implementation of the test, that allows for two or more factors? Wilcoxon signed rank allows for only one.
Thanks,
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC
University of Maryland School of Medicine
Division of
2005 Oct 04
2
Problem with Matrix package
Hello All,
While trying to install Matrix package following error message came out:
/usr/bin/ld: cannot find -lblas-3
collect2: ld returned 1 exit status
make: *** [Matrix.so] Error 1
ERROR: compilation failed for package 'Matrix'
** Removing '/usr/lib/R/library/Matrix'
** Restoring previous '/usr/lib/R/library/Matrix'
It seems that someting is missing. Have anybody
2005 Mar 25
2
tapply and NA value
Hi,
I'm writing for a little help.
I have a dataframe with same NA value and I'd like to obtain the means of the
value of a coloumn grouped by the levels of a factor coloumn of the datframe.
I'm using the function "tapply" but I see that if only a NA value is present
the result is NA.
There is an option to have the correct result or I must use an other function?
Thanks of
2006 Feb 08
2
Reference for R
Hello!
Could anyone please tell me how should I include R in a text section for
References?
Regards,
Sara Mouro
[[alternative HTML version deleted]]
2001 Nov 23
3
compiling R under hpux
Dear R user,
I'm wondering if anyone was succesful in compiling R under hpux 10.20
I couldn't compile verion 1.2.1 or 1.3.
I asked this question two weeks ago, but nobody replyed. Looks that not
many people are using hpux machines.
Thanks
Frank Mattes
Department of Virology
Royal Free Hospital
London
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help
2006 Nov 19
2
improving barplot output
Hello,
I was hoping for some advice on improving a barplot. Below is the syntax I
have used. I wanted to do two things differently How would I alter the
syntax so that (a) the y-axis finishes at 25 and not 20, and (b) 'past
ideation' and 'pastwk ideation' are coloured blue and 'past attempt' &
'past wk attempt' are coloured red ?
I was also curious as to
2018 Apr 17
2
Time intervals in a datframe
Hi all
I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single dataframe for further analysis. I did this using the following syntax :
SingleDataframe <- ldply
2013 Jan 05
5
Need help on dataframe
Dear R users, I came up to a problem by taking means (or other summary
statistics) of a big dataframe.
Suppose we do have a dataframe:
ID V1 V2 V3 V4 ........................ V71
1 6 5 3 2 ........................ 3
2 3 2 2 1 ........................ 1
3 6 5 3 2 ........................ 3
4 12 15 3 2 ........................ 100
2018 Apr 17
0
Time intervals in a datframe
> On Apr 17, 2018, at 10:10 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
>
> Hi all
>
> I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single
2006 Nov 21
1
strange R GUI crash
Hi all,
I know I shouldn't really expect the following to work, but it
provokes a crash of the GUI on my computer (Win xp professional).
---
>sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32
attached base packages:
[1] "methods" "stats" "graphics" "grDevices" "utils" "datasets"
[7] "base"
2009 Jun 16
4
confusion on levels() function, and how to assign a wanted order to factor levels, intentionally?
Dear R-helpers,
I want to make a series of boxplots on several numeric univariates with two
group variables (species and population, population nested in species, and
with population as the X-axis). In order to get a proper order of the
individual populations in X-axis, I need to assign a wanted order to the
factor (population). I used the levels() function to do this assignment, but
it seemed
2018 May 02
2
using apply
Hi
I have 3 dataframes, a,b,c with 0/1 values...i have to check a condition
for dataframe a and b and then input the rows ids to datframe c . In the if
condition, I AND the 2 rows of from a and b and then see if the result is
equal to one of them.
I have done this using a for loop, however, it takes a long time to execute
with larger dataset..Can you help me do it using apply function so that i
2011 Jan 11
2
aggregate.formula implicitly removes rows containing NA
The documentation for `aggregate` makes it sound like aggregate.formula should behave identically to aggregate.data.frame (apart from the way the parameters are passed). But it looks like aggregate.formula is quietly removing rows where any of the "output" variables (those on the LHS of the formula) are NA. This differs from how aggregate.data.frame works. Is this expected behavior?
2006 Feb 24
1
(Newbie) Aggregate for NA values
Folks,
Sorry if this question has been answered before or is obvious (or
worse, statistically "bad"). I don't understand what was said in one
of the search results that seems somewhat related.
I use aggregate to get a quick summary of the data. Part of what I am
looking for in the summary is, how much influence might the NA's have
had, if they were included, and is excluding
2008 Jul 08
1
aggregate() function and na.rm = TRUE
All,
I've been using aggregate() to compute means and standard deviations at
time/treatment combinations for a longitudinal dataset, using na.rm = TRUE
for missing data.
This was working fine before, but now when I re-run some old code it isn't.
I've backtracked my steps and can't seem to find out why it was working
before but not now. In any event, below is a reproducible
2007 Jul 31
1
aggregate.data.frame - prevent conversion to factors? show statistics for NA values of "by" variable?
I have a two question regarding the "aggregate.data.frame" method of the "aggregate" function.
My situation:
a. My "x" variable is a data.frame ("mydf") with two columns, both columns of type/format "numeric".
b. My "by" variable is a data.frame("mybys") with two columns, both columns of type/format "character".
c.