Dear,
I computed pearson correlation coefficient between annual precipitation and
temperature in a grid system.
It is doubtful that there should be autocorrelation which might inflate the
P-coefficient.
Please kindly suggest any possible methods to filter autocorrelation.
Thanks
Elaine
Hi everybody
I have found something (for me at least) strange with duplicated(). I will
first provide a replicable example of a certain kind of behaviour that I
find odd and then give a sample of unexpected results from my own data. I
hope someone can help me understand this.
Consider the
probelm solved:
data - read.table(pdvspt.txt, header = T, dec = ,)
It was the coma, now I have everything in numeric.
Thanks a lot for the support!
Ale
--
View this message in context:
http://r.789695.n4.nabble.com/as-integer-tp2245987p2246989.html
Sent from the R help mailing list archive
Its a race! I decided to go ahead and time everyone's results, and
all of the method's (except mine) are around the same speed. I ran
them a few times and Gabor's application of melt() tends to be a tad
bit faster than the other two, although that is far from conclusive --
do these methods share
Thanks,
That thread talks about adding values to NA. However, the problem with my
data is that the missing data points aren't even in the data.frame.
The method I think of is using a loop to check ID by ID, if the date column
contains all elements of unique(Returns.names$date_), and if not add
Dear Mr. or Ms.,
I used the R-software to run the zero-inflatoin negative binomial model
(zeroinfl()) .
Firstly, I introduced one dummy variable to the model as an independent
variable, and I got the estimators of parameters. But the results are not
satisfied to me. So I introduced three
I tried to read a CSV file in R. The file has about 100,000 records and 75
columns. When used read.delim, I got this error. I am using R ver 10.1.
los-read.delim(file.csv,header=T,sep=,)
Warning message:
In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
Reached total
Hey All,
I have just recently thought of a completely different way to accomplish my
analysis (requiring different type of coding)
Instead of going in and filling in data, I could remove any dates not shared
by ALL the id's.
I was thinking about accomplishing this using merge(~~), do you think
Hi,
thanks for your reply.
I attached the example.
I tried your suggestion:
data[is.factor(data)] - lapply(data[is.factor(data)], function(x)
as.numeric(as.character(x)))
But I still have the var as factors.
I'm thinking now, in the txt file the decimals numbers are separated with a
coma.
Dear colleagues,
What did I not understand ?
-my intention
I want to create a new variable:
In plain language:
If someone is taking anithypertensive treatment (med.hyper==1)
table(med.hyper)
med.hyper
0 1
472 97
I want to subtract 5 mmHg (rr.dia.2m-5) from the measured diastolic
blood
Hi
I want to do leave-one-out cross-validation for multinomial logistic regression
in R. I did multinomial logistic reg. by package nnet in R. How I do
validation? by which function?
response variable has 7 levels
please help me
Thanks alot
Azam
[[alternative HTML version
Hi Peter!
The 'if' function operate on a single logical expression, while you provided
a vector. What your code does at present is subtract 5 from all values in
rr.dia.2m if the first value in med.hyper is 1 and otherwise simply returns
all values as is. Since you have no reproducible data, it's
Hi,
You are using if/then/else which is a logical control statement and so doesn't
return a value, see
?if
for details.
You are probably looking for the ifelse function.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of
Dear All
I have some problem about *netWorkSpace command.*.I am following the nws
tutorial. My operating system is windows XP and R version is 2.11.1.
My intention is to share data between different programs. I
hope NWS package is good for distributed and parallel data transfer.
First I started
On 06/06/2010 10:49 PM, Mark Seeto wrote:
Hello,
I have a couple of questions about the ols function in Frank Harrell's
rms
package.
Is there any way to specify variables by their column number in the data
frame rather than by the variable name?
For example,
library(rms)
x1-
On 06/07/2010 10:05 PM, ogbos okike wrote:
Greetings to you all.
I have two datasets - Time and magnitude. For a particular location, the
magnitude of the parameter varies with time. I wish to obtain a polar
coordinate distribution of time (0-24h) and magnitudes so as to visualize
how
Hi
r-help-boun...@r-project.org napsal dne 08.06.2010 08:44:39:
Hi everybody
I have found something (for me at least) strange with duplicated(). I
will
first provide a replicable example of a certain kind of behaviour that I
find odd and then give a sample of unexpected results from my
Hi
r-help-boun...@r-project.org napsal dne 08.06.2010 11:46:17:
Hi,
You are using if/then/else which is a logical control statement and so
doesn't
return a value, see
?if
for details.
You are probably looking for the ifelse function.
Or use possibility of easy conversion logical
As far as my knowledge goes, nnet doesn't have a built-in function for
crossvalidation. Coding it yourself is not hard though. Nnet is used
in this book : http://www.stats.ox.ac.uk/pub/MASS4/ , which contains
enough examples on how to do so.
See also the crossval function in the bootstrap
That will be R 2.10.1 if I'm correct.
For reading in csv files, there's a function read.csv who does just that:
los - read.csv(file.csv,header=T)
But that is just a detail. You have problems with your memory, but
that's not caused by the size of your dataframe. On my system, a
matrix with
Install the caret package and see ?train. There is also:
http://cran.r-project.org/web/packages/caret/vignettes/caretTrain.pdf
http://www.jstatsoft.org/v28/i05/paper
Max
On Tue, Jun 8, 2010 at 5:34 AM, azam jaafari azamjaaf...@yahoo.com wrote:
Hi
I want to do leave-one-out
First, read the posting guides.
Then, supply us with a bit more information, like the package you
used, example code that reproduces the error, information about the
data, the complete error message, the traceback (use the function
traceback() right after you got the error).
Otherwise we ain't
Hi
Hm, maybe you can first make a sequence of all required dates and ids,
construct empty data frame with all possible dates, merge your existing
data frame with empty one just to fill in all dates, get rid of duplicated
dates and ids if necessary and finally use na.locf from zoo library to
Hello everyone,
This is just a quick double check. It concerns the 'scatterplot function' in
R.
I have 6 curves and I wish to represent each of them by a different kind of
line (their colour must be black).
The curves are derived from the cuminc function...the coordinates of which are
in
Thanks for your help Petr
I think I understand better now.
Masechaba$unique[which(is.na(unique(Masechaba$PROPDESC))==FALSE)]=TRUE
^^^
This seems to be strange. At first sight I am puzzlet what result I shall
expect from such
Hi All,
I want to add one point to contourplot(). I used contourplot() in my code like
contourplot(z ~ a + b |c, data)
I understand there is plot.axes argument for filled.contour(), but it did not
work for my code. I also tried plot() and text() for contourplot(), but got
this error: plot.new
On Tuesday, June 8, 2010, christiaan pauw cjp...@gmail.com wrote:
Hi everybody
I have found something (for me at least) strange with duplicated(). I will
first provide a replicable example of a certain kind of behaviour that I
find odd and then give a sample of unexpected results from my own
cmmu_mile at yahoo.com writes:
Hi,
I have used DeSolve package for my ODE problem regarding
infectious disease transmission and currently am
trying to pass lots (roughly a thousand) of model parameters
to the C compiled model (I have to use C
compiled code instead of R code purely
Thank you to all for your help!
I received
two equal alternative solutions that bypassed elegantly the problem
from peter.l.e.koni...@gmail.com
and
rafael.bj...@gmail.com
rr.dia2.corr - rr.dia.2m
rr.dia2.corr[which(med.hyper == 1)] - rr.dia.2m[which(med.hyper == 1)] - 5
From
On 06/08/2010 05:29 AM, Mark Seeto wrote:
On 06/06/2010 10:49 PM, Mark Seeto wrote:
Hello,
I have a couple of questions about the ols function in Frank Harrell's
rms
package.
Is there any way to specify variables by their column number in the data
frame rather than by the variable name?
Hi
r-help-boun...@r-project.org napsal dne 08.06.2010 14:21:10:
Thank you to all for your help!
I received
two equal alternative solutions that bypassed elegantly the problem
from peter.l.e.koni...@gmail.com
and
rafael.bj...@gmail.com
rr.dia2.corr - rr.dia.2m
The only goals I remember are that the Hand of God was at 6 min second period
and the
Goal of the Century at 11 min second period
The others dont count.
HG
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of
Paul
Hello,
I am having some trouble running a very simple
example. I am running a logistic regression entering the SAME data set
in two different forms and getting different values for the deviance residual.
Just look with this naive data set:
Thanks for the advice. I found the function : summary(mcmc(x)), from the
coda package.
2010/6/4 Gavin Simpson gavin.simp...@ucl.ac.uk
On Thu, 2010-06-03 at 23:44 +0200, Jimmy Söderly wrote:
Thanks for your help.
Does it have something to do with the mcmc package, the coda package, or
Hi everyone
I want to install Rmpi to use R in parallel mode in a Linux cluster
(Ubuntu, Hardy Heron). It seems to be properly installed but a problem
appears when loading Rmpi library.
R version 2.11.1 (2010-05-31)
library(Rmpi)
Error: package 'Rmpi' was built before R 2.10.0: please
I have a large correlation matrix that I'm trying to convert to a list of
every connection (edge) between every two nodes with its accompanying
correlation value (for Cytoscape). I figured out how to do this and to
remove the connections that nodes have to themselves but I can't figure out
how to
Hi,)
I am just getting started with R but have hit an early snag. I am working
through Crawley (2008) The R Book and on page 6, 'Significance Stars', I am
trying to enter the commands given. However, 'Gain.txt' does not seem to have
been downloaded when I downloaded the R programme.
I have
Dear all,
an hopefully quick table question.
I have the following data:
Two objects that are 2*9 matrix with nine column names (Dis1, ...,
Dis9) and the row names (2010,2020). The content are frequencies
(numeric).
In want to create a table that is along the lines of
ftable(UCBAdmissions) and
The author's site is here:
http://www.bio.ic.ac.uk/research/mjcraw/therbook/
and you can read the file right off his site like this:
URL - http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/Gain.txt;
gg - read.table(URL, header = TRUE)
On Tue, Jun 8, 2010 at 9:37 AM, Andrew Kelly
Try this:
m - matrix(Corr, ncol = 3, dimnames = list(unique(NodesRow),
unique(NodesCol)))
m[col(m) == row(m) | upper.tri(m)] - NA
subset(as.data.frame.table(m), !is.na(Freq))
On Tue, Jun 8, 2010 at 10:29 AM, Matthew DiLeo mv...@cornell.edu wrote:
I have a large correlation matrix that I'm
On 08.06.2010 15:17, Paco Pastor wrote:
Hi everyone
I want to install Rmpi to use R in parallel mode in a Linux cluster
(Ubuntu, Hardy Heron). It seems to be properly installed but a problem
appears when loading Rmpi library.
R version 2.11.1 (2010-05-31)
library(Rmpi)
Error: package
Dear R People:
I have the following data frame:
str(dog.df)
'data.frame': 7 obs. of 2 variables:
$ V1: Factor w/ 3 levels 1/1/2000,1/2/2000,..: 1 1 1 2 2 3 3
$ V2: Factor w/ 3 levels cat,dog,tree: 2 1 3 1 3 2 3
dog.df
V1 V2
1 1/1/2000 dog
2 1/1/2000 cat
3 1/1/2000 tree
4
Here is a particular way to solve the problem:
test3 - seq(from=as.Date(1/1/2000,%m/%d/%Y),to=as.Date(1/3/2000,
+ %m/%d/%Y),length=3)
test3
[1] 2000-01-01 2000-01-02 2000-01-03
zoo(table(dog.df$V1,dog.df$V2)[,1],order=test3)
2000-01-01 2000-01-02 2000-01-03
1 1 0
Am 08.06.2010 16:52, schrieb Erin Hodgess:
I would like to set up 3 time series; one for dog, one for cat, one
for tree, such that each runs from 1/1/2000 to 1/3/2000, with 0 if
there is no entry for the day.
Before using zoo or zooreg you should transform your data.frame as such
as
Hi R Users,
I want to distinguish different condition by different symbols by pch in
function grid.points, but the symbols needed should be with solid or hollow,
in this way only 21 to 25 in pch worked, is there any other symbols could be
used like this? or does it exist any other way to draw
Am 08.06.2010 17:04, schrieb Erin Hodgess:
Here is a particular way to solve the problem:
If you solve your own problem then please reply to your own message
otherwise things get confused. How should one know what your problem was
without knowing your first e-mail - if you reply your own
I am looking at a new project involving time series analysis. I know I can
complete the tasks involving VARMA using either dse or mAr (and I think
there are a couple others that might serve).
However, there is one task that I am not sure of the best way to proceed.
A simple example illustrates
We wish to announce the new package:
fdth - Frequency Distribution Table and Associated Histogram.
The package contains a a set of high level function which easily allows the
user
to make a frequency distribution table (fdt) and its associated plots.
The fdt can be formatted in many ways which
The first time I posted this it got held up for approval so I am
trying it again. Hopefully this time it gets through right away.
As with your prior post we can use read.zoo(..., split=...).
Alternatives are reshape and reshape::cast.
# read data into DF
Lines - V1 V2
1 1/1/2000 dog
2
On Tue, Jun 8, 2010 at 7:10 AM, Enrico Colosimo enrico...@gmail.com wrote:
Hello,
I am having some trouble running a very simple
example. I am running a logistic regression entering the SAME data set
in two different forms and getting different values for the deviance residual.
Just look
Hi All,
I'm trying to estimate some parameters in my model via GMM using the
function gmm(), but I keep getting the message The covariance matrix of
the coefficients is singular. I've changed the moment conditions and
the initial value of the parameters, and I still get this message. Are
the
I could get something close to what you asked using a little hack,
emulating a table using an array based on your two matrices :
test - matrix(rpois(18,10),ncol=9,nrow=2)
colnames(test) - paste(Dis,1:9,sep=)
rownames(test) - c(2010,2020)
test2 - matrix(rpois(18,10),ncol=9,nrow=2)
colnames(test2)
Hi there,
I've read a file into a data frame. The data is n rows by m columns, all values
are numbers.
Is there a way to convert the data frame to a 2D array? I tried as.array(), but
got some
error messages.
Thanks
A. Huang
[[alternative HTML version deleted]]
Hi,
Does this work?
array(data=unlist(yourdataframe), dim=c(n,m))
Josh
On Tue, Jun 8, 2010 at 9:07 AM, A Huang mytechfo...@yahoo.com wrote:
Hi there,
I've read a file into a data frame. The data is n rows by m columns, all
values are numbers.
Is there a way to convert the data frame to
test - data.frame(x=1:10,y=1:10)
as.array(as.matrix(test))
does the job too
Cheers
On Tue, Jun 8, 2010 at 6:07 PM, A Huang mytechfo...@yahoo.com wrote:
Hi there,
I've read a file into a data frame. The data is n rows by m columns, all
values are numbers.
Is there a way to convert the data
Because contourplot comes from the lattice package, I think you'll want to
look at these help pages:
+ help(trellis.focus)
+ help(lpoints)
Below, I've used the example from help(contourplot) to demonstrate how one
might add points and text to a lattice plot.
-tgs
#
You really need to do some studying on mixed effects models. Some resources
are at: http://lme4.r-forge.r-project.org/
Your formula below is wrong, you fit only the intercept as a fixed effect and
you are fitting a random slope on animal by day for the random effect, which
does not make much
The my.symbols function (TeachingDemos package) allows for defining your own
symbols to use in plots using base graphics (see ms.filled.polygon for an
example), there is also panel.my.symbols which works with lattice (possibly
with general grid, but I have not tested it that way).
Those may
Hi All ,
For an academic project I am trying to do the following
Step 1 ) Draw and cluster a N ( lets say 3 ) column dataset by dbscan
algorithm using R-projectâs fpc package ( let say they are training
clusters ) ,
Using dbscan as number of clusters are not know
Thank you. It works like a charm.
A. Huang
From: Joshua Wiley jwiley.ps...@gmail.com
Cc: r-help@r-project.org
Sent: Tue, June 8, 2010 9:19:19 AM
Subject: Re: [R] Convert a data frame to a 2D array?
Hi,
Does this work?
array(data=unlist(yourdataframe),
Hello.
Somebody knows how to compute generalized hypergeometric series in R?
(see
http://functions.wolfram.com/HypergeometricFunctions/HypergeometricPFQ/02/
to understand what I mean)
Thanks in advance,
Arnau.
__
R-help@r-project.org mailing list
Mount soapbox; begin rant {
... However I think it should be added that rarely does this work with more
than about a half dozen different symbols: a viewer of a graphic simply
cannot keep the distinctions straight -- or often even decode them. Using
color to distinguish groups is typically more
Hello I am using POSIXlt date format and I am having the following problem,
I've got two dates called FechaIni and FechaFin, one in 2008 and the other
in 2009 but when I do FechaIni$year and FechaFin$year to call the year I am
getting the smae year for both.
FechaIni
[1] 2008-11-13 UTC
FechaFin
Luis Felipe Parra wrote:
Hello I am using POSIXlt date format and I am having the following problem,
I've got two dates called FechaIni and FechaFin, one in 2008 and the other
in 2009 but when I do FechaIni$year and FechaFin$year to call the year I am
getting the smae year for both.
FechaIni
On 08-Jun-10 18:00:18, Bert Gunter wrote:
Mount soapbox; begin rant {
... However I think it should be added that rarely does this work with
more than about a half dozen different symbols: a viewer of a graphic
simply cannot keep the distinctions straight -- or often even decode
them. Using
Hi Joris,
thanks for your help. I just had to alter it slightly (basically just
transposing):
tmp - array(rbind(t(test),t(test2)),
dim=c(9,2,2),
dimnames=list(colnames(test),rownames(test),c(Test,Test2)))
ftable(tmp)
Thanks again!
Best,
Stefan
On Tue, Jun 8, 2010 at 5:46
Hi list,
I have two question relating to the Rsymphony package:
a) is there a way to use 'warm starts' ?
i.e. if i successively call Rsymphony_solve_LP()
with only one constraints change, does it perform the optimization
from the simplex-origin or does it uses the previously found solution
On 06/08/2010 05:29 AM, Mark Seeto wrote:
On 06/06/2010 10:49 PM, Mark Seeto wrote:
Hello,
I have a couple of questions about the ols function in Frank Harrell's
rms
package.
Is there any way to specify variables by their column number in the
data
frame rather than by the variable
While it is possible to set your own dash patterns as you show below, it is
unlikely that the resulting graph will be very meaningful. Most people cannot
keep the detailed dash patterns separate, and if they need to refer to a legend
then it makes it even harder (See Bert Gunter's rant on the
Arnau Mir arnau.mir at uib.es writes:
Hello.
Somebody knows how to compute generalized hypergeometric series in R?
(see
http://functions.wolfram.com/HypergeometricFunctions/HypergeometricPFQ/02/
to understand what I mean)
library(sos)
findFn(generalized hypergeometric function)
-
Dear R People:
So thanks to your help, I have the following:
dog3.df -
read.delim(c:/Users/erin/Documents/dog1.txt,header=FALSE,sep=\t)
dog3.df
V1 V2
1 1/1/2000 dog
2 1/1/2000 cat
3 1/1/2000 tree
4 1/1/2000 dog
5 1/2/2000 cat
6 1/2/2000 cat
7 1/2/2000 cat
8 1/2/2000
Hi,
I'm analyzing my data using GEE, which looks like below:
interact - geeglm(L ~ O + A + O:A,
+ data = data1, id = id,
+ family = binomial, corstr = ar1)
summary(interact)
Call:
geeglm(formula = lateral ~ ontask + attachment + ontask:attachment,
family = binomial, data =
On Tue, 8 Jun 2010, Sachi Ito wrote:
Hi,
I'm analyzing my data using GEE, which looks like below:
interact - geeglm(L ~ O + A + O:A,
+ data = data1, id = id,
+ family = binomial, corstr = ar1)
summary(interact)
Call:
geeglm(formula = lateral ~ ontask + attachment + ontask:attachment,
I am mainly a Java/C++ programmer, so my mind is used to iterating over data
with for loops. After a long break, I am trying to get back into the R
mindset, but I could not find a solution in the documentation for the applys,
aggregate, or by.
I have a data.frame where each row is an entry
Hi R users,
I am trying to omit rows of data based on partial matches an example of my
data (seal_dist) is below:
A quick break down of my coding and why I need to answer this - I am dealing
with a colony of seals where for example A1 is a female with pup and A1.1 is
that female's pup, the
Try this:
xtabs( ~ V1 + V2, transform(dog3.df, V1 = factor(V1, levels =
as.character(seq(min(dog3.df$V1), max(dog3.df$V1), by = days)
On Tue, Jun 8, 2010 at 4:52 PM, Erin Hodgess erinm.hodg...@gmail.comwrote:
Dear R People:
So thanks to your help, I have the following:
dog3.df -
Hi, all.
Yet another beginner to R : )
I wonder, how it's possible to get the value of a coefficient from the
object produced by cor.test() ?
cor.test(a, b, method=spearman)
Spearman's rank correlation rho
data: a and b
S = 21554.28, p-value = 2.496e-11
alternative hypothesis: true
result - cor.test(a,b,method=spearman)
result$estimate
Cheers
Joris
On Tue, Jun 8, 2010 at 10:40 PM, Ekaterina Pek ekaterina@gmail.com wrote:
Hi, all.
Yet another beginner to R : )
I wonder, how it's possible to get the value of a coefficient from the
object produced by cor.test() ?
Ekaterina Pek wrote:
Hi, all.
Yet another beginner to R : )
I wonder, how it's possible to get the value of a coefficient from the
object produced by cor.test() ?
cor.test(a, b, method=spearman)
You can always assign the value of a function to a variable, and then
use ?str to see the
you should have found a solution for that in the help page of apply.
just run
min.values = apply(the.data,1,min)
the '1' marks the direction (e.g. whether apply is applied to rows or
columns), it could be a 2 as well. Check that yourself in the apply
documentation.
Then run
Once again my message got held up for moderator approval so I
am deleting it and trying again. Hopefully this one goes through.
In general, we will get the simplest usage if we match the problem to
the appropriate OO class. In this case we are using time series so it
is advantageous to use a time
Is this what you are looking for:
# assume females start with A
# extract first part if female from ID
x.id - sub((A[[:digit:]]+).*, \\1, x$ID)
# now see if this pattern matches first part of TO_ID
x.match - x.id == substring(x$TO_ID, 1, nchar(x.id))
# here are the ones that would be
Folks, i thought it should be straightforward but after a few hours poking
around, I decided it's best to post my question on this list.
I have a data frame consisting of a (large) number of date columns, which are
read in from a csv file as character string. I want to convert them to Date
The short answer is, don't use apply() on data.frame's.
Use lapply to loop over the columns of a data.frame.
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Horace Tso
Sent: Tuesday, June 08, 2010 2:19 PM
To:
Hello,
vegMeans - by(SoilVegHydro[3:37] , SoilVegHydro$Physiogomy, mean)
vegSD - by(SoilVegHydro[3:37] , SoilVegHydro$Physiogomy, sd)
write.table(vegMeans,
file=A:\\Work_Area\\Steve\\Hydrology_Data\\data\\vegMeans.txt)
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors
You need lapply here:
df[2:3] - lapply(df[2:3], as.Date, '%m/%d/%Y')
On Tue, Jun 8, 2010 at 6:19 PM, Horace Tso horace@pgn.com wrote:
Folks, i thought it should be straightforward but after a few hours poking
around, I decided it's best to post my question on this list.
I have a
Guys, many thanks. lapply works. Did not occur to me as I thought lapply
returns a list and the receiving entity is a data frame.
H
-Original Message-
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Tuesday, June 08, 2010 2:22 PM
To: Horace Tso; r-help@r-project.org
Subject:
I did not go too deep into your zoology problem ;-) but as far as I
understood you, you want to omit all rows where
ID and TO_ID are A1 and A1.1, (or A2) correct?
If the data you send us is all the data and if there do not occour any
different situations the following should be sufficient:
Not much to go on, but you might find
vegMeans = aggregate(SoilVegHydro[3:37],SoilVegHydro['Physiogomy'],mean)
and
vegSd = aggregate(SoilVegHydro[3:37],SoilVegHydro['Physiogomy'],sd)
more suitable for your needs. (Not run because I don't know what
SoilVegHydro is.)
don't forget to make the by option a list :
vegMeans = aggregate(SoilVegHydro[3:37],list(SoilVegHydro['Physiogomy']),mean)
and
vegSd = aggregate(SoilVegHydro[3:37],list(SoilVegHydro['Physiogomy']),sd)
see also ?aggregate
on a side note, it would be handy if that transformation to a list
would
Given the following snippet
m.nf.xts - xts(rep(0, length(index(m.xts))), order.by=index(m.xts))
Does R know to cache the index(m.xts) or is it more efficient to say...
m.i - index(m.xts)
m.nf.xts - xts(rep(0, length(m.i)), order.by=index(m.i))
?
cheers
Worik
[[alternative HTML
Hi,
I am relatively new to R; when creating functions, I run into problems with
missing values. I would like my functions to ignore rows with missing values
for arguments of my function) in the analysis (as for example is the case in
STATA). Note that I don't want my function to drop rows if
In the code fragment, I used 'by' to actually compute the min value (part of
the statement with the eval) - and I agree that an apply would work there
wonderfully.
However, my hope was to use an apply for the subsetting of the data.frame's
columns, so that I could then use an apply to compute
If I create a vector thusly
v1 - runif(20, min=0, max=1)
v1
[1] 0.9754443 0.6306228 0.3238158 0.3175769 0.6791534 0.6956507 0.3840803
[8] 0.1421328 0.8592398 0.4388306 0.9472040 0.4727435 0.5645302 0.7391616
[15] 0.6116199 0.2727754 0.2657867 0.5261744 0.8764804 0.2032126
And I want to
Here is one way
...
DF4 - cast(formula=Date~V2,data=DF3,value=X1,fill=0)
d - with(DF4, seq(min(Date), max(Date), by = 1)) ### full set
m - as.Date(setdiff(d, DF4$Date)) ### missing dates
if(length(m) 0) {
extras - cbind(data.frame(Date = m), cat = 0, dog = 0, tree = 0)
Hello,
This should work
v1 - runif(20, min=0, max=1)
v2 - v1 .3 | v1 .7 #you just need one | not two
HTH,
Josh
On Tue, Jun 8, 2010 at 3:38 PM, Worik R wor...@gmail.com wrote:
If I create a vector thusly
v1 - runif(20, min=0, max=1)
v1
[1] 0.9754443 0.6306228 0.3238158 0.3175769
Try
v1.3 | v1 .7
HTH,
Jorge
On Tue, Jun 8, 2010 at 6:38 PM, Worik R wrote:
If I create a vector thusly
v1 - runif(20, min=0, max=1)
v1
[1] 0.9754443 0.6306228 0.3238158 0.3175769 0.6791534 0.6956507 0.3840803
[8] 0.1421328 0.8592398 0.4388306 0.9472040 0.4727435 0.5645302
Hi there,
I use Rscript.exe for batch run (actually it is used in ASP.net code)
c:C:\Program Files\R\R-2.10.1\bin\Rscript.exe test.r xxx.txt
Where test.r is the r program and xxx.txt is a file name test.r will read in,
it comes from
a web form. This works fine, when the file is in required
Hi
grid.polygon() can do multiple polygons in a single call, but rather
than using NA's to separate sub-polygons, it uses an 'id' argument (or
an 'id.lengths' argument) to identify sub-polygons within the vectors of
x- and y-values (see the examples in ?grid.polygon). So a ggplot2 patch
Ross,
My apologies, I just discovered your email (from April) to the
R-help list serve asking about ICC in psych.
ICC does not remove missing data but rather lets the ANOVA handle it.
It is probably more appropriate work on complete cases (as does the
icc in the irr package).
that is
1 - 100 of 113 matches
Mail list logo