Aggreed. R's own way of handling logrithm of a negative number makes
scripting more automatic, which is actually desireable.
To flag any problems that might occur in calculation, do it ahead of using
logrithm or in other similar situations. Try test functions like is.nan(),
is.finite(), or relation
Hi
r-help-boun...@r-project.org napsal dne 23.12.2010 05:13:37:
> Dear friends, hope I could be able to explain my problem through
following
> example. Please consider this:
>
>
>
> > set.seed(1)
>
> > input <- rnorm(10)
>
> > input
>
> [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.32
thank you so much, and i have a question too
if i read some statistic for example cook-weisberg statistic or welsh-kuh
distance and i say
stat<-welsh.kuh than i put this statistic in your idea, can i get the
statistics each times?
--
View this message in context:
http://r.789695.n4.nabble.com/r
Why does x in "assign(x)" correctly evaluate to "rank" where
UseMethod(func) does not get correctly evaluated?
Can we use as.call(list(UseMethod,func))?
>> assign(paste(func,".default",sep=""),get(func),pos=env)
>>
>> assign(func,function(x,...) UseMethod(func),pos=env)
On Wed, Dec 22, 2010 at
sorry not read i want to say "write"
--
View this message in context:
http://r.789695.n4.nabble.com/regression-tp3161328p3161551.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
On Wed, Dec 22, 2010 at 4:26 PM, Paul Miller wrote:
> Hello Everyone,
>
> Below is my first attempt at R programming. The code replicates example 5.1
> from Common Statistical Methods for Clinical Research with SAS Examples. I
> was hoping that people more experienced than myself would be willin
This time with a more-R oriented question:
Is the mrpp {vegan} package [1] useful in trying to check, or get a clue about
the differences between- and within-axes (or variables or dimensions or
columns) of a multivariate matrix?
The description explains:
" ...(MRPP) provides a test of whether
On Dec 22, 2010, at 6:14 PM, tilapia wrote:
Hello R-Users
i'm stuck with the following problem:
i want to add a trend line to a scatterplot. the x axis is a time
line.
well it doesnt work, it seems that the function abline is not able
to handle the fact, that i used the column Date as a fa
Dear friends, hope I could be able to explain my problem through following
example. Please consider this:
> set.seed(1)
> input <- rnorm(10)
> input
[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
0.4874291 0.7383247 0.5757814 -0.3053884
> tag <- vector(length=10)
On 12/22/2010 05:49 PM, Paul Rigor wrote:
> Hi,
>
> I was wondering if anyone has played around this this package called
> "rdict"? It attempts to implement a hash table in R using skip lists. Just
> came across it while trying to look for simpler text manipulation methods:
>
> http://userprimary
Paul -
You can also use named vectors as something similar to
a python dictionary:
nvec = c('one'=20,'two'=30,'three'=40)
nvec['four'] = 50
nvec['one']
one
20
nvec['four']
four
50
Although the result is named, it can be used as a regular R
value:
20 + nvec['three']
three
60
If t
Thank you so much i did with your idea..
thank you :)
--
View this message in context:
http://r.789695.n4.nabble.com/regression-tp3161328p3161524.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https:
Try the following, which I haven't tested much
and needs more error checking (e.g., to see that
the function is not already generic and that
its argument list is compatible with (x,...)).
I put in the print statements to show what
the calls to substitute() do.
toGeneric <- function (funcName) {
Hi,
I was wondering if anyone has played around this this package called
"rdict"? It attempts to implement a hash table in R using skip lists. Just
came across it while trying to look for simpler text manipulation methods:
http://userprimary.net/posts/2010/05/29/rdict-skip-list-hash-table-for-R/
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Moon
> Sent: Wednesday, December 22, 2010 5:05 PM
> To: R-help@r-project.org
> Subject: [R] with(data.frame,ifelse(___,___,___))
>
> Hello, All,
>
> Mac OS 10.6.5
> R64 2.1
> In ggplot2, by default the x-axis is in the bottom of the graph and
> y-axis is in the left of the graph. I wonder if it is possible to:
>
> 1. put the x axis in the top, or put the y axis in the right?
> 2. display x axis in both the top and bottom?
These are on the to do list.
> 3. display x
Hi Ufuk,
Using Michael's data, here is one more way of doing it:
allmodels <- lapply(1:nrow(x), function(row) with(x, lm(y ~ ., data =
x[-row,])))
allmodels
To access the information contained in the model when the first row is
removed, you can do
summary(allmodels[[1]])
And, if you want to ha
> It isn't quite convenient to read the data posted below into R
> (if it was originally tab-separated, that formatting got lost) but
> ddply from the plyr package is good for this: something like (untested)
>
> d <- with(data,ddply(data,interaction(UniqueID,Reason),
> function
Hi all,
Hope someone could help me.
I am trying to run automatically the conversion of an Rwn file to a tex
file.
I am using windows 7, and cygwin.
I tried to run automatically the Sweave.sh script, in its the most
recent version available at R webpage:
http://cran.r-project.org/contrib/e
Hello, All,
Mac OS 10.6.5
R64 2.11.1
This works as expected:
f1 = c(0.084, 0.099, 0)
data= data.frame(f1)
data$f1=with(data,ifelse(f1==0, 0.0001, f1))
data
f1
1 0.0840
2 0.0990
3 0.0001
Substituting 'f1==0' with 'T' produces the expected result:
f1 = c(0.084, 0.099, 0)
data= data.frame(f
Hello Ufuk,
Here is one way to do it...
# make up some data for this example
x <- matrix(runif(7 * 20), ncol=7)
# a data.frame is most convenient for lm
x <- as.data.frame(x)
colnames(x) <- c("x1", "x2", "x3", "x4", "x5", "x6", "y")
# a list to hold lm results
x.lm <- list()
# run regressions
Try
sapply(strsplit(sampleIDs, "_"), "[", 1)
HTH,
Jorge
On Wed, Dec 22, 2010 at 4:02 PM, maddox <> wrote:
>
> Dear Guru's
>
> My first steps with R have ground to a halt! I have a vector of sample
> identifiers
>
> > sampleIDs
> [1] "D1_1" "D1_2" "D1_3" "D1_4" "D1_5" "D1_6" "D1_7"
see function levels()
?levels
Peter
On Wed, Dec 22, 2010 at 3:00 PM, maddox wrote:
>
> Hi,
>
> I have a factor with 3 levels. I'd like to recover the names of each level
> so I can use them to search through another data structure. Is this
> possible?
>
> Thanks
>
_
Hello,
I am using fdrtool(x, statistic="pvalue") where x is a vector of chisq
p-values.
I can get this command to work with some x, but not with others.
When it does NOT work, I get the following screen output:
> fdrtool(pvals$Chi2.pval, statistic="pvalue")
Step 1... determine cutoff point
Step 2.
There are several ways to get a matrix, for example
mat = as.matrix(as.data.frame(splitIDs))
or
mat = sapply(splitIDs, I)
True experts may suggests even more ways.
Peter
On Wed, Dec 22, 2010 at 1:02 PM, maddox wrote:
>
> Dear Guru's
>
> My first steps with R have ground to a halt! I have a v
Hello R-Users
i'm stuck with the following problem:
i want to add a trend line to a scatterplot. the x axis is a time line.
well it doesnt work, it seems that the function abline is not able
to handle the fact, that i used the column Date as a factor.
this is the script:
data<-read.table('DO_ha
Hi,
I have a factor with 3 levels. I'd like to recover the names of each level
so I can use them to search through another data structure. Is this
possible?
Thanks
M
--
View this message in context:
http://r.789695.n4.nabble.com/recovering-names-of-factor-levels-tp3161388p3161388.html
Sent fr
--
View this message in context:
http://r.789695.n4.nabble.com/vectorised-recovery-of-strsplit-value-tp3161254p3161389.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/lis
I'm trying to make a function to turn a regular function into an S3 generic
one. I want myMethod to be:
function(x,...) UseMethod("myMethod")
But I keep getting:
function(x,...) UseMethod(func)
Here's the function:
toGeneric<-function(func) {
env<-environment(get(func))
Hi dear all,
suppose that s is a statistic code;
i have a matrix (x) which has 7 columns (1=x1,2=x23=x3,4=x4,5=x5,6=x6
and7=y)
and has 20 rows. i want to do linear reggression like
reg<-lm(x[,7]~1+x[,1]+x[,2]+...+x[,6])
but i want to do delete i th row for nrows times and create regression
Hello Everyone,
Below is my first attempt at R programming. The code replicates example 5.1
from Common Statistical Methods for Clinical Research with SAS Examples. I was
hoping that people more experienced than myself would be willing to take a look
and let me know what I did well and what co
Dear Guru's
My first steps with R have ground to a halt! I have a vector of sample
identifiers
> sampleIDs
[1] "D1_1" "D1_2" "D1_3" "D1_4" "D1_5" "D1_6" "D1_7" "D1_8"
[9] "D1_9" "D1_10" "D1_11" "D1_12" "F1_13" "F1_14" "F1_15" "F1_16"
[17] "F1_17" "F1_18" "F1_19" "F1
After fitting a parametric model using the command survreg(), how can I find
the martingale residuals, the score residuals, the scaled-score, the Cox-Snell
etc?
I tried residuals(), but since I have previously used the command survreg() to
fit the model, it gives out other residuals that I do no
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Ted Harding
> Sent: Wednesday, December 22, 2010 2:39 PM
> To: r-help@r-project.org
> Subject: Re: [R] A question to get all possible combinations
>
> On 22-Dec-10 18:19:38, Ron M
On 22-Dec-10 18:19:38, Ron Michael wrote:
> Let say, I have a matrix with 8 rows and 6 columns:_
> df1 <- matrix(NA, 8, 4)
> df1
> [,1] [,2] [,3] [,4]
> [1,] NA NA NA NA
> [2,] NA NA NA NA
> [3,] NA NA NA NA
> [4,] NA NA NA NA
> [5,] NA NA NA NA
> [6,]
Dear Ron,
On Wed, Dec 22, 2010 at 1:19 PM, Ron Michael wrote:
> Let say, I have a matrix with 8 rows and 6 columns:
>
>> df1 <- matrix(NA, 8, 4)
>> df1
> [,1] [,2] [,3] [,4]
> [1,] NA NA NA NA
> [2,] NA NA NA NA
> [3,] NA NA NA NA
> [4,] NA NA NA NA
> [5,]
On Wednesday 22 of December 2010 05:57:17 Nikos Alexandris wrote:
[...]
> Apologies for repeating the same question (trying to understand the problem
> myself).
I started to get a grip on this. But anyway, my questions are actually not
directly about R questions - sorry for the traffic.
___
Try this. Made up some data with year values:
myDates <- seq(2009, 2011, .01) # create some dates
myData <- runif(length(myDates))
plot(myDates, myData)
# now convert to a Date by determining what the date of the first value is
first <- as.Date(paste(floor(min(myDates)), '-1-1', sep = ''))
# add
Dear Gabor, many thanks for the quick reply.
for the sake of a working example in list archive, code below reads a
csv with 5 min intraday bars and converts it to a
quantmod::barChart_able xts object
##csv file 5min bars with the format below
#,,
#ICE.BRN,ice.brn_m5,5,20100802,10:40:00,
Take a look at package 'mitools' and
http://faculty.washington.edu/tlumley/survey/svymi.html
for some examples in analyzing multiply-imputed survey data.
> Hi
> I have used the amelia command from the Amelia R package. this gives me
> a number
> of imputed datasets.
>
> This may be a silly ques
= Summary =
Version 0.9.0 of the Rcpp package is now on CRAN and its mirrors. This
release marks another step in the development of the package, and a few key
points are highlighted below. More details are in the NEWS and ChangeLog
files included in the package.
= Overview =
You could use the my.symbols function from the TeachingDemos package to create
your own versions of the symbols that you want. Using the ms.polgon function
with it will draw polygons (which can simulate most of the symbols you want)
and should show up vectorized in metafile formats.
--
Gregor
which 6 cells do you want? do you want one from each column? You
could use expand.grid:
> x <- expand.grid(1:8, 1:8, 1:8, 1:8, 1:8, 1:8)
> str(x)
'data.frame': 262144 obs. of 6 variables:
$ Var1: int 1 2 3 4 5 6 7 8 1 2 ...
$ Var2: int 1 1 1 1 1 1 1 1 2 2 ...
$ Var3: int 1 1 1 1 1 1 1 1
Amit Patel-7 wrote:
>
> Hi
> I have used the amelia command from the Amelia R package. this gives me a
> number
> of imputed datasets.
>
> This may be a silly question, but i am not a statistician, but I am not
> sure how
> to combine these results to obtain the imputed dataset to usse for f
Let say, I have a matrix with 8 rows and 6 columns:
> df1 <- matrix(NA, 8, 4)
> df1
[,1] [,2] [,3] [,4]
[1,] NA NA NA NA
[2,] NA NA NA NA
[3,] NA NA NA NA
[4,] NA NA NA NA
[5,] NA NA NA NA
[6,] NA NA NA NA
[7,] NA NA NA NA
[
Hello,
I have some xy data which clearly shows a non-monotonic, peaked
triangular trend. You can get an idea of what it looks like with:
x<-1:20
y<-c(2*x[1:10]+1,-2*x[11:20]+42)
I've tried fitting a quadratic, but it just doesn't the data-structure
with the break point adequately. Is there anyway
Thanks for the clarification!
I actually got the function working by passing just the individual
objects as separate arguments. But creating a wrapper list object
should suffice and I'll just have the function return the modified
list object to achieve what I want.
Cheers,
Paul
On Wed, Dec 22, 2
Hello,
I'm plotting two sets of data referenced to either the left or right y-axes.
The first, water table depth (blue circles), is plotted on the left y-axis
in reverse order (0 at the top) as this is more intuitive when thinking in
terms of depth. The second is electrical conductance (a surro
Dear bp,
Is it sensible to do Durbin-Watson and Breusch-Pagan tests for
proportional-odds or ordered-logit models?
Best,
John
John Fox
Senator William McMaster
Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canad
Hi:
In ggplot2, by default the x-axis is in the bottom of the graph and
y-axis is in the left of the graph. I wonder if it is possible to:
1. put the x axis in the top, or put the y axis in the right?
2. display x axis in both the top and bottom?
3. display x axis in both sides, and each of them
You could start having a look at cran packages like sna or statnet,
or search cran for "network" and you nfind a lot of packages!
On Wed, Dec 22, 2010 at 12:00 AM, EU JIN LOK wrote:
>
> Dear R users
>
> I'm a novice user of R and have absolutely no prior knowledge of social
> network analysis
I don't Think that viewing lack of convergence by some R routine
as a uuseful tool for diagnosing model or data inadequacy is a very
useful approach. It is far better to fit the model. Then standard
techniques can be employed to investigate these matters. For the
model considered here there are
Thank you all once again .. Yeah, its working now.
--
Regards,
Mahalakshmi
Graduate Student
#20, Department of Geography
Michigan State University
East Lansing, MI 48824 Quoting Liviu Andronic :
> On Wed, Dec 22, 2010 at 6:39 PM, wrote:
>> Thank you both for your suggestions. I have anothe
Hi
I have a dataset from biological data with forty samples whichh relate to four
different treatments. Each sample has thousands of values but as usuual
contains
missing values
I want to use EM to imput these missing values. I am doing tthis using
amelia. Do I need to specify the various gr
Hi
I have a dataset from biological data with forty samples whichh relate to four
different treatments. Each sample has thousands of values but as usuual
contains
missing values
I want to use knn to imput these missing values. I am doing tthis using
knn.impute. Do I need to specify the various
Using ordered probit model, I get errors from dwt and bptest.
dwt:
Error in durbinWatsonTest.default(...) : requires vector of residuals
bptest:
Error in storage.mode(y) <- "double" :
invalid to change the storage mode of a factor
I imagine I have to restate as an individual probit model for
Have you consulted R's extensive documentation? -- in particular, "An
Introduction to R," which would seem like an obvious place for R
newbies to start. If you had done so, you would have found your
question answered there in section 6.1 on lists.
-- Bert Gunter
On Wed, Dec 22, 2010 at 9:39 AM,
On Wed, Dec 22, 2010 at 6:39 PM, wrote:
> Thank you both for your suggestions. I have another question - is there a
> specific way to access the individual elements of a 'list' variable? i.e.
>
> dmi = matrix(rnorm(20),4,5)
> soi = matrix(rnorm(20),4,5)
> pe = matrix(rnorm(20),4,5)
> y <- list(dm
Thank you both for your suggestions. I have another question - is there a
specific way to access the individual elements of a 'list' variable? i.e.Â
dmi = matrix(rnorm(20),4,5)
soi = matrix(rnorm(20),4,5)
pe = matrix(rnorm(20),4,5)
y <- list(dmi, soi, pe)
y[[1]]Â Â gives
[,1]Â Â Â Â Â Â [,2
Hi
I have used the amelia command from the Amelia R package. this gives me a
number
of imputed datasets.
This may be a silly question, but i am not a statistician, but I am not sure
how
to combine these results to obtain the imputed dataset to usse for further
statistical analysis. I have lo
Hi Henrik,
Thanks for R.matlab and your reply. I cannot find any octave option to save
an uncompressed MATLAB-format file. I have just downloaded Rcompression from
what I believe is the official website so it should be current. I also think
I have the current R version (at least, what is current fo
Hi:
Is this what you're after?
dotplot(reorder(category, -values, mean) ~values, data=testdot)
See ?reorder
HTH,
Dennis
On Wed, Dec 22, 2010 at 2:59 AM, e-letter wrote:
> On 20/12/2010, e-letter wrote:
> > On 18/12/2010, e-letter wrote:
> >> On 18/12/2010, Peter Ehlers wrote:
> >>> On 201
Thanks,
Works perfectly, don't know why I couldn't find that command!
James
On Tue, Dec 21, 2010 at 3:56 PM, William Dunlap wrote:
> Use the colClasses= argument to read.csv().
> E.g.,
>
> > txt <- c("City ZipCode Age", "Newport 02840 0", "Seattle 98105 23")
> > cat(txt, sep="\n")
> City ZipCo
On Dec 22, 2010, at 2:15 AM, zaras...@hotmail.com wrote:
I also hope to get the code of using lasso method in the cox
model.Could you please send me one?
Thank you so much!!!
http://www.lmgtfy.com/?q=r-project+cox+model+lasso
--
David Winsemius, MD
West Hartford, CT
This is simply misinformation. The Rtools distribution does include
g++ suitably configured for static linking of libstdc++, and that
works for the hundreds of CRAN/BioC packages using C++.
And please report bugs in packages to their maintainers, not here.
You do not need to include the paths
Ahh... thanks, I totally missed that.
Cheers,
Marius
__
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-con
Change as follows:
> integrand <- function(x, vec, mat, val) rep(1, length(x)) # dummy return value
> A <- matrix(runif(16), ncol = 4)
> u <- c(0.4, 0.1, 0.2, 0.3)
> integrand(0.3, u, A, 4)
[1] 1
> integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4)
1 with absolute error < 0.
On Wed, 22 Dec 2010, Marius Hofert wrote:
Dear expeRts,
I somehow don't see why the following does not work:
integrand <- function(x, vec, mat, val) 1 # dummy return value
A <- matrix(runif(16), ncol = 4)
u <- c(0.4, 0.1, 0.2, 0.3)
integrand(0.3, u, A, 4)
integrate(integrand, lower = 0, upper
Dear expeRts,
I somehow don't see why the following does not work:
integrand <- function(x, vec, mat, val) 1 # dummy return value
A <- matrix(runif(16), ncol = 4)
u <- c(0.4, 0.1, 0.2, 0.3)
integrand(0.3, u, A, 4)
integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4)
I would like
On Tue, Dec 21, 2010 at 11:36 PM, szimine wrote:
>
> Hi Gabor et al.
>
> the
> f3 <- function(...) as.POSIXct(paste(...), format = "%Y%m%d %H:%M:%S" )
>
> helped me to read intraday data from file
> ##
> ,,
> ICE.BRN,ice.brn_m5,5,20100802,10:40:00,79.21000,79.26000,79.16000,79.2,2
On 22/12/2010 6:20 AM, Paul Rigor wrote:
Hello,
This is an R-syntax question when attempting to manipulate/access objects
when passed to a function.
I have a function attempting to just print values attached to an argument
object. For example,
printThis<- function(obj, parm2, parm3) {
print
On Wed, Dec 22, 2010 at 11:20 AM, Paul Rigor wrote:
> Hello,
> This is an R-syntax question when attempting to manipulate/access objects
> when passed to a function.
>
> I have a function attempting to just print values attached to an argument
> object. For example,
>
> printThis <- function(obj,
Hello,
This is an R-syntax question when attempting to manipulate/access objects
when passed to a function.
I have a function attempting to just print values attached to an argument
object. For example,
printThis <- function(obj, parm2, parm3) {
print(obj.stuff1)
print(obj.stuff2)
}
where
Hello,
when I try to use the filled circle (pch = 16) in a Windows metafile, it
appears highly pixelated rather than as a smooth vector.
The other filled circles (pch = 19 and 20) are vector circles, filled with
pixels.
Results are the same whether I use windows() and save or copy as a metafile,
On 20/12/2010, e-letter wrote:
> On 18/12/2010, e-letter wrote:
>> On 18/12/2010, Peter Ehlers wrote:
>>> On 2010-12-18 07:50, e-letter wrote:
> Ben Bolker
> Sat, 18 Dec 2010 07:07:24 -0800
>>>
>>> [... snip ...]
>>>
I am trying to create a chart like this
(http://www.b-eye-net
On Wed, Dec 22, 2010 at 2:57 AM, Phil Spector wrote:
> To make your loop work, you need to learn about the get function.
> I'm not going to give you the details because there are better
> approaches available.
> First, let's make some data that will give values which can be verified.
> (All the c
On Tue, Dec 21, 2010 at 11:39:31AM -0800, casperyc wrote:
>
> Hi all,
>
> I am writing a simple function to implement regularfalsi (secant) method.
>
> ###
> regulafalsi=function(f,x0,x1){
> x=c()
> x[1]=x1
> i=1
> while ( f
I also hope to get the code of using lasso method in the cox model.Could you
please send me one?
Thank you so much!!!
__
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
mathijsdevaan wrote:
>
> I have a postgresql and a mysql database and I would like to combine the
> info from two different tables in R. Both databases contain a table with
> three columns: project_name, release_id and release_date. So each project
> output could be released multiple times (I am
Hello,
I have problems implementing the function slectSETAR() to my database. I
have 80 series of 80 countries from 1970 to 2008. I do as follows:
for(i in 1:ncol(UNE)) {
print(i)
search <- selectSETAR(UNE[,i], m=2, thDelay=1)
print(mod.setar)
}
Next,
for(i in 1:ncol(UNE)) {
print(i)
set <-
80 matches
Mail list logo