[R] Pattern matching and replacement in matrix

2010-05-19 Thread Dani Valverde
Hello, Is there any function like gsub(), that can match and replace patterns in a matrix or a data frame? Cheers! Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barcelona Edifici V, Campus UAB 08193 Cerdanyola del Val

[R] Fitting a function

2010-05-14 Thread Dani Valverde
Hello, It is a very naive question, but here it is. I have this values: x: 0.5 4 6 8 12 y: 0.021 0.021 0.020 0.018 0.012 I need to fit a function to them. How can I do it with R? Thank you so much! Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de

Re: [R] Fitting a logistic regression

2009-08-20 Thread Dani Valverde
EC50=50,gamma=2,E0=0.2,Emax=1.2))->mod.test > > AIC(mod.test) does improve. Hope this helps. > > Jun > > On Wed, Aug 19, 2009 at 5:04 AM, Dani Valverde > wrote: > Hello, > I have this data: > Time AMP > 0 0.200

[R] Fitting a logistic regression

2009-08-19 Thread Dani Valverde
Hello, I have this data: Time AMP 0 0.200 10 0.1958350 20 0.2914560 40 0.6763628 60 0.8494534 90 0.9874526 120 1.0477692 where AMP is the concentration of this metabolite with time. If you plot the data, you can see that it could be fitted using a logistic regres

[R] Combination

2009-02-17 Thread Dani Valverde
Hello, I have a sequence of numbers: seq(1:50) and I would like to have all the possible combinations with this numbers without repeating any combination: 11, 12, 13, ... ,22,23,24,... How can I do it? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veter

Re: [R] Fitting a model

2008-11-24 Thread Dani Valverde
N +34 93 5814126 En/na Eik Vettorazzi ha escrit: Actually "drm" as posted before fits a sigmoid curve (a generalized logistic function with 4 parameters, see ?LL.4), so I didn't get the point of your new question. Dani Valverde schrieb: Thank you all for your answers. If

Re: [R] Fitting a model

2008-11-20 Thread Dani Valverde
g that "ph" is the independent variable (as modelled above) - so if you want to predict a ph from delta you will need the "inverse" function of your fitted model - you could toy with ED from the drc package or do a simple grid search with "predict". hth. Dan

[R] Fitting a model

2008-11-20 Thread Dani Valverde
Hello, This is a very basic question, but I don'y know the answer. I have these data delta <- c(28.6-8.825,28.6-8.828,28.6-8.836,28.6-8.845,28.6-8.897,28.6-8.944,28.6-9.027,28.6-9.091,28.6-9.263,28.6-9.4,28.6-9.7,28.6-9.981, 28.6-10.287,28.6-10.48,28.6-10.684,28.6-10.875) ph <- c(4.4,4.6,4.8,

[R] Problems with playwith()

2008-09-03 Thread Dani Valverde
Hello, I am trying to execute an example provided in the help files for the playwith() function. I try to execute the first example: library(playwith) if (interactive()) { options(device.ask.default = FALSE) ## Scatterplot (Lattice graphics). ## Labels are taken from rownames of data. ## Just

Re: [R] Text

2008-09-01 Thread Dani Valverde
algaard ha escrit: Dani Valverde wrote: Hello, I would like to place some text that should appear in the same position of the graphic device, preferably outside the plotting area, regardless the x and y axes limits. How can I do this? I think you can use title() with an adj= argument. Othe

[R] Text

2008-09-01 Thread Dani Valverde
Hello, I would like to place some text that should appear in the same position of the graphic device, preferably outside the plotting area, regardless the x and y axes limits. How can I do this? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària

[R] Read a file

2008-08-28 Thread Dani Valverde
Hello, I have a text file with this structure: # File created = Thursday, August 28, 2008 3:33:02 PM GMT # Data set = 373 2 1 C:\Bruker\TOPSPIN GABRMN # Spectral Region: # LEFT = 4.5 ppm. RIGHT = 0.5 ppm. # # SIZE = 13111 ( = number of points) # # In the following ordering is from the 'left'

[R] Combine x-axis labels size

2008-08-27 Thread Dani Valverde
Hello, I would like to combine different label sizes in the same x-axis, for example 1 2 3 4 5 6 7 8 9 How can I do it? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barcelona Edifici V, Campus UAB 08193 Cerdany

[R] Closest value

2008-08-27 Thread Dani Valverde
Hello, I have this command: x.axis <- seq(from=0.5, to=4.5, length.out=13112) How can I which of the x.axis components is the closest to a given value, for example 3.2? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma

[R] Anova

2008-08-12 Thread Dani Valverde
Hello, I am trying to perform an ANOVA on a dataframe like this: ID Grup ML PC mI Gly Glx X373.txt 11 0.004685889 0.05994939 0.004589104 0.007144027 0.02042549 X373bis.txt 21 0.004685889 0.0599494 0

[R] Expression in axis

2008-07-09 Thread Dani Valverde
Hello, I am creating a plot and I would like to know how to put this expression to the y axis µmol/10^6 cells I've tried some combinations using the expression() function, but none of them worked. Any idea? Best, Dani -- Daniel Valverde Saubí

[R] ANOVA error

2008-06-19 Thread Dani Valverde
Hello, I have a dataframe named myMatrix with the structure TreatmentTimeCrmIb ... Being the treatment and time the predictors and Cr, mIb and so on the response variables. When I call Cr.aov <- aov(Cr~Treatment, data=myMatrix) I got this error: Error in storage.mode(y) <- "doub

[R] fit.contrast error

2008-06-06 Thread Dani Valverde
Hello, I am trying to perform a fit.contrast() on a lme object with this code: attach(error_DB) model_temperature <- lme(Error ~ Temperature, data = error_DB,random=~1|ID) summary(model_temperature) fit.contrast(model_temperature, "Temperature", c(-1,1), conf.int=0.95 ) detach(error_DB) but I go

[R] lsmeans

2008-06-06 Thread Dani Valverde
Hello, I have the next function call: lme(fixed=Error ~ Temperature * Tumour ,random = ~1|ID, data=error_DB) which returns an lme object. I am interested on carrying out some kind of lsmeans on the data returned, but I cannot find any function to do this in R. I'have seen the effect() function

[R] LDA and centroids

2008-06-02 Thread Dani Valverde
Hello, I have carried out an lda analysis using the lda function of MASS package. I have plotted the LD1xLD2 to represent the data. Now I would like to get the centroids for each group of data and plot it on the LD1xLD2 graph. How can I get the centroid value from the lda object? Best, Dani

[R] Problems with lme

2008-05-24 Thread Dani Valverde
Hello, I want to perform an lme on a database with this structure: ID Sequence Temperature TumourError 15 0 1 8.721872e-08 15 0 2 8.695348e-08 15 0

[R] Clustering large data matrix

2008-03-06 Thread Dani Valverde
Hello, I have a large data matrix (68x13112), each row corresponding to one observation (patients) and each column corresponding to the variables (points within an NMR spectrum). I would like to carry out some kind of clustering on these data to see how many clusters are there. I have tried the

[R] GLM

2008-02-26 Thread Dani Valverde
Hello, I am trying to perform a glm analysis on a 68x13113 matrix (named data.spect). The first column corresponds to the predictor (data.spect[,1]) and the rest to the response variables (data.spect[,2:13113]). When I try this code glmObject <- glm(data.spect[,2:13113]~data.spect[,1]) I get t

Re: [R] insert() function

2008-02-21 Thread Dani Valverde
st(intensities)) >> str(spect2) >> > num [1:13112] -0.457 -0.457 0.300 1.781 -0.381 ... > > /Henrik > > On Thu, Feb 21, 2008 at 9:26 AM, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > >> On Thu, Feb 21, 2008 at 4:30 AM, Dani Valverde <[EMAIL PRO

Re: [R] insert() function

2008-02-21 Thread Dani Valverde
ma de Barcelona Edifici V, Campus UAB 08193 Cerdanyola del Vallès- SPAIN Centro de Investigación Biomédica en Red en Bioingeniería, Biomateriales y Nanomedicina (CIBER-BBN) Grup d'Aplicacions Biomèdiques de la RMN Facultat de Biociències Universitat Autònoma de Barcelona Edifici Cs, Campus UAB 08193 C

Re: [R] Rd to latex

2008-02-20 Thread Dani Valverde
acultat de Biociències Universitat Autònoma de Barcelona Edifici Cs, Campus UAB 08193 Cerdanyola del Vallès- SPAIN +34 93 5814126 En/na Stefan Grosse ha escrit: > maybe the xtable package? > > > On Wednesday 20 February 2008 05:42:27 pm Dani Valverde wrote: > DV> Hello, > DV

[R] Rd to latex

2008-02-20 Thread Dani Valverde
Hello, I would like to convert an Rd object to a latex file, so that I can put it in my thesis. How can I do it? I tryed latex(), but it only works for code... Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barce

[R] insert() function

2008-02-20 Thread Dani Valverde
Hello, I am trying to insert a certain number of points into a certain position of a vector with this code: x <- seq(1:10909) x1 <- c(13112-10909) spect1 <- rnorm(13112) interpol <- approx(x,spect1,xout=c(seq(from=1, by=((10909 - 1)/(x1 - 1)), length.out=x1))) pos <- round(interpol$x,0) intensiti

Re: [R] Interpolation between 2 vectors

2008-02-20 Thread Dani Valverde
SPAIN +34 93 5814126 En/na jim holtman ha escrit: > check out the 'approx' function. > > On Feb 19, 2008 12:44 PM, Dani Valverde <[EMAIL PROTECTED]> wrote: > >> Hello, >> I have two vectors, one with 13112 points and the other one with 10909. >> I won

[R] Interpolation between 2 vectors

2008-02-19 Thread Dani Valverde
Hello, I have two vectors, one with 13112 points and the other one with 10909. I wonder if there is a way to interpolate the data so the shorter vectors has the same number of points as the longer one. Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veteri

[R] Compile Rd file

2008-02-05 Thread Dani Valverde
Hello, I am trying to compile a file .Rd into .html using R CMD Rdconv -t=html /file.rd/>/file.html./ It seems that the process works ok but instead of having for example loo.cv(NMRTools) at the top of the html file I have loo.cv{unknown}. Any ideas on how to solve this? Best, Dani // -- Da

[R] [Fwd: Problems when checking a package]

2008-02-05 Thread Dani Valverde
Forget my last message, it was a really stupid problem. Sorry about the mess. Best, Dani Missatge original Assumpte: Problems when checking a package Data: Tue, 05 Feb 2008 11:20:28 +0100 De: Dani Valverde <[EMAIL PROTECTED]> A: R Help Hello

[R] Problems when checking a package

2008-02-05 Thread Dani Valverde
Hello, I am tryining to build a package called NMRTools and when I check it using R CMD check NMRTools I get this error: Functions/methods with usage in documentation object 'lda.bootstrap' but not in code: lda.bootstrap As far as I undestand there is something present in lda.bootstrap.rd but

[R] Package compilation

2007-12-12 Thread Dani Valverde
Hello, Is there an easy way to compile a package so that it can be installed as a binary file under Windows? Now I have the source code. I am not used in compiling, and the documentation seems too hard for me, so an easy way would be great. Best regards, Dani -- Daniel Valverde Saubí Grup de

[R] Installing packages

2007-12-03 Thread Dani Valverde
Hello, I have a problem when making packages with version 2.6.1. I have a package which I could install in version 2.5.1. I have made some modifications of the package, and I would like to install it to 2.6.1. I check the package with R CMD check, I build it with R CMD build and when I try to i

Re: [R] Odp: Cutting a vector

2007-11-22 Thread Dani Valverde
Hello, That's very useful. I think the cut() function is the key. However, in my real vector I have 13112 points. I would like the function to cut the vector every certain number of points (ie 4). Is there a way to specify this without the need of writing each cutting point? For example, I do n

[R] Cutting a vector

2007-11-22 Thread Dani Valverde
Hello, I have a vector, lets say x <- 1:50 I would like it to be cut at certain points, being for example 1:5, 6:11, 12:17, ... How can I do it? I have tried the cut() function, but I don not know how to place the cutting points properly. Best regards, Dani -- Daniel Valverde Saubí Grup de Bi