On Thu, 23 Sep 2010, Peter Ehlers wrote:
On 2010-09-21 5:51, Nikhil Kaza wrote:
example(factor)
iris1$Species- factor(iris1$Species, drop=T)
will get you what you need.
Hmm, doesn't work for me. ?factor does not list a 'drop='
argument.
I suspect
iris1$Species - [iris1$Species,
Great, thanks ! It works beautifully now.
Dr. Juliane Struve
Daphne Jackson Fellow
Imperial College London
Department of Life Sciences
Silwood Park Campus
Buckhurst Road
Ascot, Berkshire,
SL5 7PY, UK
Tel: +44 (0)20 7594 2527
Fax: +44 (0)1344 874 957
Hello,
thank you very much for replying. I have tried this, but I get error message
Error in .subset(x, j) : invalid subscript type 'list' after
z1 - read.zoo(textConnection(Lines1), skip = 1, index = list(1, 2), FUN = dt)
Regards,
Juliane
Dr. Juliane Struve
Daphne Jackson Fellow
If this has already been answered, my apologies in advance I am relatively
new to this aspect of [R]. it is a bit of a basic question.
I have 4 columns of data (site, Date, measurement type, value) in a tab
delimited text file. Site is a site where measurements were collected,
Date is a date
hi,
I considered multivariate multiple regression for respons, predictor, each 5
dimension.
on going process, through
initb - eigen(temp)$vectors[,1:3]
temp - vhalf%*%Kproduct(Ir,initb)
(herein 'vhalf' is root for inverse of covariance matrix
and 'Kproduct' is
On Fri, 24 Sep 2010, Prof Brian Ripley wrote:
On Thu, 23 Sep 2010, Peter Ehlers wrote:
On 2010-09-21 5:51, Nikhil Kaza wrote:
example(factor)
iris1$Species- factor(iris1$Species, drop=T)
will get you what you need.
Hmm, doesn't work for me. ?factor does not list a 'drop='
argument.
I
Hello
How can I change the spacing of tick marks on the axis a plot?
What parameters should I use on base plot or on rgl?
cheers
--
View this message in context:
http://r.789695.n4.nabble.com/change-tick-spacing-on-the-axis-of-a-plot-tp2553149p2553149.html
Sent from the R help mailing list
On Fri, Sep 24, 2010 at 7:39 AM, Peter Ehlers ehl...@ucalgary.ca wrote:
On 2010-09-23 17:57, array chip wrote:
Yes, it does what I want. Thank you Peter! Just wondering what else
grid.pars
controls? not just the symbol in legend, right?
John
You can have a look at ?gpar (after loading
On Wed, Sep 22, 2010 at 12:21 AM, Axel axelg...@gmail.com wrote:
Hi,
I'm trying to plot many (x, y) data files using the xyplot function
from the lattice package. Each file can be classified by set name (s1,
s2,...) and data type (A, B, ...). Each data set contains a different
number of
Hi:
Please provide a minimal reproducible example that resembles your real data
so that people can try it out and provide potential solutions for you. Show
what you tried that failed, and what you expect. A number of people on this
list are very adept in data summarization, but most of them are
Hello,
I would like to know if there exists a function in a library or code
development in /R/ to do delete d-jackknife ? In fact, instead of
leaving out one observation at a time as with jackknife, we leave out
/d/ observations.
Thank you very much for your answer !
Lise
Hello Gustavo,
Not sure if I've got all the details of your metric, but what about this...
xx - x[ , combn(5,2)]
i - seq(2, ncol(xx), 2)
colSums(xx[,i-1] xx[,i] xx[,i] 0) / colSums(xx[,i] 0)
Michael
On 24 September 2010 02:53, Gustavo Carvalho gustavo.bi...@gmail.com wrote:
Please
Hi I have following line of code:
any(as.integer(c(1, 3))) == 3
[1] FALSE
Shouldn't I expect it is true?
Thanks,
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hello,
try this way : any(as.integer(c(1, 3))==3)
cheers,
Jonas
Christofer Bogaso a écrit :
Hi I have following line of code:
any(as.integer(c(1, 3))) == 3
[1] FALSE
Shouldn't I expect it is true?
Thanks,
__
R-help@r-project.org
Hi Christofer,
I have just repeated this and changed the code a little and it gives the
correct result
any(as.integer(c(1, 3)) == 3)
[1] TRUE
any(as.integer(c(1, 3)) == 2)
[1] FALSE
any(as.integer(c(1, 3)) == 1)
[1] TRUE
HTH
Chris
On 24 Sep 2010, at 10:07, Christofer Bogaso wrote:
Hello,
After an upgrade, RGui was crashing each time I was trying to connect to
MySQL database.
The error message was again : 'RMySQL was compiled with MySQL 5.0.67 but
loading MySQL 5.1.44'
I found an https://stat.ethz.ch/pipermail/r-sig-db/2009q1/000572.html old
discussion giving this
Shant Ch wrote:
Hi,
I want to find a value of n1. I used the following code but I am getting
the
error -
Error in as.vector(x, mode) :
cannot coerce type 'closure' to vector of type 'any'
n=10
a_g-(1/(n*(n-1)))*((pi/3)*(n+1)+(2*sqrt(3)*(n-2))-4*n+6)
a_s-function(n1)
Dear R,
I have a covariates matrix with 10 observations, e.g.
X - matrix(rnorm(50), 10, 5)
X
[,1][,2][,3][,4] [,5]
[1,] 0.24857135 0.30880745 -1.44118657 1.10229027 1.0526010
[2,] 1.24316806 0.36275370 -0.40096866 -0.24387888 -1.5324384
[3,]
We have got this problem,:
library (RMySQL)
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: imposible cargar la biblioteca compartida
'C:/ARCHIV~1/R/R-211~1.1/library/RMySQL/libs/RMySQL.dll':
On 09/24/2010 05:42 PM, skan wrote:
Hello
How can I change the spacing of tick marks on the axis a plot?
What parameters should I use on base plot or on rgl?
Hi skan,
The usual way this is done is to suppress the axes in the plot:
plot(...,axes=FALSE)
and then add the axes individually:
Hi
r-help-boun...@r-project.org napsal dne 24.09.2010 05:41:30:
If this has already been answered, my apologies in advance I am
relatively
new to this aspect of [R]. it is a bit of a basic question.
I have 4 columns of data (site, Date, measurement type, value) in a tab
delimited text
Hello,
I need to use the confluent function of second kind, also known as
Tricomi function. It is implemented as kummerU() function in
fAsianOptions package, but I've found very inaccurate values, comparing
with those provided by Mathematica. I think Mathematica values are OK
because kummerU
Hello
convex hulls in large numbers of dimensions are hard.
For your problem, though, one can tell whether a given
point is inside or outside by using linear programming:
X - matrix(rnorm(50), 10, 5)
x_i - matrix(rnorm(5), 1, 5)
isin.chull
function(candidate,p,plot=FALSE,give.answers=FALSE,
Hello,
If an N-dimensional convex hull fits your idea of a smallest ball
then you could try the convhulln function in the geometry package.
For testing if a new point is inside a previously derived hull, one
brute force approach is to rbind the new point to your data, generate
a new hull and see
In a partial dependence plot, only the relative scale, not absolute
scale, of the y-axis is meaningful. I.e., you can compare the range of
the curves between partial dependence plots of two different variables,
but not the actual numbers on the axis. The range is compressed
compared to the
Dear List,
I am looking to perform a cross validation on my glm using the cv.binary
function in DAAG.
However i am getting the following error -
cv.binary(modelhe)
Error in sample(nfolds, m, replace = TRUE) : invalid 'size' argument
Any help would be greatly appreciated.
Chris
Hello Eduardo,
Maybe have a look at this thread :
http://r.789695.n4.nabble.com/Update-RMySQL-and-it-s-no-more-running-td1561401.html#a1561401
Update RMySQL and ... it's no more running
The last message gives a link to a procedure to configure RMySQL.
It worked for me.
Have a nice week-end,
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained,
I was looking at different link functions for binomial glms recently for
the same reason as you (more zeros than ones). I did a bit of reading up
on the various link functions and IIRC, you can use the cloglog link on
your data, just turn your 0's into 1's and vice versa. This was stated
in the
Thanks for the elaborate detailing. I see sense now.
Regards
Vijayan Padmanabhan
What is expressed without proof can be denied without proof - Euclide.
Liaw, Andy andy_l...@merck.com
09/24/2010 04:31 PM
To
Vijayan Padmanabhan v.padmanab...@itc.in, r-help
r-help@r-project.org
cc
Hi,
I remember a discussion we had on this list a few months ago for a
better way to decide if a point is inside a convex hull. It eventually
lead to a R function in this post,
http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8784.html
I don't know if it was included in the geometry package in
That would be the logically correct approach. Here are a couple of
ways to specify color:
That's perfect! Thank you very much.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Thanks. I agree with you that the speed and memory issues might be
(actually is) a big problem for big dimensions. It is interesting to
know to solve this by using linear programming. Buy the way, it seems
a potential bug in your function if you try this
X - matrix(rnorm(50), 10, 5)
Hi,
Below Baptiste's message I attach the R code and the .Rd documentation I
treated as 'final', it may be slightly different from that in the Dec 2009
post.
I did submit if for inclusion in the geometry package, but last time I
checked it wasn't there.
I have found (and others have
Dear R users,
when trying
library(tcltk)
i become following error:
Loading Tcl/Tk interface ... Error : .onLoad failed in
loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared library
Feng
thanks for this. The problem you report is
reproducible; it originates from simplex()
of the boot packge.
It is ultimately due to
the fact that x_i is precisely *on* the convex hull,
which is evidently causing problems. I'll
investigate it.
In the short term, you can break the
Is there a way to estimate the standard error for the difference in
predicted probabilities obtained from a logistic regression model?
For example, this code gives the difference for the predicted
probability of when x2==1 vs. when x2==0, holding x1 constant at its
mean:
y=rbinom(100,1,.4)
Hi Chris,
On Fri, Sep 24, 2010 at 7:04 AM, Chris Mcowen chrismco...@gmail.com wrote:
Dear List,
I am looking to perform a cross validation on my glm using the cv.binary
function in DAAG.
However i am getting the following error -
cv.binary(modelhe)
Error in sample(nfolds, m, replace =
Hello,
Does anyone know if relaimpo only applies to pure multiple linear
regression models, i.e.
- linear in the variables AND linear in the coefficients
or is it safe to use it in models that are:
- non-linear in the variables BUT linear in the coefficients?
Hi:
My result using Kaplan-Meier estimate in survival package was inconsistent
with that from Minitab. The survival probabilities are same, but their 95%
CI are different from other calculation. Could you help me find what is
wrong with the code? Thanks in advance.
library(survival)
raw.a -
I am trying to find a convenient way to control line colors when
printing from a for loop using the lines command.
Right now I have solved this by creating a colors vector that is refered
to in the loop with index. However, the colors choosen here are just
1,2,3,4,5...
I would like to get
I think you can use the bootstrap to obtain the std error. My
attempt for your problem and data is below. I would be interested if
anyone can point out a problem with this approach.
Darin
y=rbinom(100,1,.4)
x1=rnorm(100, 3, 2)
x2=rbinom(100, 1, .7)
diff - vector(mode=numeric, length=200)
for (i
Hi all
A couple of questions about string processing from someone who has only
scratched the surface so far.
1) I am wanting to send some strings into a function to allow flexibility
inside. My first idea has been e.g.
auto_io - function( var_string, factors ) {
# e.g. var_string sent as
Michael -
You're doing too much work half the time, and not enough
the other half :-). Try this (untested):
auto_io = function(data_name,factors){
resp_data = read.table(data_name, header = TRUE )
temp_model = lm(formula(paste('y',factors,sep='~')) data = resp_data )
.
you have to load package {lmtest} first. That is,
library(lmtest)
bptest(modelCH, data=KP)
--
View this message in context:
http://r.789695.n4.nabble.com/bptest-tp2553506p2579815.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi all,
Here's what I have. I have a list of log-in times for users and how
long their sessions were.
user, login_time, session_min
alice, 2010/01/01 10:00, 145
bob, 2010/01/01 11:00, 30
What I want to do is create a bar chart showing, in 1/2 hour segments,
the number of users logged in at the
Is as.integer() redundant for this vector of integers?
any(c(1, 3) == 3.0 )
--
View this message in context:
http://r.789695.n4.nabble.com/Problem-with-any-tp2553226p2580659.html
Sent from the R help mailing list archive at Nabble.com.
__
say that I have a script that uses read.csv to read a textfile in a
certain directory, then transforming the data a bit and then spit out a
new file in an output directory.
Is it possible to make this universal so the same procedure is made for
all files in a certain directory and also make it
Travers -
R's date/time abilities are pretty powerful -- you shouldn't have to
resort to outside programs. Here's how I'd approach the problem:
dat = read.csv(textConnection('user, login_time, session_min
+ alice, 2010/01/01 10:00, 145
+ bob, 2010/01/01 11:00, 30
+
Jonas -
Here's an (untested) idea:
readwrite = function(file,outputdirectory){
dat = read.csv(file)
. . .
write.csv(dat,file =
paste(outputdirectory,sub('\\.csv','.new',file),sep='/'))
}
sapply(list.files('.',pattern='\\.csv$'),readwrite,'/some/location')
It will read
Try this:
findInterval(do.call(seq, c(as.list(as.POSIXct(DF$login_time)), by = '30
mins')), as.POSIXct(DF$login_time))
On Fri, Sep 24, 2010 at 4:32 PM, Travers Naran tna...@gmail.com wrote:
Hi all,
Here's what I have. I have a list of log-in times for users and how
long their sessions
You may want to use combinations() in package {gtools} and write a function
with a few lines to perform your leave-k-out procedure.
--
View this message in context:
http://r.789695.n4.nabble.com/delete-d-jackknife-with-R-tp2553192p2585783.html
Sent from the R help mailing list archive at
You did not originally define ball, the other respondents have discussed
using a convex hull, but here is another approach:
Use ball to mean sphere (or technically hypersphere) and find the sphere with
the smallest radius that contains all the points, optim or other optimizers
could be
Hi everybody:
I´m trying to rewrite some routines originally written for SAS´s PROC
NLMIXED into LME4's glmer.
These examples came from a paper by Nelson et al. (Use of the
Probability Integral Transformation to Fit Nonlinear Mixed-Models
with Nonnormal Random Effects - 2006). Firstly the authors
What's the best object browser?
Dear all,
I have tried all the popular R IDE or editors like Eclipse, Komodo, JGR,
Revolution...
They all have fancy fucntions like auto completion, syntax highlight
BUT, I JUST WANT A OBJECT BROWSER!
The easiest way to view objects in R console is fix(),
On Fri, Sep 24, 2010 at 4:16 PM, Struve, Juliane j.str...@imperial.ac.ukwrote:
Hi again,
when applying the code to my real data I need to deal with a large number
of individuals and massive data sets. I am using the code below to read in
the data for different individuals, and would like to
Dear community,
I have one file named ca_boost_feature.txt,
Feature selection (Boosting:0.0025,5)!
H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G
log file: ep
If I want to use the second line of this file, how to read it into R?
varr-read.table(/home/cdu/operon/carbonic/ca_boost_feature.txt, sep=
Thank you all very much for your help.
Unfortunately I do not have the data to test out the ideas suggested but I
was able to find a good approximation using another software package. I will
try to get the data for this problem so I can find out how to do it in R as
I am very much interested in
Changbin -
If you want the entire line, use
readLines('~/ca_boost_feature.txt',warn=FALSE)[2]
[1] H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G
If you want a vector with the contents of the line, use
scan('~/ca_boost_feature.txt',skip=1,n=7,what='')
Read 7 items
[1] H.2.C C.1.D C.3.R
Thanks so much, Phil!
On Fri, Sep 24, 2010 at 2:45 PM, Phil Spector spec...@stat.berkeley.eduwrote:
Changbin -
If you want the entire line, use
readLines('~/ca_boost_feature.txt',warn=FALSE)[2]
[1] H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G
If you want a vector with the contents of
On Fri, 24-Sep-2010 at 06:11PM +0200, Jonas Josefsson wrote:
I am trying to find a convenient way to control line colors when
printing from a for loop using the lines command.
Right now I have solved this by creating a colors vector that is refered
to in the loop with index. However, the
Hi,
I have a list/data.frame 'pk' of POSIXct dates, and I'd like to extract the
hour for each row. I know that if I have an individual POSIXct object, I
can extract the hour by converting to a new object with:
new.lt - as.POSIXlt(single POSIXct object)
new.lt$hour
But I can't figure out how to
Hi all,
I am trying to pickup lattice graphics in R and having difficulty with
simple layout of plots.
I have created a series of levelplots and would like to plot them to a
single device, but need to reduce the margin areas. This is easily
accomplished with par(oma) and par(mar) in the base
Matthew -
It's a bit simpler than you think:
as.POSIXlt(pk)$hour
should return what you want. (If not, please provide a
reproducible example.)
- Phil Spector
Statistical Computing Facility
Thank you! That solution worked! I thought I'd tried something similar to
that, but obviously I didn't. Here's a self-contained example, for
posterity and completeness:
z.df - data.frame(times=c(Sys.time(), Sys.time() + 3600))
as.POSIXlt(z.df[,1])$hour
And this gives me what I want.
Thank
Hi and thanks for your replies (I'm sorry to be a bit late..),
I think I might be being a bit thick on this, but I truly would not be
asking if I had not already gone through the manuals and examples in the
web. I just want to be sure I got Jorge's example.
the function
Hi again,
when applying the code to my real data I need to deal with a large number of
individuals and massive data sets. I am using the code below to read in the
data for different individuals, and would like to create the Lines within the
loop. But Lines needs to have the variable Fish_ID
Hi
I'm very new to R but have plenty of experience with statistics and other
packages like SPSS, SAS etc.
I have a dataset of around 20 columns and 200 rows. I'm trying to fit a
very simple linear model between two variables. Having done so, I want to
test the model for heteroscedasticity
Dear All,
I'v tried to read in data in numerous ways including:-
Spain10km-data.frame(readAsciiGrid(F://RMap//sp10kpointid1.aux))
Error in readAsciiGrid(F://RMap//sp10kpointid1.aux) :
object 'cellsize' not found
In addition: Warning message:
In readLines(t, n = 6) :
incomplete final line
Dear list,
I would like to do something like:
# Simulate some example data
tmp - matrix(rnorm(50), ncol=5)
colnames(tmp) - c(y,x1,x2, x3, x4, x5)
# Fit a linear model with random noise added to x5 n times
n - 100
replicate(n, lm(y ~ x1+x2+x3+x4+I(x5+rnorm(nrow(tmp))),
data=as.data.frame(tmp)))
Hi,
A. In a nutshell:
The training error, obtained as error (ret), from the return value
of a ksvm () call for a eps-svr model is (likely) being computed
wrongly. nu-svr and eps-bsvr suffer from this as well.
I am attaching three files: (1) ksvm.R from the the kernlab package,
un-edited, (2)
I am trying to reproduce the nice looking of Mandelbrot demonstrated by R
wiki page by the following code:
library(caTools)# external package providing write.gif function
jet.colors = colorRampPalette(c(#7F, blue, #007FFF, cyan,
#7FFF7F,
yellow,
Hi, I need help!
I am trying to iterate an iterative process to do cross vadation and store
the results each time.
I have a Spatial data.frame, called Tmese
str(Tmese)
Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
..@ data :'data.frame': 14 obs. of 17 variables:
..
Hi, I am new to R. Anyone can explain the following from R-help or
anyone can direct me how to calculate odds ratio from logistic model in
R. Thank you very much. Guoya
Stefano stecalza at tiscalinet.it
https://stat.ethz.ch/mailman/listinfo/r-help writes:
Hi all.
A simple question.
Is
Hi,
I'm trying to make such a graphic :
http://heart.bmj.com/content/96/9/662/F1.large.jpg
The curve plot is not a problem but I don't know how to represent the little
table underneath with the number of survivors at given periods.
Do you have any hints to achieve this ?
Thanks in advance
Dear R users;
Could you tell me how to let R create multiple graphs in a graph
window. Please note that I am talking about creating multiple plots in
the same page of the graph window. For example:
g1=c(1,2,3)
g2=c(3,1,7)
g3=c(4,2,11)
g4=c(5,5,9)
...
all in one graph window.
Best Regards
Dear all:
I have encountered a problem recently:
I used to plot figure, and using code
main=.., xlab=.,ylab=.
to change the legend. But recently I was using R to perform Discriminant
Function analysis, and I want to change the group names also add a title to the
figure, but I am
Hi, at first, i´m from germany, so sorry for my bad english. but i need ur
help in R to programm a power function and to make at last a graphik of it.
i have already tried my best. but it doesn´t work.the topic is: the
homogeneity test of correlation based entropy.
so it means, that i have to
The output of logisitic procdure only gives you the log(odds-ratio) and the
associated standard error of the log(odds-ratio). You need to exponentiate
the log(odds-ratio) to get your odds ratio. The code tells you how to obtain
the odds ratio from log(odds-ratio).
--
View this message in
Hi,
What part of your code does not work or does not do what you want? I
am guessing that you want gute to return more than a single value
(which is what it does in your code). Can you show us an example of
the results you would like?
Best regards,
Josh
I reworked some of your code to
Hi Rob,
I googled cran bptest
and the first hit was for package lmtest.
I installed lmtest, loaded it up, and bptest is available there.
require(lmtest)
Loading required package: lmtest
Loading required package: zoo
bptest
function (formula, varformula = NULL, studentize = TRUE, data =
Which one do you want?
library(lattice)
d - data.frame(x = rep(1:3, 4), g = factor(rep(1:4, each = 3)),
y = c(1, 2, 3, 3, 1, 7, 4, 2, 11, 5, 5, 9))
xyplot(y ~ x | g, data = d, pch = 16)
xyplot(y ~ x, data = d, groups = g, type = c('p', 'l'), pch = 16)
Both provide 'multiple
Hi:
It's a little hard to help on that front without a reproducible example but
you could read the help page of plot.lda in the MASS package, where you
would find that it takes both xlab and ylab arguments, and for which you can
probably pass main as well since it contains a ... argument. Did you
Hi Guoya,
Is this what you are after?
# fit logistic model
my.glm - glm(vs ~ mpg, data = mtcars, family = binomial(link = logit))
# look at a summary
summary(my.glm)
# view the coefficients as odds ratios
exp(coef(my.glm))
Hope that helps,
Josh
On Fri, Sep 24, 2010 at 10:50 AM, Li, Guoya
Hi Guoya,
One more option, using Joshua's example, would be:
# install.packages('epicalc')
require(epicalc)
logistic.display(my.glm)
HTH,
Jorge
On Fri, Sep 24, 2010 at 1:50 PM, Li, Guoya wrote:
Hi, I am new to R. Anyone can explain the following from R-help or
anyone can direct me how to
85 matches
Mail list logo