Displaying 20 results from an estimated 1000 matches similar to: "Applying a function to a vector"
2006 Jan 12
2
tapply and weighted means
I' m trying to compute weighted mean on different
groups but it only returns NA. If I use the following
data.frame truc:
x y w
1 1 1
1 2 2
1 3 1
1 4 2
0 2 1
0 3 2
0 4 1
0 5 1
where x is a factor, and then use the command :
tapply(truc$y,list(truc$x),wtd.mean, weights=truc$w)
I just get NA. What's the problem ? What can I do ?
2005 Dec 13
1
bug in geoR (?)
I've enconuntered this problem with the last cran version of geoR:
> library(geoR)
> day <- rep(1:2, each=5)
> coords <- matrix(rep(runif(10),2), 10, 2)
> data <- rnorm(10)
> data[1] <- NA
> as.geodata(cbind(coords, data, day), realisations=4)
as.geodata: 1 points removed due to NA in the data
Errore in as.geodata(cbind(coords, data, day), realisations = 4) :
2006 Jun 28
1
calculating the spacial autocorrelation for poisson data
Um texto embutido e sem conjunto de caracteres especificado associado...
Nome: n?o dispon?vel
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060628/2ff7714d/attachment.pl
2005 Dec 29
1
Help with Kriging
R Experts,
I'm looking for some help with the geoR package. I'm trying to krig
some data without using a global neighborhood. I would like to set my
moving neighborhood to a distance, say 100 meters, where I know my data
is spatially correlated. I have tried the ksline function, but that
only allows my moving neighborhood to be set to a number of data points.
But, since my data
2006 Aug 08
1
parameter yaxs / function hist (graphics)
Dear R users,
The parameters xaxs and yaxs (function par, package graphics)
seem not to work with the function hist (package graphics),
even when the parameters xlim and ylim are defined.
Is there any way to make yaxs="i" and xaxs="i" work properly
with the function hist, mainly to produce histograms that
"touch" the horizontal axis? The R documentation and the
R
2005 May 06
4
Change class factor to numeric
I am attempting to develop a multiple regression model using selected
model variables that should all be treated as numeric (mostly real)
values.
However, R considers one specific variable "mass" automatically to be of
class "factor", probably because "mass" consists of integer values that
are repeated.
I now want to force R to treat "mass" as a numeric
2006 Mar 17
3
can't load "geoR"
Dear R list,
I've just installed R and then followed the instructions to install the
package "geoR" from within R by using the following line of code:
install.packages("geoR", contriburl = "http://www.est.ufpr.br/geoR/windows")
This installed okay under the folder C:\documents and settings\ ...
But when I follow the instructions in the illustrative session
2005 Oct 26
4
symbolic math
Hi all!
Does anyone knows if it exists a "symbolic math" package in R, that allows to compute derivatives, integrals, etc.?
Does exist a freeware version of Maple?
Cheers,
Marco
[[alternative HTML version deleted]]
2006 Jun 02
1
geoR, plot of variog4 lines incomplete
I'm using R for Mac OSX version 1.14 (2129) and the geoR package
version 1.6-5 (the current version in the R repository). I'm running
R in OS 10.4.6 on a Mac G4 iBook (933MHz, 640 MB DDR SDRAM). I
searched the R archive and did not find a posting on this issue.
I want to use the variog and variog4 functions of geoR to
characterize the pattern of spatial autocorrelation of tree
2005 Feb 18
2
Using sweave
hello,
Suppose in Rnw file, I compute a numeric of name x containing the value 1.
In my tex file, I want to write
Let x= "the real value of x"
so that I can see in my dvi file : Let x = 1,
with 1, the actual value of x written in a math environnement for example.
Thanks,
Matthieu
2005 Jan 05
4
make R package for windows on Linux
Hi,
I made a package on a linux box. All worked fine.
The package contains only R code (no C). I then wanted to make a zip
file so that I could test the package on a windows machine. I have tried
all the obvious ways to do this (and even some that are not!), but to no
avail. The only instructions I find about building packages for windows
(e.g. mypkg.zip) seem to imply that the build be done
2007 Dec 09
2
adjusting "levels" after subset a table
Um texto embutido e sem conjunto de caracteres especificado associado...
Nome: n?o dispon?vel
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071208/5409f1a7/attachment.pl
2008 Aug 04
1
R and emacs
I wrote a "program" truc.r with emacs
In emacs, I start the buffer R, then I eval the buffer truc.r (C-c C-b)
All is correct and I have my results.
But, when I return to Console R, and make:
> source ("truc.r"), I obtain an error:
Erreur dans source("truc.r") :
invalid multibyte character in parser at line 1
If I copy, line by line the instructions of the
2004 Dec 29
3
gls model and matrix operations
Dear List:
I am estimating a gls model and am having to make some rather unconventional modifications to handle a particular problem I have identified. My aim is to fit a GLS with an AR1 structure, obtain the variance-covariance matrix (V), modify it as needed given my research problem, and then reestimate the GLS by brute force using matrix operations. All seems to be working almost perfectly,
2011 Aug 06
1
multcomp::glht() doesn't work for an incomplete factorial using aov()?
Hi R users,
I sent a message yesterday about NA in model estimates (
http://r.789695.n4.nabble.com/How-set-lm-to-don-t-return-NA-in-summary-td3722587.html).
If I use aov() instead of lm() I get no NA in model estimates and I use
gmodels::estimable() without problems. Ok!
Now I'm performing a lot of contrasts and I need correcting for
multiplicity. So, I can use multcomp::glht() for this.
2011 Feb 15
1
ternary contour plot
Colin,
If your propose is to create a ternary plot with points and vectors, I think easier do this with graphics based plots instead of trellis based plots. Although, with little work you can do with trellis too. I gave you a reproducible code to put an arrow in a ternary plot. I use the function locator() to extract coordinates. The code is the following
2008 Aug 03
1
(sans objet)
- Peut-on poser des questions en fran?ais?
- Tr?s simple. Je fais un programme "truc.r" (sous emacs)
Ce programme r?alise des graphiques.
Je voudrais les enregistrer au fur et ? mesure -- sinon, quand la
session est finie, ces graphiques sont perdus--
J'ai essay?:
pdf("truc.pdf")
Mais le fichier "truc.pdf" cr?? est vide.
Comment fait-on?
Merci et salutations
2008 Aug 15
1
Strange error message from geoR´s likfit () lik. max. func.
ComRades:
I am geeting the error message
Error in ldots[[which(MET)]] : attempt to select less than one element
when I try to fit the geostatistical model with the likfit() function of
geoR.
I have tried with old data for which likfit() successfully maximised the
likelihood in previous versions of geoR, and yet the current version
fails.
I have tried in Windows Vista and Windows XP (I haven't
2007 Aug 01
1
Re : Custom axis
Maybe I do not explain well what I would like to do. I do not want to change the labels of the axis, but the scale. What I want is a general procedure for changing the scale. Its like using a logarithmic scale on a plot. Labels are the same, but the increases of x along the x-axis are defined by a known monotone and continuous function.
Florent Bresson
----- Message d'origine ----
De :
2006 Feb 09
3
about Cox-Box transformation
Dear R-users,
I am using R version 1.8.0-1 under Suse 8.2.
I need to use the boxcox command because I want to apply a Cox-Box
transformation to a vector of rainfall values.
Within the libraries, the MASS library is present, but I don't know
whether this means that is automatically installed or not.
The command doesn't work. What do I have to do in order to make it
working? Is just a