Displaying 20 results from an estimated 900 matches similar to: "How to avoid "$ operator is invalid for atomic vectors""
2012 Sep 13
5
random sampling inside a dataset
Hi all,
I am wondering if do exist a function in R that allow me to sample or
choose randomly the rows (i.e., samples) inside a given matrix.
Thank you very much in advance.
Cheers,
--
Gian
[[alternative HTML version deleted]]
2008 Dec 09
3
Significance of slopes
Hello R community,
I have a question regarding correlation and regression analysis. I have
two variables, x and y. Both have a standard deviation of 1; thus,
correlation and slope from the linear regression (which also must have
an intercept of zero) are equal.
I want to probe two particular questions:
1) Is the slope significantly different from zero? This should be easy
with the lm
2001 Oct 15
1
Crash of RGui under Windows 2000 (PR#1131)
Full_Name: Davide Fiaschi
Version: R 1.3.1 and 1.2.3
OS: Windows 2000
Submission from: (NULL) (131.114.67.164)
When I try to start RGUI, it generates an error in application and R chashs.
(NOTE: R worked very well with trial version of Windows 2000!)
Here is the (not very informative form me) Dr Watson's report:
Exception dell'applicazione:
App: (pid=1140)
Ora:
2009 Sep 30
2
Compress (gzip) a pdf device
I have not found an easy way to compress a file on filesystem.
Especially I'd like to compress a pdf from pdf() function/device. Is it possible to compress It on the flight?
I'd like to do something like:
pdf(gzipconnection())
dev.off()
If It is not possible, how can I create a gzip with the pdf?
Thanks
Daniele A.
________________________________
ORS Srl
Via Agostino Morando 1/3
2009 Feb 11
3
Filter a big matrix
Hi,
I have a big matrix X with M rows and N columns that I want to filter
it into smaller ones with m (<M) rows and N columns.
The filter rule is based on the values of each columns, i.e.
X looks like this:
column name: a, b, c, d, ... etc
a b c d ...
1 2 3 4 ...
5 6 7 8 ...
9 8 7 6 ...
... ... ... ...
The filter rule with the result that I want is:
2012 Oct 14
1
plotting principal components on geographic map
Dear all,
I have a dataset representing several geographical points (locations), each
one having a specific value after performing a PCA.
Now I'm trying to understand how to separately represent on a geographic
map (of Europe) the pattern of PC1,2, ecc.with colors (e.g.heatmap)
I have to add that the dataset includes relatively few points. Therefore, I
would also like to interpolate the values
2009 Oct 06
1
Spatial Autocorrelation
Hello,
I have a matrix with the distances among sites. And I have another matrix
with the presence and absence of each species in each site. I would like to
test the spatial autocorrelation among sites.
I have tried to use the function gearymoran of the ade4 package, but error
messages keep popping up. Do you know any function for me to test the
spatial autocorrelation of my data?
Thanks,
2008 Dec 09
2
motif search
Hi,
I am very new to R and wanted to know if there is a package that, given
very long nucleotide sequences, searches and identifies short (7-10nt)
motifs.. I would like to look for enrichment of certain motifs in
genomic sequences.
I tried using MEME (not an R package, I know), but the online version
only allows sequences up to MAX 60000 nucleotides, and that's too short
for my needs..
2009 Jan 26
3
Tinn-R
Hi Everyone,
I was hoping someone could help me with the settings for Tinn-R. I see in the screen shots that it has syntax help, or something similar (tips on what functions, etc). I can not seem to get this to turn on in the program, and I am wondering if I have to set up a few options. I quickly read through the help and could not figure it out.
Many thanks!
- Brock
P.S. It appears as
2010 Apr 02
2
How to save a model in DB and retrieve It
I'm wondering how to save an object (models like lm, loess, etc) in a DB to retrieve and use it afterwards, an example:
wind_ms <- abs(rnorm(24*30)*4+8)
air_kgm3 <- rnorm(24*30, 0.1)*0.1 + 1.1
wind_dg <- rnorm(24*30) * 360/7
ms <- c(0:25)
kw_mm92 <- c(0,0,0,20,94,205,391,645,979,1375,1795,2000,2040)
kw_mm92 <- c(kw_mm92, rep(2050, length(ms)-length(kw_mm92)))
modelspline
2009 Jan 29
2
Taking the min of each row in a matrix
Hi,
I'm a new user. I've been reading through the manual and looking at
various examples but am still trying to make sense of the most
efficient ways to handle matrices of data.
If I have a 2D matrix of data, how do I get the mean, min, max value
of each row? I see the "mean" function on a matrix will give me
averages by row, but min and max give me the value for the entire
2008 Jul 22
4
Function Error
Hi,
Why this function doesn't work?
function (x)
{
if (is.factor(x)) {
if (!is.ordered(x)) {
warning("La mediana non si puo' calcolare!!!")
return(NA)
}
me <- median(unclass(x))
if (me - floor(me) != 0) {
warning("Mediana indeterminata")
return(NA)
}
else
2008 May 08
1
ARIMA, AR, STEP
Here is my problem:
Autoregressive models are very interesting in forecasting consumptions (eg water, gas etc).
Generally time series of this type have a long history with relatively simple patterns and can be useful to add external regressors for calendar events (holydays, vacations etc).
arima() is a very powerful function but kalman filter is very slow (and I foun difficulties of estimation)
2008 Oct 01
1
How to label a "vector"
Hi,
I have an object, Z:
> typeof(Z)
[1] "list"
It looks like:
[,1] [,2] [,3]
[1,] 1 1 1
[2,] 1 1 1
How can it label the Rows and Columns with Text? so that it looks like:
Y1 Y2 Y3
X1 1 1 1
X2 1 1 1
Thanks,
cruz
2006 Jul 06
1
Bug test di Rails
salve a tutti,
sentite, non riesco a capire i test automatizzati di Rails.
Secondo il libro, il ciclo di vita di un test prevede che per ogni
metodo ( che sarebbe in pratica un test da eseguire ) si verificano
sempre 3 eventi:
1) la cancellazione di tutti i record della tabella in esame
2) il caricamento di tutti i dati di test elencati nel file di fixture
della tabella ( ad esempio
2012 Oct 10
2
GAM without intercept
Hi everybody,
I am trying to fit a GAM model without intercept using library mgcv.
However, the result has nothing to do with the observed data. In fact
the predicted points are far from the predicted points obtained from the
model with intercept. For example:
#First I generate some simulated data:
library(mgcv)
x<-seq(0,10,length=100)
y<-x^2+rnorm(100)
#then I fit a gam model with
2010 Feb 24
1
Optimise huge data.frame construction
I have data for different items (ID) in a database.
For each ID I have to get:
- Timestamp of the observation (timestamp);
- numerical value (val) that will be my response variable in some kind of model;
- a variable number of variables in a know set (if value for a specific variable is not present in DB it is 0).
To get to the above mentioned values I have to cycle
2009 Nov 09
1
adding zero to a number vector
Hi !
I'd like to create
a vector
that has this kind of numeration
001
002
003
.
.
.
099
I have looked at format help page but couldn't get
any hint on how to do it.
Thanks
Anna
Anna Freni Sterrantino
Ph.D Student
Department of Statistics
University of Bologna, Italy
via Belle Arti 41, 40124 BO.
[[alternative HTML version deleted]]
2012 May 31
1
inverse binomial in R
Hello!
I'm having some trouble
trying to replicate in R a Stata function
invbinomial(n,k,p)
Domain n: 1 to 1e+17
Domain k: 0 to n - 1
Domain p: 0 to 1 (exclusive)
Range: 0 to 1
Description: returns the inverse of the cumulative binomial; i.e., it
returns the probability of success on one trial such
2008 Nov 07
4
chi square table
Hi,
How do we get the value of a chi square as we usually look up on the
table on our text book?
i.e. Chi-square(0.01, df=8), the text book table gives 20.090
> dchisq(0.01, df=8)
[1] 1.036471e-08
> pchisq(0.01, df=8)
[1] 2.593772e-11
> qchisq(0.01, df=8)
[1] 1.646497
>
nono of them give me 20.090
Thanks,
cruz