Re: [R] advice about R for windows speed

2009-11-20 Thread bartjoosen
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

Re: [R] Splitting massive output into multiple text files

2009-11-20 Thread bartjoosen
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

Re: [R] Temperature Prediction Model

2009-10-30 Thread bartjoosen
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

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-13 Thread bartjoosen
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

Re: [R] aproximate a titration kurve to the measure data.

2009-10-01 Thread bartjoosen
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

Re: [R] executing rscript from VB

2009-09-11 Thread bartjoosen
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

Re: [R] manipulating text to generate different formulas to use in nls()

2009-08-11 Thread bartjoosen
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

[R] Can't find package for decision plot anymore

2009-05-06 Thread bartjoosen
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.

Re: [R] How to skip rest of code

2009-05-04 Thread bartjoosen
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

Re: [R] odbcConnectAccess function

2009-05-04 Thread bartjoosen
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

Re: [R] How to get rid of loop?

2009-04-28 Thread bartjoosen
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)

Re: [R] automatic exploration of all possible loglinear models?

2009-04-22 Thread bartjoosen
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

Re: [R] Functions Accessing Databases

2009-04-03 Thread bartjoosen
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

Re: [R] stats lm() function

2009-03-13 Thread bartjoosen
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

Re: [R] how to omit NA without using ifelse

2009-03-06 Thread bartjoosen
?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

[R] Extract dates from dataframe

2009-03-06 Thread bartjoosen
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

[R] Chromatogram deconvolution and peak matching

2009-02-17 Thread bartjoosen
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

Re: [R] How to comment in R

2009-02-11 Thread bartjoosen
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

Re: [R] Plotting graph for Missing values

2009-01-26 Thread bartjoosen
> 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

Re: [R] R2HTML and output from a function

2008-12-18 Thread bartjoosen
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

Re: [R] Need help optimizing/vectorizing nested loops

2008-12-09 Thread bartjoosen
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

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread bartjoosen
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

Re: [R] intersection of two matrices

2008-12-03 Thread bartjoosen
? 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

Re: [R] count the cumulative for each subject

2008-11-24 Thread bartjoosen
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

Re: [R] While loop set up

2008-11-18 Thread bartjoosen
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) {

Re: [R] function that uses a variable name as the parameter

2008-11-12 Thread bartjoosen
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

Re: [R] Data manipulation question

2008-11-06 Thread bartjoosen
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

Re: [R] need some help

2008-11-03 Thread bartjoosen
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

Re: [R] Incorrect order

2008-10-29 Thread bartjoosen
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

Re: [R] Defining a "list"

2008-10-15 Thread bartjoosen
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

Re: [R] Maximum number of pasted 'code' lines?

2008-10-15 Thread bartjoosen
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

Re: [R] function in R

2008-10-02 Thread bartjoosen
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

Re: [R] error message documentation: "Error: no function to return from, jumping to top level"

2008-10-02 Thread bartjoosen
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

Re: [R] How to load functions in R

2008-09-11 Thread bartjoosen
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

Re: [R] convenient way to calculate specificity, sensitivity and accuracy from raw data

2008-09-01 Thread bartjoosen
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

Re: [R] Upgrading R means I lose my packages

2008-08-29 Thread bartjoosen
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

Re: [R] Simple look up

2008-08-22 Thread bartjoosen
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 >

Re: [R] ANOVA tables - storing F values

2008-08-12 Thread bartjoosen
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 $

Re: [R] maximization under constraits

2008-08-08 Thread bartjoosen
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

Re: [R] Trying to run simple survival program in R but does not work

2008-08-07 Thread bartjoosen
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

Re: [R] Trying to run simple survival program in R but does not work

2008-08-07 Thread bartjoosen
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

Re: [R] Opening R from Tinn without setting directory each time

2008-08-06 Thread bartjoosen
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

Re: [R] R command history -- can it be like Matlab's?

2008-07-30 Thread bartjoosen
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

Re: [R] how to speed up this for loop?

2008-07-22 Thread bartjoosen
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: [R] Start preferred RGui

2008-07-11 Thread bartjoosen
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, >

Re: [R] re cursively divide a value to get a sequence

2008-07-09 Thread bartjoosen
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(

Re: [R] Area Under a Curve

2008-07-02 Thread bartjoosen
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

Re: [R] Improving data processing efficiency

2008-06-05 Thread bartjoosen
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

Re: [R] generic question -> Genomics with R

2008-04-29 Thread bartjoosen
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

Re: [R] optimization setup

2008-04-23 Thread bartjoosen
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

Re: [R] Format regression result summary

2008-04-15 Thread bartjoosen
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"))

Re: [R] How can we creat conditional data frame

2008-04-04 Thread bartjoosen
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,

Re: [R] getting serial anovas from a complex lm object obtained with a matrix of responses

2008-04-04 Thread bartjoosen
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

Re: [R] iterative loop with user input?

2008-04-04 Thread bartjoosen
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

Re: [R] Re place with previous value

2008-03-27 Thread bartjoosen
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

Re: [R] Error when producing multiple graphes

2008-03-19 Thread bartjoosen
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

Re: [R] (no subject)

2008-03-17 Thread bartjoosen
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

Re: [R] Creating plots for all variables in a data frame and printing them with the variable name in the main title

2008-03-17 Thread bartjoosen
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

Re: [R] howto find corresponding values in datasource?

2008-03-13 Thread bartjoosen
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

Re: [R] hello! i need help for a specific graphic issue

2008-03-12 Thread bartjoosen
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

[R] odfWeave examples not working

2008-03-12 Thread bartjoosen
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,

Re: [R] CREATE INTERFACE TO SELECT DIFERENT OPTIONS

2008-03-06 Thread bartjoosen
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

Re: [R] time experiment

2008-02-29 Thread bartjoosen
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

Re: [R] printing tables to a pdf

2008-02-29 Thread bartjoosen
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

Re: [R] Multiple linear regression with for loop

2008-02-27 Thread bartjoosen
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

Re: [R] Transfer Crosstable to Word-Document

2008-02-22 Thread bartjoosen
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

Re: [R] Transfer Crosstable to Word-Document

2008-02-20 Thread bartjoosen
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

Re: [R] Using R in a university course: dealing with proposal comments

2008-02-11 Thread bartjoosen
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

Re: [R] diff in a dataframe

2008-01-10 Thread bartjoosen
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

Re: [R] plotting help needed

2008-01-09 Thread bartjoosen
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, > >

Re: [R] any measure for curvature

2007-11-21 Thread Bartjoosen
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

Re: [R] no applicable method for "names"

2007-11-15 Thread Bartjoosen
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.

Re: [R] Error message on script execution

2007-10-31 Thread Bartjoosen
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

Re: [R] How to speed up multiple for loop over list of data frames

2007-10-17 Thread Bartjoosen
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

Re: [R] A weird observation from using read.table

2007-09-23 Thread Bartjoosen
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

Re: [R] Cutting & pasting help examples into script window

2007-09-21 Thread Bartjoosen
Same problem here, it never works Sys.info() sysname release "Windows" "NT 5.1" version nodename "(build 2600) Service Pack 2" "PCWXPUPLC1"