Displaying 20 results from an estimated 7000 matches similar to: "Extracting/setting elements from/in a matrix/array"
2012 Dec 10
3
equivalent of group command of the egen function in Stata
Dear R listers,
I am trying to create a new variable that uniquely identifies groups of
observations in a dataset. So far I couldn't figure out how to do this in
R. In Stata I would simply type:
egen newvar = group(dim1, dim2, dim3)
Please, find below a quick example to show what I am dealing with:
I have a dataset with 4 variables:
var <- runif(50) ## a variable that I want to group
2010 Feb 10
2
system.time provides inaccurate sys.child (PR#14210)
Full_Name: Manuel L?pez-Ib??ez
Version: R version 2.6.2 (2008-02-08)
OS: linux-gnu
Submission from: (NULL) (164.15.10.156)
This is only relevant for CPU intensive child processes. Otherwise, the problem
is not obvious.
Therefore, we need a CPU intensive program like this one:
/************************************/
/*** Compile with: gcc -o timer-test -O0 timer-test.c -lm */
#include
2011 Aug 17
1
multinomRob - error message
Hi,
I would like to use the multinomRob function to test election results.
However, depending on which independent variables I include and how
many categories I have in the dependent variable, the model cannot be
estimated.
My data look like this (there are 68 observations):
> head(database)
RESTE09 GAUCHE09 PDC09 PLR09 UDC09 MCG09 RESTE05 GAUCHE05 PDC05
D1 1455
2010 Nov 08
1
unknown dimensions for loglm
Dear R-help community,
I am working with multidimensional contingency tables and I am having
trouble getting loglm to run on all dimensions without typing out each
dimension.
I have generated random data and provided output for the results I want
below:
d1.c1 <- rnorm(20, .10, .02)
d1.c2 <- rnorm(20, .10, .02)
d2.c1 <- rnorm(20, .09, .02)
d2.c2 <- rnorm(20, .09, .02)
d3.c1 <-
2012 Dec 07
1
points3d and ordirgl
Hello all, I have been using the function ordirgl to plot 3D dynamic
ordinations. The ordirgl function works just fine. IN fact, I was even
able to write a function that allows me to identify points in the 3D plot:
identify.rgl<-function(env_var,ord,dim1,dim2,dim3)
{
tmp<-select3d(button="left")
tmp.keep<-tmp(ord[,dim1],ord[,dim2],ord[,dim3])
2001 Jul 16
2
Trouble with the memory allocation
Dear R-users,
I am currently facing what appears to be a strange thing (at least to my
humble understanding).
If I understood correctly, starting with the version 1.2.3, R memory
allocation can be done dynamically,
and there is no need to fiddle with the --nsize and --vsize parameter
any longer...
So far this everything seemed to go this way (I saw the size of my
processes growing when I was
2006 Dec 17
2
question
Dear R users,
I'am using marray and Limma packages to analyze genepix output.
1) how can I filter bad spots from my data (data contains 3 types of bad
spots).
my experiment contains 12 samples and the bad spot are not associated to the
same probes
2) how can I remove control probes from my data ?
I'm sorry, i'm new with R and I can't find answer in packages doc.
best regards,
2001 Oct 22
1
No subject
Dear all,
I may have overlooked something but the following piece of code causes me
trouble:
> a_data.frame(1:4)
> a
X1.4
1 1
2 2
3 3
4 4
> apply(a,2,cat)
1 2 3 4Error in ans[[1]] : subscript out of bounds
> apply(a,1,cat)
1234NULL
Is this the fact my data.frame has only one dimension ?
(and do I forget somewhere (but where ?) to specify not to 'drop'
2011 May 10
3
metaMDS and envfit: Help reading output
Hello R experts,
I've used metaMDS to run NMDS on some fish abundance data, and am also working on correlating environmental data to the NMDS coordinates. I'm fairly new to metaMDS and NMDS in general, so I have what are probably some very basic questions. My fish abundance data consists of 66 sites for which up to 20 species of fish were identified and counted. I ran metaMDS on this data
2001 Oct 27
1
trouble with data.matrix
Dear all,
The following causes me trouble:
> a <- data.frame(2:5,3:6,4:7)
> str(a)
`data.frame': 4 obs. of 3 variables:
$ X2.5: int 2 3 4 5
$ X3.6: int 3 4 5 6
$ X4.7: int 4 5 6 7
> str(data.matrix(a))
int [1:4, 1:3] 2 3 4 5 3 4 5 6 4 5 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:4] "1" "2" "3" "4"
..$ : chr
2010 Jan 20
1
Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements
Hi,
See my example below.
a<-array(1:12,c(2,3,2))
> a
, , 1
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
, , 2
[,1] [,2] [,3]
[1,] 7 9 11
[2,] 8 10 12
I want to get a result something like
dim1 dim2 dim3 elements
1 1 1
1 2 1
1 3 2
2 1 2
I tried the data.frame and expand.grid functions,
2001 Jul 19
1
Compiling R-1.3.0-patched on OSF1
Dear R-users,
I currently have trouble in trying to compile R-1.3.0-patched on Compaq
OSF1.
--------
>uname -a
OSF1 adenine.fysik.dtu.dk V4.0 1229 alpha
--------
The 'configure' step ended seemingly corretly:
-----------------------
R is now configured for alphaev6-dec-osf4.0f
Source directory: .
Installation directory: /home/adenine/sysman/laurent/share/
C
2001 Aug 08
2
Library hdarray
Dear everybody!
I m seeking the package named hdarray for the analysis of microarrays
data.
It must not included in the base packages.
Thanks in advance.
Aboubakar Maitournam.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or
2011 Feb 05
1
different results in MASS's mca and SAS's corresp
Dear list:
I have tried MASS's mca function and SAS's PROC corresp on the
farms data (included in MASS, also used as mca's example), the
results are different:
R: mca(farms)$rs:
1 2
1 0.059296637 0.0455871427
2 0.043077902 -0.0354728795
3 0.059834286 0.0730485572
4 0.059834286 0.0730485572
5 0.012900181 -0.0503121890
6
2003 Jul 15
2
Keeping track of occurrence of warning message
Hi there,
I am interested if there is anyway to keep track of the occurrence of
warning message.
I know that warnings will only be printed out at the end of the program
if warn=0. However I am also interested at which particular set of data
does the warnings occur too. This is because I am running 1000 data, so
if there are 2 or 3 data that give warnings, I would like to know which
are the ones
2003 Apr 09
1
'Apparently' trouble with name spaces and Sweave...
Ben Bolstad experienced something odd while running R CMD check over
a package of ours using r-devel (yesterday's fresh).
He tracked down the problem to a vignette calling 'library(MASS)'.
Please kindly ignore if this is a known (and temporary) issue.
Laurent
----- Forwarded message from Ben Bolstad <bolstad@stat.berkeley.edu> -----
Return-Path:
2003 Mar 17
2
search function
Could any one tell me there is a search
function for R-help Archives?
Thanks
2003 Mar 11
1
R CMD check (again)
Hi,
R-devel causes me still trouble. It dies with
Error: couldn't find function "predict.loess"
Execution halted
for the package affy, but
bash-2.04$ grep predict.loess ~/R-devel/src/library/modreg/R/*.R
/misc/homes/laurent/R-devel/src/library/modreg/R/loess.R:predict.loess <- function(object, newdata = NULL, se = FALSE, ...)
bash-2.04$
..the function seems to be there...
2004 Jul 16
1
labels for 3d Plots
High!
How can I add variable labels (rownames for instance) to a plot created
with ‚clouds’ ( clouds(dim3~dim1*dim2)) – package lattice?
Thanks in advance!
Martina Renninger
[[alternative HTML version deleted]]
2001 Jun 12
1
trouble to install the Rstream package
Dear R-users,
I successfully installed the package Rstreams under linux, but my first
attempt to do so on SGI IRIX 6.5 (64bits) lead to the following error
message.
--------------------
laurent at genome> R CMD INSTALL Rstreams
Installing source package `Rstreams' ...
creating cache ./config.cache
checking for ftruncate... yes
checking size of long double... 16
updating cache