I can only speak for the Windows part, but isn't it possible to test on
Windows 7 64bit?
(you can download a test version, and use a dual boot setup to try)
I always heard about the difficulties with WinXP 64bit, so maybe that is
just the problem?
Another thing to find out: maybe you can take adva
try:
capture.output(fit5, file=paste("testperm", i, ".txt", sep=""), append=T)
Bart
A Singh wrote:
>
> Dear List,
>
> I thought it would be much easier to put a second query into a second
> mail.
>
> I need to print 426*1 blocks of variance components data, where 426 is
> the number o
Hi,
also interested...
If you are checking for non-normal behaviour, first let us define normal
behaviour: only small temperature changes and no steep ramps?
If so, maybe you can make an rolling average of the last x points, and check
if the following point deviates more than ... ?
Or is it mo
Hi,
Is it possible to share the code on this list?
I'm also interested (and maybe others to)
Or are you planning to make a package?
Best regards
Bart
Ted.Harding-2 wrote:
>
> On 12-Oct-09 13:33:17, Ted Harding wrote:
>> On 12-Oct-09 13:24:01, Terry Therneau wrote:
>>> -- begin inclu
Hi,
This should be possible, even with automatic EP detection.
Can you give use some example titration data, or the used matlab code?
If you want some introduction papers to R, take a look at the documents at
CRAN (CRAN > other)
Bart
awayguy wrote:
>
> Halo
>
> i'm studying chemistry, toda
Maybe I'm missing something, but how about using the shell function?
Bart
Duncan Murdoch-2 wrote:
>
> On 9/10/2009 9:25 AM, H Rao wrote:
>> Hi,
>> I am looking to execute an R script from VB as below.
>> The script runs fine but the redirection doesnt seem to happen. The
>> redirection opera
Take a look at ?eval
Bart
Héctor Villalobos-2 wrote:
>
> Hello,
>
> In doing a series of non-linear estimations of a function which is a sum
> of a varying number
> of sinusoids, I would like to "autogenerate" the arguments needed by nls()
> depending on that
> number.
>
> For example, whe
Hi,
About a year ago I found some references to a package which takes a
dataframe and derived rules from it.
If I remember correctly, there were examples shown from the Iris data.
You could choose between a graphical representation with balloons with
choises, or a text version: if x > y then z.
How about:
x <- F
if (x) {
print("true")
} else {
print("false")
}
Bart
mli-2 wrote:
>
> Dear R users,
>
> Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file
> 'main.R' which sources each of them. I wonder if there is a way to skip
> rest of code in 'test1.R' once a
You can use R CMD BATCH if I'm correctly.
How about define a query through your routine, process the results of this
query through R, write this output in a new table, or a textfile, and load
this with your subroutine.
Bart
Felipe Carrillo wrote:
>
>
> Steve: I am already using it importing
Hi,
how about this:
x <- runif(100)
n <- length( x )
y2 <- rep(0,n)
y2[x > 0.75] <- 1
y2[x < 0.25] <- -1
cx <- cumsum(abs(y2) )
m <- match(cx, cx)
y2[y2==0] <- 2
y2[x<0.5 & y2[m]==1] <- 0
y2[x>0.5 & y2[m]==-1] <- 0
y3 <- y2
y3[y3==0] <- 1
y3[y3==2] <- 0
cx <- cumsum(abs(y3))
m <- match(cx, cx)
Hi,
you could also take a look at:
http://www.nabble.com/finding-best-fitting-model-td22852224.html
Bart
ryancw wrote:
>
> Is there a way to automate fitting and assessing loglinear models for
> several nominal variables . . . something akin to step or drop1 or add1
> for linear or logistic
Hi,
There seems to be something wrong with your function getinfo.
Try first to substitute your dbGetQuery by a print statement, so that you
can see what is going on:
getinfo=function(t){print(the SQL query)}
allinfo=sapply(c(1985:2007),getinfo)
If these results look good, you can change your fu
Altough it depends on what crit you keep your variables, but maybe you should
take a look at ?step.
Bart
Paul Hermes wrote:
>
> ok,
> i think i have to be more precise of what we are doing.
> first thing: this code is not from me, and Im new to R (and never touched
> anything like this)
> I
?is.na
Manli Yan wrote:
>
>I have a 50*50 matrix,some entry are NAs,I want to replace these NA by
> 0,so can I use some syntax to do so other than using ifelse?
>I tried to use replace(a,NA,0),it didnt work~~(a is matrix name)
>
> Thanks~
>
> [[alternative HTML version delete
Hi,
I have the following dataframe:
IDDates
1 16-07-01 06-10-95
224/01/02 06-10-95
3 16/01/02 16/08/94 12/01/91
And I would like to extract the dates, but couple the ID's to the right
dates, eg:
ID Dates
116-07-01
1
Hi,
I'm trying to match peaks between chromatographic runs.
I'm able to match peaks when they are chromatographed with the same method,
but not when there are different methods are used and spectra comes in to
play.
While searching I found the ALS package which should be usefull for my
applicati
If you don't want to use the # before each comment line, you could try
something like defining a function which returns nothing and then type some
text after calling the function:
comm <- function(x) {invisible()}
comm("This is just a test,
trying to comment without typing the hashes"
)
But I d
> I added "patientinformation1" variable and then I gave the command for
> "tapply" but its giving me the following error:
>
> Error in tapply(pat1, format(dos, "%Y%m"), function(x) sum(x == 0)) :
> arguments must have same length
seems like you added patientinformation1, but still use pat1 i
Hello,
did you try to replace the print commands with HTML?
But first you have to specify a file through HTMLStart and at the end of the
function HTMLStop.
Including plots is no problem, but you have to save them and then with the
HTMLInsertGraph function insert them into your report.
Kind regar
Hello,
how about changing the last loop to an apply?
time.test2 <- function(dat) {
cen <- dat
grps <- 5
n.rich <- numeric(grps^2)
n.ind <- 1
for(i in 1:grps)
for (j in 1:grps) {
n.cen <- numeric(ncol(cen) - 2)
neighbours <- expand.grid(X=(j-1):(j+1), Y=(i-1):(i
I'm not sure what you want, but take a look at ?merge and %in%
ppaarrkk wrote:
>
> I want to compare two matrices or data frames and select or get an index
> for those rows which are the same in both. I have tried the following :
>
>
>
>
>
>
> a = matrix ( 1:10, ncol = 2 )
> a
>
> b = ma
? merge
complexkid wrote:
>
> Hi,
> I have two matrices as follow:
> matrix A =
>
> a=matrix(c(c("abc","abc","bcd","bcd","bce","bce"),c("a1","d2","d1","d2","a1","a2")),6,2)
>
> and matrix B which contains pair of values :
> b=matrix(c(c("a1","a2"),c("a1","d2")),2,2)
>
> In short, I wish t
How about:
tapply(dat$x1,dat$subject,function(x) cumsum(x))
which gives you a list for each subject.
this can be converted to a vector:
do.call("c",tapply(dat$x1,dat$subject,function(x) cumsum(x)))
So if your data frame is ordered for your subjects:
cbind(your.data.frame,do.call("c",tapply(dat
Hello Rodrigo,
You're almost there:
you should make the variable distance before the while loop, and this should
be higher than 14 to go inside the while loop:
selectmarkers<- function(n=10){
tapply(mm$marker, mm$chr, function(m){
distances <- 15
while (max(distances) > 14) {
You're almost there:
a <- 12 # starting value
add <- function(variable,increment) {
variable + increment
}
add(a,25)
you shouldn't assign variable + increment to variable, unless you put a
return in your function:
add <- function(variable,increment) {
variable <- variable + incremen
How about:
id <- c(rep("a",4),rep("b",2), rep("c",5), rep("d",1))
start <- c(c(0,6,17,20),c(0,1),c(0,5,10,11,50),c(0))
stop <- c(c(6,12,20,30),c(1,10),c(3,10,11,30,55),c(6))
data <- data.frame(id,start,stop)
f <- function(data){
m <- match(data$start,data$stop) + 1
if (length
see ?merge
Kurapati,
Ravichandra (Ravichandra) wrote:
>
> Hi ,
>
>
>
>> df
>
> Session_Setup DCT FwdDataVols_bin countsComp
>
> 1 User_Initiated NoRLL 1 5058 User_Initiated+NoRLL+1
>
> 2 User_Initiated NoRLL 2584 U
What's wrong with that result?
you should look at the result as: first take the 3th element of a, then the
first one, than the second one and then the fourth.
if you do a[order(a)] then you get 15,20,30,40.
I suppose you expected:
rank(a)
[1] 2 3 1 4
Good luck
Bart
lll73 wrote:
>
>
> I am
maybe:
result <- list()
for (i in 1:10) result[[i]] <- rnorm(i)
Bart
Megh Dal wrote:
>
> Can anyone please tell me how to define a "list". Suppose I want to define
> a list object "result" with length n then want to fill each place of
> "result" with different objects. For e.g.
>
> i=1
> r
Hello,
Writing 19000 lines of R-script in Excel sounds terrible.
Could you provide us some code (please NOT 19000 lines), and the way you
generate this with Excel,
maybe we can figure out a much shorter/faster way to accomplish the same
result?
Bart
Duncan Murdoch-2 wrote:
>
> On 10/14/2008
you can see the different methods of mean by: methods(mean)
Then you can type mean.default and you will see the complete code.
Bart
Alphonse Monkamg wrote:
>
>
>
>
>
> Dear ALL,
>
> Does anyone know how to get the complete code program for any build-in
> function
> in R, e.g. when I tape
I think you wrote a function, but pass only snippets of code from your script
to your R-console.
The part which return the error is the following:
return()
return can only be used to return from a function and not as a command in
the R-console.
Bart
TU wrote:
>
> Dear R Users,
>
> Are err
Take a look at ?source
Mihai.Mirauta wrote:
>
>
> Hello,
>
> I am trying to use self created functions in other scripts than the one
> where they are stored.
> For the moment I am using the following structure of commands to do
> that:
>
> 1. Load the text file with the functions in the curr
Dear Felix,
I have no idea about the calculation of your accuracy, sensitivity, etc, but
the sums:
dat <- read.table(file="clipboard") #read in your data as dataframe dat
dat$comp <- apply(dat,1,function(x) sum(x[-c(1,22)]==as.numeric(x[22])))
Good luck
Bart
drflxms wrote:
>
> Dear R-collea
On my windows XP machine, if you uninstall R-2.7.1, the libraries which
doesn't come with the original installation remain in the folder C:\Program
Files\R\R-2.7.1\library.
So I first uninstall R-2.7.1, then install R-2.7.2, copy the remaining
packages from the R-2.7.1 folder to the R-2.7.2 librar
Please take a look at the manuals before posting (DO read the posting guide!)
Bart
PS: yourdataframe[yourdataframe$TAZ==103,2]
PDXRugger wrote:
>
> So i am hoping this solution is simple, which i beleive it is. I would
> like to look up a value in one column of a data set and display the
>
Hi,
lets look at an example:
fit <- lm(sr ~ ., data = LifeCycleSavings)
fit.anova <- anova(fit)
you can see the structure from the anova:
str(fit.anova)
Classes ‘anova’ and 'data.frame': 5 obs. of 5 variables:
$ Df : int 1 1 1 1 45
$ Sum Sq : num 204.1 53.3 12.4 63.1 650.7
$
You wrote MAXIMIZE this function, why not using the maximize option of
constrOptim?
If you read the help file, you will find that if you set the control fnscale
to a negative value, maximisation
is performed.
constrOptim(c(1,1),neg_loglik, grad=NULL, ui=rbind(c(1,0),c(0,1)),
ci=c(0,0),control=li
Survival depends on splines, so you should install the splines library, and
then everything should be fine.
Bart
Trevor Hansen wrote:
>
> Oh wait it gives me another error saying that:
> Loading required package: splines
>
> I cant find the package called splines in the list is that an impor
When I run your code, I have no problem at all, could you please give us some
more info about what system you are running on, OS, packages loaded, .
Bart
Trev101 wrote:
>
> Hey,
>
> I am just starting to learn R now and I typed in this simple survival
> program:
>
>library(survival
If you first install a newer version of R and aftwards remove a previous
version, Tinn-R gives this behaviour. Doesn't matter if you activate the
option to register.
Best regards
Bart
Philippe Grosjean wrote:
>
>
> Paul Chatfield wrote:
>> Hi - someone has just e-mailed me direct with the an
Here is the post where Prof Ripley is reffering to:
http://tolstoy.newcastle.edu.au/R/e2/help/07/09/26668.html
Bart
losemind wrote:
>
>
>
> Prof Brian Ripley wrote:
>>
>> A patch to do this was posted on 2007-09-29 by Glenn Davis. Some people
>> not addicted to Matlab find the behaviour
I'm not sure if I understand correct, but maybe something like:
apply(dat,2,function(x) sum(x[x<0]))
Please do read the posting guide and post a small, working example!!!
Bart
Rheannon wrote:
>
> Could anyone tell me a better way to achieve the output of this for loop?
> It seems to run quit
Re-installing R did the trick for me a while ago, don't know if this still
works with the current Tinn-R version.
Ptit_Bleu wrote:
>
> Hello Marcia,
>
> I had a similar problem when I updated Tinn-R.
> Under XP, in the file Document and Settings\... \Application
> Data\Tinn-R\ini\Tinn.ini,
>
Maybe something like this:
f1 with loop, f2 without.
f1 <- function(start,len, div) {
x <- rep(start,len)
for (i in 2 : (len-1)) {
x[i] <- x[i-1]/div
}
x[len] <- 0
return(x)
}
f2 <- function(start,len, div) {
x <- rep(start,len)
y <- div^(0:(len-1))
x <- x/y
x[length(x)] <- 0
return(
You can take a look at AUC in the PK package
stephen sefick wrote:
>
> I would like to integrate the area under a curve without any smoothing or
> the like- just on the raw numbers. I looked at integrate() but it
> requires
> a function which I assume means something like x+x^2+x^3
>
> is the
Maybe you should provide a minimal, working code with data, so that we all
can give it a try.
In the mean time: take a look at the Rprof function to see where your code
can be improved.
Good luck
Bart
Daniel Folkinshteyn-2 wrote:
>
> Hi everyone!
>
> I have a question about data processing e
I'm not sure what you are trying to do with R, but maybe you should take a
look at the Task Views and see if there is something you can use at your
field of work:
http://www.stats.bris.ac.uk/R/web/views/
Bart
Ricardo Rodríguez wrote:
>
> Hi everybody,
>
> I am trying to make my mind about t
The error comes from the way you specify the parameters:
At least not as elegant, but it works:
function4 <- function(x){
theta1 <- x[1]
theta2 <- x[2]
theta3 <- x[3]
function3(theta1,theta2,theta3)
}
fit<-optim(par=c(1, 1.2, .2), fn=function4)
Bart
threshol
This should be refined, but it gives you a start:
.dat<- summary(mod)$coefficients
namen <- row.names(.dat)
Est <- .dat[,1]
Err <- .dat[,2]
p <- .dat[,4]
p[p<0.0001] <- "***"
p[p<0.001] <- "**"
p[p<0.01] <- "*"
p[p<0.05] <- "."
p[p>0.05] <-" "
cat(paste(namen,"\t", Est, p, "\n\t\t(",Err,")\n"))
Hello,
altough I'm not an expert, I found a solution (maybe not the most
elegant.)
d<-as.Date(c("2000/01/03","2000/01/05","2000/01/19","2000/01/28"))
r<-rnorm(4)
da<-data.frame(d,r)
a<-as.Date("01/01/2000","%d/%m/%Y")
b<-as.Date("30/01/2000","%d/%m/%Y")
ab<-seq(a,b,by=1)
c<-format(ab,
Hi,
I'm not aware of a way to do this without some looping/applying, but this
should do the trick:
x <- 1:10
y <- rnorm(100,x,0.5)
dim(y) <- c(10,10)
mod <- lm(y~x)
do.call(rbind,lapply(summary(mod),function(x) coefficients(x)[,4]))
This will give you the p values/model
Bart
Mark W Kimpel
Your example runs fine at my pc, except from the readLines("File with 30
) part.
But this is probably a striped code, so maybe you should take a look at
flush.console().
Bart
Christopher Marcum wrote:
>
> Hello R-Users,
>
> I would like to use an iterative loop to collect user input from
Maybe something like:
f <- function(x,y) ifelse(sign(y[x])==-1,return(y[x-1]), return(y[x]))
test[,3] <- sapply(seq_along(test[,3]),f,test[,3])
Ravi S. Shankar wrote:
>
> Hi R,
>
> I have a dataframe with
> dim(test)
> [1] 435150 4
> class(test)
> [1] "data.frame"
> In the third colum
Could you provide us some working codo, so that we can reproduce the error
and see what went wrong?
Uli Kleinwechter wrote:
>
> Dear all,
>
> Within a larger script I use the following code to produce barplots for
> all variables contained in a dataframe "type3m":
>
> for(xn in names(ty
There are several mistakes:
Why are you using only p[1], p[2]?
Afterwards you try (for i in 1:10) p[i] so you should go to p[10]?
Then you should make a pnew wich holds 10 values, so pnew[i]
This should get you back on track
Bart
Kathy Maher wrote:
>
> Hi,
>
> I am trying to use the Fisher
Here is one way:
lapply(1:ncol(x),function(i) hist(x[,i], main =paste("Histogram
of",names(x)[i])))
Bart
Uli Kleinwechter wrote:
>
> Dear all,
>
> I'm just trying to create plots for all variables in a dataframe (named
> "x") using the following:
>
> png()
> apply(x,2,hist)
>
> Just as int
The x coordinate of the max y value:
x[which.max(mydiff$y)]
Jonas Stein wrote:
>
> Hi,
>
>
> i am sure, that this is a noob-question, but i have searched for
> hours without any good result.
>
> I want to draw a vertical line through the maximum of the first
> derivation.
>
> Here is a
quick (and dirty) solution:
y.up<- means+stand.error
y.dwn<- means-stand.error
plot(means,ylim=c(3.5,10))
for (i in 1:length(means)) arrows(i,means[i],i,y.up[i],length=0.1)
for (i in 1:length(means)) arrows(i,means[i],i,y.dwn[i],length=0.1)
Giacomo Prodi wrote:
>
> hello, ladyes and gentlem
Hi,
I'm currently taking a look at possibilities to report my results, produced
by R.
After looking at LaTex, I'm now considering the odf format, as most people
at my
company work with MS Word. So using odfWeave would be my best bet probably.
But if I run some examples from the odfWeave package,
ermimi wrote:
>
> Hello, I´m spanish student, and I´m making the finish project of computer
> science. I´m working in R and I need create a Interface which allow me
> select diferents execution options (similar to a menu). Is posible to
> create this menu,or interface, with R? or I have create
A simple RSiteSearch:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/63840.html
Bart
Luís Paulo F. Garcia wrote:
>
> How do i for have a time of experiment? Have a package for this? Or
> function? In my case the time of experiment is learning machining (svm).
>
> Tanks :)
>
> [[alter
Hi Georg,
see textplot in the gplots package
another way is thru sweave and latex, pdf -> latex
Bart
Georg Ehret wrote:
>
> Dear R community,
>I wish to print tables into a pdf file. How can this be done,
> adding
> headers and several tables to the same file?
>
> Thanking you for
I'm not sure if this is what you want but if you have a matrix as response,
you can use the matrix ~ term:
example:
x <- 1:10
y <- rep(rnorm(10,x,0.5),10)
dim(y) <- c(10,10)
y <- as.matrix(y)
coef(lm(y~x))
Bart
Markus "Mühlbacher" wrote:
>
> Hi everyone!
>
> I have an array containing the
I must admit it's a very bad practice, but if you put these files in a
separate folder, and you know what you have been busy with, I think it's
less important. At least it saves you some mouse clicks
But Philippe, you are absolutely rigth about the bad practice!
Bart
Philippe Grosjean wrot
Greg Snow-2 wrote:
>
>
>> write.table(my.data, 'clipboard', sep="\t")
>
> Then in Excel just do a paste and the data is there, this saves a couple
> of steps from saving as a .csv file and importing that into excel. This
> would probably be fine for a few tables.
>
>
>
Just to in
You can use a GUI to teach R, so the programming-style is gone.
But using the command line aproach, it forces you to think about your
analysis.
In an GUI, it's easy to point and click, without knowing what you are doing.
With the command line, you know where you start, and from there you go to
the
Maybe:
cbind(df,rbind(NA,apply(log(df),2,diff)))
Bart
Vishal Belsare wrote:
>
> I have a dataframe say:
>
> date price_g price_s
> 0.340.56
> 0.360.76
>. .
>. .
>. .
>
> and so
maybe this is what you want:
plot(all~c(1:2),type="b",col="blue",xlim=c(1,4),ylim=c(20,150),pch=c("a","b"),yaxt="none")
lines(all2~c(2:3),type="o",col="yellow",pch=c("d","e"))
for some manuals, look at the contributed documents section at the R
homepage
Bart
ran2 wrote:
>
> Dear all,
>
>
You mean non-linearity?
You can use a lack of fit test by using:
anova(lm(y ~ x+factor(x), data))
The F-value of factor(x) is the lack of fit test, and when lineair, the p
value should be <0.05 when using 0.95% significance.
Bart
Wensui Liu wrote:
>
> in statistics, is there a measure for curv
I think you have an object x which doensn't allow to give names.
If you use names(z) it will work.
To see what kind of object x is: class(x)
Regards
Bart
Schiller Judith 1541 EB wrote:
>
> hi,
>
> after installing R-2.6.0 the function "names" doesn't work anymore on my
> windows xp machine.
Maybe you can make a simple r-script (for example a jpg-plot of random
numbers, ) and run this.
This should indicate wether its due to the script or to the call to R.
From this you can work your way further down to the problem:
-if it's the script, alter your script step by step until you foun
Maybe I'm wrong, but aren't you calculating just the same as cor(data
frame,method ="spearman"), with some further parameters being monitored?
Could you please provide a commented, minimal, self-contained, reproducible
code, so that we can see what is actually going on and what is the way you
wa
Take a look at ?scan.
There is an explanation for the doubling of the string
Bart
Jun Ding wrote:
>
> Hi Everyone,
>
> Recently I got puzzled by the function read.table,
> even though I have used it for a long time.
>
> I have such a file (tmp.txt, 2 rows and 3 columns,
> with a space am
Same problem here, it never works
Sys.info()
sysname release
"Windows" "NT 5.1"
version nodename
"(build 2600) Service Pack 2" "PCWXPUPLC1"
76 matches
Mail list logo