[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 Vallès- SPAIN

Tlf. +34 93 581 1910
Fax: +34 93 581 1573

__
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, reproducible code.


[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 la Universitat Autònoma de Barcelona
Edifici V, Campus UAB
08193 Cerdanyola del Vallès- SPAIN

Tlf. +34 93 581 1910
Fax: +34 93 581 1573

__
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, reproducible code.


Re: [R] Fitting a logistic regression

2009-08-20 Thread Dani Valverde
Thank you very much, Jun. This is what I was looking for.

Best!

Dani

On Wed, 2009-08-19 at 09:52 -0500, Jun Shen wrote:
> I would suggest a model with a baseline level, something like
> 
> nls(AMP~E0+(Emax-E0)*Time**gamma/(EC50**gamma+Time**gamma),data=your
> data,
> start=list(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
>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
> regression. For this purpose, I used this code:
> 
> AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data =
> concentrations,model=T)
> 
> When plotting the fitted function, it seems that it fits quite
> well at
> the end of the time. However, at the beginning it seems that
> the fit is
> not so good. How can I achieve a better fit? Forgive me if it
> is a
> stupid question, but I am just starting with non linear
> regression.
> Thank you,
> 
> Dani
> --
> [?]
> 
> __
> 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, reproducible
> code.
> 
> 
> 
> -- 
> Jun Shen PhD
> PK/PD Scientist
> BioPharma Services
> Millipore Corporation
> 15 Research Park Dr.
> St Charles, MO 63304
> Direct: 636-720-1589
> 
-- 
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 Vallès- SPAIN

Tlf. +34 93 581 1910
Fax: +34 93 581 1573

__
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, reproducible code.


[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
regression. For this purpose, I used this code:

AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data =
concentrations,model=T)

When plotting the fitted function, it seems that it fits quite well at
the end of the time. However, at the beginning it seems that the fit is
not so good. How can I achieve a better fit? Forgive me if it is a
stupid question, but I am just starting with non linear regression.
Thank you,

Dani
-- 
[?]

__
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, reproducible code.


[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 Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


Re: [R] Fitting a model

2008-11-24 Thread Dani Valverde
Sorry, I had no seen your previous e-mail. Just another question. Is 
there any way to obtain an R2 to have a numeric idea of how good is the 
fitting?


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 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 Cerdanyola del Vallès- SPAIN
+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 you look at the plot resulting 
from my data, it seems that it is some kind of sigmoid function, not 
only polynomial. How could I fit 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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126



En/na Eik Vettorazzi ha escrit:
you might use the drc-package (equivalently you could use nls with 
an appropriate "selfstart" model like SSlogis)


library(drc)
mm<-drm(delta~ph,fct=LL.4())
plot(mm)

From your plot I was assuming 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.


Dani Valverde schrieb:

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,5,5.2,5.4,5.6,5.8,6,6.2,6.4,6.6,6.8,7,7.2,7.4)
plot(ph,delta,ylab=c(expression(Delta*delta)),xlab="pH")

Which kind of model can I fit on these, so that can I predict for a 
given delta the pH of my sample? Once the model is fitted, how can 
I plot it on the graph?

Best regards,

Dani










__
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, reproducible code.


Re: [R] Fitting a model

2008-11-20 Thread Dani Valverde
Thank you all for your answers. If you look at the plot resulting from 
my data, it seems that it is some kind of sigmoid function, not only 
polynomial. How could I fit 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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126



En/na Eik Vettorazzi ha escrit:
you might use the drc-package (equivalently you could use nls with an 
appropriate "selfstart" model like SSlogis)


library(drc)
mm<-drm(delta~ph,fct=LL.4())
plot(mm)

From your plot I was assuming 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.


Dani Valverde schrieb:

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,5,5.2,5.4,5.6,5.8,6,6.2,6.4,6.6,6.8,7,7.2,7.4)
plot(ph,delta,ylab=c(expression(Delta*delta)),xlab="pH")

Which kind of model can I fit on these, so that can I predict for a 
given delta the pH of my sample? Once the model is fitted, how can I 
plot it on the graph?

Best regards,

Dani





__
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, reproducible code.


[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,5,5.2,5.4,5.6,5.8,6,6.2,6.4,6.6,6.8,7,7.2,7.4)
plot(ph,delta,ylab=c(expression(Delta*delta)),xlab="pH")

Which kind of model can I fit on these, so that can I predict for a 
given delta the pH of my sample? Once the model is fitted, how can I 
plot it on the graph?

Best regards,

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 click on the plot to identify points.
playwith(xyplot(Income ~ log(Population / Area),
  data = data.frame(state.x77), groups = state.region,
  type = c("p", "smooth"), span = 1, auto.key = TRUE,
  ylab = "Income per capita, 1974"))
}

I get many errors regarded with GLib, and finally it says that the 
runtime environment asks to close the application in an appropiate way. 
Any idea on how to solve thi? I have all packages installed. I use R 
2.7.2 and GTK+ 2.12.9. I have all the required packages installed.

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


Re: [R] Text

2008-09-01 Thread Dani Valverde
I've thought about it, but the position should be always the same, 
locator() should return me the same value.


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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126



En/na Peter Dalgaard 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.

Otherwise, try mtext(), using par("usr") and par("pin") to calculate the
at= argument.

  

Best,

Dani








__
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, reproducible code.


[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 de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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' to the 'right' limits!
# Lines beginning with '#' must be considered as comment lines.
#
1628.40625
1628.40625
1964.40625
2242.0625
2533.5
2937.90625
3448.0
3923.96875

Is it possible to read it with R, something like scan() but keeping the 
structure?

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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.004589104   0.007144028   
0.0204255
X376.txt 31 0.007604898  0.07600049  0.019352470.01678972  
0.03363403
X392.txt 41 0.004982747  0.02760991  0.018555960.01413439  
0.02013267
X483.txt 51 0.009131522  0.02636227  0.024852320.01493074  
0.02532194
X520.txt 61 0.008553895  0.06304886  0.024902610.01907819  
0.03356447
X671.txt 71 0.008004383  0.05243909   0.0229447  0.024266  
0.03553224
X673A.txt81  0.01306893  0.02799318  0.01155338   0.007668364  
0.02123958
X673B.txt91 0.006099385   0.0516078  0.030993240.02664487  
0.03766267
X674.txt101 0.005476397  0.04945545  0.014797420.01084873  
0.02307815
X681.txt111 0.009807893  0.01680487 0.004524913   0.004705414 
0.008969453
X725.txt121  0.01018343   0.0119391 0.007911063   0.008005791  
0.01014625
X746.txt131 0.008864319  0.02484126  0.011980480.01276371  
0.01042683
X772.txt141 0.005966057  0.07398342   0.02103990.01606057  
0.02932874
X814.txt151  0.01350947   0.0317243 0.003234958   0.002958675 
0.005194511
X835.txt161 0.005509359  0.02670237  0.074253230.04095533
0.031017
X847.txt171 0.004784228  0.05349206  0.011836790.01230316  
0.03073348
X851.txt181 0.004395889  0.03812635  0.019986530.02165763  
0.02074277
X865.txt191 0.001514055  0.07128447   0.01068870.00802192  
0.01478855
X878.txt201 0.003693918  0.03864821  0.015717970.01972568
0.022711
et2029.txt  211  0.05204285  0.03769878  0.031687990.03631842  
0.02732589
et2348.txt  221  0.01407517  0.01679014 0.004900163   0.004243802  
0.01052361


The table is truncated because it's very big, but it has 3 different 
groups (Grup variable) and it's called GBM.

I try to use the command:

aov(GBM$Grup~GBM$ML,data=GBM)

But I get this error:

/Error in storage.mode(y) <- "double" :
 invalid to change the storage mode of a factor
In addition: Warning message:
In model.response(mf, "numeric") :
 using type="numeric" with a factor response will be ignored/

How can I solve this?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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í

Grup de Biologia Molecular de Llevats
Facultat de Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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) <- "double" :
 invalid to change the storage mode of a factor
In addition: Warning message:
In model.response(mf, "numeric") :
 using type="numeric" with a factor response will be ignored

Can anyone help me? I take the chance to ask another question. I would 
like to perform an ANOVA on different variables. Is the call 
aov(Cr+mIb+...~Treatment, data=myMatrix) o correct way of doing it? What 
I would like to have is a p value for the variance for each response 
variable.

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 got this error

Error in `contrasts<-`(`*tmp*`, value = c(-0.5, 0.5)) :
 contrasts apply only to factors

My database is a dataframe, very similar to that of the Orthodont. Could 
anyone give me some advise on how to solve the problem?


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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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, but it does not work with 
lme objects. Any idea?


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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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

--
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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  3 2.019604e-13
15  37  1 2.746476e-01
15  37  2 1.580415e-02
15  37  3 1.586857e-01
12   0  1 8.721872e-08
12   0  2 8.695348e-08
12   0  3 2.019604e-13
12  37  12.746476e-01

I try to perform an lme with the lme() function of the lme package 
(first I attach the data frame with attach()). This is the code:

lme(Error ~ ID + Sequence + Temperature + Tumour)

If I use this code, I get the following error:

Error in getGroups.data.frame(dataMix, groups) :
 Invalid formula for groups

Can anyone help me?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 function clara() from the package cluster. If I use the matrix 
as is, I can perform the clara analysis but when I call clusplot() I get 
this error:

Error in princomp.default(x, scores = TRUE, cor = ncol(x) != 2) :   
'princomp' can only be used with more units than variables

Then, I reduce the dimensionality by using the function prcomp(). Then I 
take the 13 first principal components (80%< variability) and I carry 
out the clara() analysis again. Then, I call the clusplot() function 
again and voilà!, it works. The problem is that clusplot() only 
represents the two first components of my prcomp() analysis, which 
represents only 15% of the variability.
So, my questions are 1) is clara() a proper way to analyze such a large 
data set? and 2) Is there an appropiate method for graphic plotting of 
my data, that takes into account the whole variability if my data, not 
just two principal components?
Many thanks.
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 the following error:

Error: (subscript) logical subscript too long

Could anyone help me on solving this problem?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


Re: [R] insert() function

2008-02-21 Thread Dani Valverde
Great! Now it works. Many thanks.

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126



En/na Henrik Bengtsson ha escrit:
>> spect2 <- insert(spect1, ats=pos, values=as.list(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 PROTECTED]> wrote:
>>  > Hello,
>>
>> 
>>>  I still having problems with insert() from R.utils package. I provide a
>>>   
>>  >  code with no error:
>>  >
>>  > x <- seq(1:10909)
>>  >  x1 <- c(13112-10909)
>>  >  spect1 <- rnorm(10909)
>>  >
>>  > interpol <- approx(x,spect1,xout=c(seq(from=1, by=((10909 - 1)/(x1 -1)),
>>  >  length.out=x1)))
>>  >  pos <- round(interpol$x,0)
>>  >  intensities <- interpol$y
>>  >
>>  > str(spect1)
>>  >  str(pos)
>>  >  str(intensities)
>>
>>  So what does these output?  They are the ones that will give you a
>>  lead to solving your problem, which I think is unrelated to insert().
>>
>>  /Henrik
>>
>>
>>
>>  >
>>  >  Then, when I call:
>>  >  library(R.utils)
>>  >
>>  > spect2 <- insert(spect1,ats=pos,values=intensities)
>>  >
>>  >  I have this error:
>>  >
>>  >
>>  >  Error in list("insert(spect1, ats = pos, values = intensities)" =
>>  >  ,  :
>>  >
>>  >  [2008-02-21 13:27:49] Exception: Argument 'ats' and argument 'values'
>>  >
>>  > has different lengths: 2203 != 1
>>  >   at throw(Exception(...))
>>  >   at throw.default("Argument 'ats' and argument 'values' has different
>>  >  lengths: ", length(ats), " != ", length(values))
>>  >   at throw("Argument 'ats' and argument 'values' has different lengths:
>>  >  ", length(ats), " != ", length(values))
>>  >   at insert.default(spect1, ats = pos, values = intensities)
>>  >   at insert(spect1, ats = pos, values = intensities)
>>  >
>>  >  You see that I still having the error, even calling the str() function
>>  >  before insert().
>>  >  Here there is my sessionInfo():
>>  >
>>  >  R version 2.6.2 (2008-02-08)
>>  >  i386-pc-mingw32
>>  >
>>  >  locale:
>>  >  
>> LC_COLLATE=Spanish_Spain.1252;LC_CTYPE=Spanish_Spain.1252;LC_MONETARY=Spanish_Spain.1252;LC_NUMERIC=C;LC_TIME=Spanish_Spain.1252
>>  >
>>  >  attached base packages:
>>  >  [1] datasets  stats graphics  grDevices tcltk utils
>>  >  methods   base
>>  >
>>  >  other attached packages:
>>  >   [1] R.utils_0.9.8R.oo_1.4.1   R.methodsS3_1.0.0
>>  >  Hmisc_3.4-3  MASS_7.2-40  scatterplot3d_0.3-25
>>  >  NMRTools_1.0.2
>>  >   [8] svSocket_0.9-5   svIO_0.9-5   R2HTML_1.58
>>  >  svMisc_0.9-5 svIDE_0.9-5
>>  >
>>  >  loaded via a namespace (and not attached):
>>  >  [1] cluster_1.11.9 grid_2.6.2 lattice_0.17-6 tools_2.6.2
>>  >
>>  >  Can you help?
>>  >
>>  > 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 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 Cerdanyola del Vallès- SPAIN
>>  >  +34 93 5814126
>>  >
>>  >
>>  >
>>  >  En/na Henrik Bengtsson ha escr

Re: [R] insert() function

2008-02-21 Thread Dani Valverde
Hello,
I still having problems with insert() from R.utils package. I provide a 
code with no error:
x <- seq(1:10909)
x1 <- c(13112-10909)
spect1 <- rnorm(10909)
interpol <- approx(x,spect1,xout=c(seq(from=1, by=((10909 - 1)/(x1 -1)), 
length.out=x1)))
pos <- round(interpol$x,0)
intensities <- interpol$y
str(spect1)
str(pos)
str(intensities)

Then, when I call:
library(R.utils)
spect2 <- insert(spect1,ats=pos,values=intensities)

I have this error:

Error in list("insert(spect1, ats = pos, values = intensities)" = 
,  :
 
[2008-02-21 13:27:49] Exception: Argument 'ats' and argument 'values' 
has different lengths: 2203 != 1
  at throw(Exception(...))
  at throw.default("Argument 'ats' and argument 'values' has different 
lengths: ", length(ats), " != ", length(values))
  at throw("Argument 'ats' and argument 'values' has different lengths: 
", length(ats), " != ", length(values))
  at insert.default(spect1, ats = pos, values = intensities)
  at insert(spect1, ats = pos, values = intensities)

You see that I still having the error, even calling the str() function 
before insert().
Here there is my sessionInfo():

R version 2.6.2 (2008-02-08)
i386-pc-mingw32

locale:
LC_COLLATE=Spanish_Spain.1252;LC_CTYPE=Spanish_Spain.1252;LC_MONETARY=Spanish_Spain.1252;LC_NUMERIC=C;LC_TIME=Spanish_Spain.1252

attached base packages:
[1] datasets  stats graphics  grDevices tcltk utils 
methods   base

other attached packages:
 [1] R.utils_0.9.8R.oo_1.4.1   R.methodsS3_1.0.0
Hmisc_3.4-3  MASS_7.2-40  scatterplot3d_0.3-25 
NMRTools_1.0.2 
 [8] svSocket_0.9-5   svIO_0.9-5   R2HTML_1.58  
svMisc_0.9-5 svIDE_0.9-5

loaded via a namespace (and not attached):
[1] cluster_1.11.9 grid_2.6.2 lattice_0.17-6 tools_2.6.2

Can you help?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126



En/na Henrik Bengtsson ha escrit:
> Hi.
>
> On Feb 20, 2008 2:38 AM, Dani Valverde <[EMAIL PROTECTED]> wrote:
>   
>> 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)
>> intensities <- interpol$y
>> 
>
> Please provide reproducible code that does not give an error.
>
>   
>> spect2 <- insert(spect1,ats=pos,values=intensities)
>> 
>
> Is this the famous insert() in R.utils?   Please give your
> sessionInfo() to help others see what you are using.  I repeat, please
> provide us with sessionInfo().
>
>   
>> "interpol" object is the result of interpoling the missing x values with
>> respect to spect1. "pos" object is a vector with the indexes where the
>> values are to be placed (it is the rounded values of interpol$x) and
>> "intensities" is a vector with the values to be inserted. I try to
>> insert the values of "intensities" into the positions specified by "pos"
>> in the "x" vector using the insert() functions as shown in the code I
>> paste, but I get this error:
>>
>> Error in list("insert(spect1, ats = pos, values = intensities)" =
>> ,  :
>>
>> [2008-02-20 11:36:28] Exception: Argument 'ats' and argument 'values'
>> has different lengths: 2203 != 1
>>   at throw(Exception(...))
>>   at throw.default("Argument 'ats' and argument 'values' has different
>> lengths: ", length(ats), " != ", length(values))
>>   at throw("Argument 'ats' and argument 'values' has different lengths:
>> ", length(ats), " != ", length(values))
>>   at insert.default(spect1, ats = pos, values = intensities)
>>   at insert(spect1, ats = pos, values = intensities)
>>
>> Can anyone help me on how can I solve it? I know that "pos" and
>> "intensities" have the same length, so I don't know why I get this
>> error. Any ideas will be welcome.
>> 
>
> I challenge that claim, b

Re: [R] Rd to latex

2008-02-20 Thread Dani Valverde
Hello,
I've tried with R CMD Rdeconv and it works, but, when I want to paste it 
into my main latex file, there are lots of undefined environments. I 
loaded the package Rd.sty in the latex document preface, but it does not 
seem to work. Any idea?
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 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 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> I would like to convert an Rd object to a latex file, so that I can put
> DV> it in my thesis. How can I do it? I tryed latex(), but it only works for
> DV> code...
> DV> Best,
> DV>
> DV> Dani
> DV>
>
>
>
>

__
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, reproducible code.


[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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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)
intensities <- interpol$y

spect2 <- insert(spect1,ats=pos,values=intensities)

"interpol" object is the result of interpoling the missing x values with 
respect to spect1. "pos" object is a vector with the indexes where the 
values are to be placed (it is the rounded values of interpol$x) and 
"intensities" is a vector with the values to be inserted. I try to 
insert the values of "intensities" into the positions specified by "pos" 
in the "x" vector using the insert() functions as shown in the code I 
paste, but I get this error:

Error in list("insert(spect1, ats = pos, values = intensities)" = 
,  :
 
[2008-02-20 11:36:28] Exception: Argument 'ats' and argument 'values' 
has different lengths: 2203 != 1
  at throw(Exception(...))
  at throw.default("Argument 'ats' and argument 'values' has different 
lengths: ", length(ats), " != ", length(values))
  at throw("Argument 'ats' and argument 'values' has different lengths: 
", length(ats), " != ", length(values))
  at insert.default(spect1, ats = pos, values = intensities)
  at insert(spect1, ats = pos, values = intensities)

Can anyone help me on how can I solve it? I know that "pos" and 
"intensities" have the same length, so I don't know why I get this 
error. Any ideas will be welcome.
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


Re: [R] Interpolation between 2 vectors

2008-02-20 Thread Dani Valverde
Hello,
I tried the approx() and it worked. Now, I have a list named "interpol" 
resulting from the interpolation. I would like to append the values in 
interpol$y in the position specified by interpol$x in a existing vector 
"spect1". I tried with append() and the following code:

spect1 <- c(1:10909)
for(i in 1:length(interpol$x)){
append(spect1,interpol$y[i],interpol$x[i])
}

but it didn't work. Any idea?
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 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 Cerdanyola del Vallès- 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 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 Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
>> +34 93 5814126
>>
>> __
>> 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, reproducible code.
>>
>> 
>
>
>
>

__
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, reproducible code.


[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 Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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


//

-- 
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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,
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 
not in lda.bootstrap.r. The problem is that everything appears in both 
files. Maybe I misundestand the error message. Any idea?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126




-- 
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 
not in lda.bootstrap.r. The problem is that everything appears in both 
files. Maybe I misundestand the error message. Any idea?
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 Biologia Molecular de Llevats
Facultat de Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 install it it gives me an error, it tries to install something 
like R.css and tells me that cannot open the DESCRIPTION file. Then, I 
made the same procedure with version 2.5.1 and it worked fine. I am 
using Windows Vista and I changed the PATH environment variable to 
version 2.6.1. Any suggestion to solve the problem?
Best regards,

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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


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 
not want to write breaks=c(4,8,12,...,13108, +Inf), but some expresion 
to avoid writing such a long argument.
Best regards,

Dani

En/na Petr PIKAL ha escrit:
> Hi
>
> you shall be more specific. Do you want to split your vector according 
> some pionts
>
> split(x, findInterval(x, c(6,12,16)))
>
> if you want to make a factor from your x vector, then you can use 
> findInterval or cut
>
> cut(x, breaks = c(0,6,12,17, +Inf))
>
> Or something else?
> Regards
>
> Petr
> [EMAIL PROTECTED]
>
> [EMAIL PROTECTED] napsal dne 22.11.2007 12:52:38:
>
>   
>> 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 Biologia Molecular de Llevats
>> Facultat de Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
>> +34 93 5814126
>>
>> __
>> 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, reproducible code.
>> 
>
>
>   


-- 
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 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.


[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 Biologia Molecular de Llevats
Facultat de Veterinària de la Universitat Autònoma 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 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
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, reproducible code.