Displaying 20 results from an estimated 200 matches similar to: "statistics for ragged arrays: loop to vector"
2001 Oct 23
1
loading packages
Thanks to Roger for pointing out the packages spweights and sptests to
me. I believe they will be quiet useful in my work. But... I can't get
them to work!
Firstly, I realised that a newer version of R is available. I have now
downloaded and installed it. When I try to 'install packages from CRAN'
I get:
trying URL `http://cran.r-project.org/bin/windows/contrib/PACKAGES'
unable
2001 Oct 11
2
Where's MVA?
Hi All:
Package TSERIES is stated to depend on MVA. However, there is no MVA package to be found under the list of package sources.
Best wishes,
ANDREW
tseries: Package for time series analysis
Package for time series analysis with emphasis on non-linear and non-stationary modelling Version: 0.7-6
Depends: ts, mva, quadprog
Date: 2001-08-27
Author: Compiled by Adrian
2001 Aug 24
3
statistical mode function
Hello R-users,
I am aware that this is a very basic question, but still... Since mode()
function is reserved for something else, is there a function to calculate
statistical mode for a vector or a matrxi?
i.e. mode.function(c(1,2,2,2,3,3))=2
Thanks in advance,
Elena Moltchanova
Elena MOLTCHANOVA
IIASA
International Institute for Applied Systems Analysis
A-2361 Laxenburg, Austria
E-Mail:
2001 Aug 07
2
image() colors
Hi, everybody!
I am currently dealing with spatial estimation and thus writing some
smoothing algorithms. My question concerns the graphical output. I would
like my function to produce a picture of input data (X) and of estimation
results(Y). Both, X and Y are categorical variables which can take values
1,2,...,Cl. So, basically I write
foo<-function(){
....
2011 Dec 20
1
Convert ragged list to structured matrix efficiently
Hi All,
I'm wanting to convert a ragged list of values into a structured matrix for
further analysis later on, i have a solution to this problem (below) but
i'm dealing with datasets upto 1GB in size, (i have 24GB of memory so can
load it) but it takes a LONG time to run the code on a large dataset. I
was wondering if anyone had any tips or tricks that may make this run
faster?
Below is
2004 Sep 13
1
Adding ranks to a repeatedly ragged array
How can I add an extra column containing the rank
to a ragged array indexed by more than one grouping
factors?
E.g. with the barley dataset:
How can I to add an additional column ``rank''
containing the rank of the ``yield'' of
the different varieties in relation to the indices
``year'' and ``site'' to the barley dataframe?
I achieved to calculate the ranks with:
2011 Oct 16
2
question: ragged array
Hello,
I have a big problem which I’m just not able to solve.
I created the following mean value from the following dataset structure:
Id |value
1 | 2
1 | 3
1 | 4
2 | 2
2 | 1
3 | 5
4 | 3
etc.|etc.
with the command:
mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = FALSE)
this gives me a ragged array:
> mean_rating [1]
$`14`
2011 Jun 03
0
ragged data.frame? using plyr
I have a dataset that looks like:
set.seed(144)
sam<-sample(1000,100)
dat<-data.frame(id=letters[1:10],value=rnorm(1000),day=c(rep(1,100),rep(2,100),rep(3,100),rep(4,100),rep(5,100)))
I want to "normalise" it using the following function (unless you have
a better idea...):
adj.values<-function(dframe){
value_mean<-mean(dframe$value)
value_sd<-sd(dframe$value)
2006 Jul 19
2
Aligning ragged text columns
Can anyone please suggest how I can print:
a <- matrix(c(
"Heading 1", "This is some info\nabout heading 1",
"Heading 2", "This is some info\nabout heading 2",
), byrow=T, nrow=2)
to look like:
Heading 1 This is some info
about heading 1
Heading 2 This is some info
about heading 2
(if you're not using a fixed width
2007 Nov 24
1
ragged array with append
I wonder what's the right way in R to do the following -- placing
objects of the same kind together in subarrays of varying length.
Here's what I mean:
> word <- c("a","b","c","d","e","f","g","h","i","j")
> kind <- c(1,1,1,2,3,4,5,5,7,7)
> d <-
2009 Jun 22
5
Convert "ragged" list to matrix
Hi,
I have a list made up of character strings with each item a different
length (each item is between 1and 6 strings long). Is there a way to
convert a "ragged" list to a matrix such that each item is its own row?
Here is a simple example:
a=list();
a[[1]] = c("a", "b", "c");
a[[2]] = c("d", "e");
a[[3]] = c("f",
2008 Oct 03
2
Ragged time series data
Hi and thanks in advance,
I am fairly new with R so I hope this problem isn't too amateur.
I have a vector of count data which correspond to vectors of date (%m/%d/%Y)
and time of day (%H:%M:%S).
I am trying to compute various statistics (e.g. daily max) by lumping the
data together by day. I have been able to utilize tapply() and group the
counts together, but with the method I use I end
2007 Mar 16
1
Fast lookup in ragged array
Hello,
I'm running an algorithm for graph structural cohesion that requires
a depth-first search of subgraphs of a rather large network. The
algorithm will necessarily be redundant in the subgraphs it recurses
to, so to speed up the process I implemented a check at each subgraph
to see if it's been searched already.
This algorithm is very slow, and takes days to complete on a
2001 Jul 16
0
partitioning a space
Hello, everybody!
I have subscribed to the list only recently, although I've been actively
using R since February. I found it very useful and very flexible and I hope
to learn to use it better. My current problem concerns spatial statistics.
I need to partition a regular rectangular grid into given number of
subsets. For example for a 5*5 grid with 3 subsets I could have:
1 1 1 2 2
1 1 2
2012 Oct 23
10
How to pick colums from a ragged array?
I have a large dataset (~1 million rows) of three variables: ID (patient's name), DATE (of appointment) and DIAGNOSIS (given on that date).
Patients may have been assigned more than one diagnosis at any one appointment - leading to two rows, same ID and DATE but different DIAGNOSIS.
The diagnoses may change between appointments.
I want to subset the data in two ways:
- define groups
2005 Oct 12
2
linear mixed effect model with ordered logit/probit link?
Hello,
I'm working on the multiple categorical data (5-points scale) using linear
mixed effect model and wondering if anyone knows about or works on the
linear mixed effect model with ordered logit or probit link.
I found that the "lmer" function in R is very flexible and supports
various models, but not ordered logit/probit models. I may conduct my
analysis by turning my DVs
2011 May 07
2
write.table vs. read.table and the argument "fill"
Just wondering how come read.table lets you specify fill=TRUE for ragged
arrays, but so far as I can tell, no equivalent for write.table?
Not a big deal, since I'm perfectly comfortable w/ write and scan and
the other file I/O goodies. "A foolish inconsistency..." and all that.
Carl
2006 Feb 27
2
heckit with a probit
Hi
I have data for voting behaviour on two (related) binary votes. I want
to examine the second vote, running separate regressions for groups
who voted different ways on the first vote. As the votes are not
independent, I guess that there is an issue with selection bias.
So, I think I would like to fit a heckit style model but with a binary
dependent variable - so, in effect, two successive
2005 Feb 18
4
barplot and ylim - display problems
The following single line of code shows what I am trying to do, and the
problem I am having...
barplot(c(101,102,103),ylim=c(100,103))
The 'xaxis' is missing, and the grey bars 'fall off' the plot area. This
is generally ugly, and I would like to trim the bars (ideally they would
have a ragged appearance to show that I am 'zooming in').
I can see why what I am trying to
2012 Apr 05
0
Multi part problem...array manipulation and sampling
Ok, I have a new, multipart problem that I need help figuring out.
Part 1. I have a three dimensional array (species, sites, repeat counts
within sites). Sampling effort per site varies so the array should be
ragged.
Maximum number of visits at any site = 22
Number of species = 161
Number of sites = 56
I generated the array first by;