Displaying 20 results from an estimated 30000 matches similar to: "Showing NAs when using table()"
1999 Nov 16
2
including NAs in a table
I have two factors, WC and WD. If I want a table including all the values
of each factor, including NAs, I can get a table by going:
table(as.character(WC),as.character(WD),exclude=c())
Is there an easier way?
I guess this is a feature request for table()
Thanks,
Robert.
----
Robert King, Australian Environmental Studies, Griffith University, Australia
3875 6677 Robert.King at
2015 Jul 04
2
Contrastes de Rangos Alineados
Estimados usuaRios:
deseo hacer una consulta, debo
realizar una prueba no paramétrica a un conjunto de datos que posee una
variable de respuesta con tres factores que poseen interacción, o al menos
debo probar ello. Es decir, realizar una prueba Scheirer-Ray-Hare o de
Contrastes de rangos alineados. Estuve trabajando el paquete ARTool aunque
no me queda claro
2003 Sep 05
1
Problem with S4 slots in C code (PR#4073)
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C3738F.63DE3390
Content-Type: text/plain;
charset="iso-8859-1"
#I want to be able to create a new S4 class and read data into it using C
code
# Here is a very simple S4 object inheriting from "array", but with 5
2010 Jul 05
3
data.frame: adding a column that is based on ranges of values in another column
Dear List,
I've been looking tirelessly for a solution to this dilemma but without success. Perhaps someone has an idea that will guide me in the right direction.
Suppose I have the following data.frame:
DF = data.frame(X = c(114.5508, 114.6468, 114.6596, 114.6957, 114.6828, 114.8903, 114.9519, 114.8842,
114.8579, 114.8489), Y = c(47.14094, 46.98874, 46.91235, 46.88265, 46.80584, 46.67022,
2005 Jun 03
2
How to 'de-cross' a table?
Dear R users,
I have received a table in the following format:
id a b c1 c2 d1 d2
1 1 1 65 97 78 98
2 1 2 65 97 42 97
3 2 1 65 68 97 98
4 2 2 65 97 97 98
Factors of the design are: a, b, and e, where e has levels c and d. The
levels c and d then have 2 replicates (r) each.
Now I would like to get:
id a b e r value
1 1 1 c 1 65
2 1 1
2005 May 10
4
summary statistics for lists of matrices or dataframes
Is there a simple way to calculate summary statistics for all the
matrices or dataframes in a list? For example:
> z <- list(matrix(c(2,2,2,2), ncol = 2), matrix(c(4,4,4,4), ncol = 2))
> z
[[1]]
[,1] [,2]
[1,] 2 2
[2,] 2 2
[[2]]
[,1] [,2]
[1,] 4 4
[2,] 4 4
>
I would like to calculate, for example, the mean value for each
cell. I can do that the hard
2009 Feb 11
1
How to count number of year per firm in panel data?
Hello,
I have an unbalanced panel dataset and would like to exclude all objects
that don't appear at least x times.
Therefore, I would like to include a column indicating for every line how
many periods are available, e.g.
id, year, number
1, 2000, 3
1, 2001, 3
1, 2002, 3
2, 2001, 1
3, ..., ...
This would allow me to exclude companies by setting "subset=number>=x".
However, I
2007 Aug 05
1
t-test
Hi all,
i'm trying to run a two-sample t-test.
i have a longitudinal data that looks like this:
idn age class
1 22 1
1 22 1
1 22 1
1 22 1
2 63 3
2 63 3
2 63 3
3 43 2
3 43 2
3 43 2
3 43 2
3 43 2
3 43 2
4 37 1
4 37
2010 Sep 12
4
using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )
I am using read.table to import a text file within R.
There are several "errors" in my text file. An "extra" quotation mark has
inadvertently been included within a few text fields.
e.g. for a pipe (|) delimited text file, I have something similar to this:
1|7|30| "dog"
2|6|25| ""cat"
3|4|20|""
4|5| 56| "mouse"
5|3|56|
2003 Oct 13
2
colnames from submatrix?
Hi R-Wizards:
I've looking through the R docs and have yet to find what I'm looking for
and have tried a few intermediate steps to now avail yet and rather than
spend another few hours looking for the solution, I figured I would post a
message.
I have a matrix (actually a set of them) that I want to pull all the names
of the non-zero columns into a vector/list for further processing:
2006 Jun 08
1
NAs in unsplit factor
R-devel,
Below is a simple example calling split and unsplit on a numeric
vector of length 2 where 'f' is c(1,NA).
> unsplit(split(c(1,2), c(1,NA)), c(1,NA))
[1] 1 0
I noticed that the call to vector in unsplit gives us 0 as the 2nd
element of the result.
Is this the intended result, as opposed to NA?
Thanks for your help,
Jeff
--
Jeff Enos
Kane Capital Management
jeff at
2012 Aug 09
4
R Commander - Time Series
Hello all,
I'm just starting to learn R and I heard a good way of doing that was R
Commander. For my work I use a lot of time series, so I installed (and
loaded) R Commander with epack.
When I go to Ts-Models, after loading my data, I click on ARIMA Models tab.
I load my variable D1 Ln Demand (1st differenced ln demand). I set my
regular and seasonal p d q settings hit run and I get:
[1]
2008 May 29
1
Separator argument in read.table
Hi,
Suppose I have the following tabular data:
1729_at | TRADD | TNFRSF1A-associated via death domain | protein-coding
1773_at | FNTB | farnesyltransferase, CAAX box, beta | protein-coding
177_at | PLD1 | phospholipase D1, phosphatidylcholine-specific | protein-coding
What is the right separator used for read.table function?
I tried this:
dat <-
2000 Oct 04
3
R 1.2 build
I've been trying to build a bundle with the R-devel snapshot from
yesterday. (Yes I know it is unstable and just tell me if I shouldn't be
trying to do this yet.)
It is failing with the message
tar : /dev/rmt/0 : Permission denied
It happens after "removing junk files" and just after the message
"building dse_2000.9-1.tar.gz"
It looks to be coming from the line in
2006 Jun 14
2
Package naming best practices
R-devel,
I'm in the process of choosing a name for a new package. I've already
decided that the name will have two parts, 'portfolio' and 'sim', but
can't decide between 'portfolioSim' and 'portfolio.sim'. Is there any
good reason to choose one over the other?
Thanks in advance,
Jeff
--
Jeff Enos
Kane Capital Management
jeff at kanecap.com
2009 Nov 26
1
Missing and number of days
Hi all,
Assume that I have a data set (“xcv”) with several variables and some of
the variables have a missing observation represented by -9 as shown below.
I want to exclude these observations from the analysis ( as a NA). Is
there a command that I can do it for the entire data set rather than one by
one for each variable ( tmp <- xcv[xcv$v1 != -9, ])
V1 v2 v3 v4
11 23
2024 Jan 11
4
arrow on contour line
Hello,
I am drawing contour lines for a function of 2 variables at one level of
the value of the function and want to include a small arrow in any
direction of increase of the function. Is there some way to do that?
Below is an example that creates the contour lines. How do I add one small
arrow on each line in the direction of increase of the function (at some
central point of the contour
2007 Mar 09
1
Applying some equations over all unique combinations of 4 variables
#I have a data set that looks like this. A bit more
complicated actually with
# three factor levels but these calculations need to
be done on one factor at a
#I then have a set of different rates that are applied
#to it.
#dataset
cata <- c( 1,1,6,1,1,2)
catb <- c( 1,2,3,4,5,6)
doga <- c(3,5,3,6,4, 0)
data1 <- data.frame(cata, catb, doga)
rm(cata,catb,doga)
data1
# start rates
#
2007 Jul 02
3
Walking an HVM''s shadow page tables and other memory management questions.
Hello,
I''m new to Xen and especially to the hypervisor code. I''m working off a
3.0.4.1 base and have the following questions regarding the memory
management code for an x86, 32-bit platform (capable of supporting PAE).
I''m doing some research into providing grant table hypercall support
from a Windows 2003 HVM. I have made all the necessary changes to allow
the
2005 Nov 04
1
problem in waveslim library?
This code consistenly segfaults for me. Can someone please take a look
and tell me if the problem is due to something I am doing or is there a
problems with the dwt (idwt) functions in the waveslim library.
Thanks
tom
library(waveslim)