[R] I have a problem with R!!

2011-08-20 Thread nferreri
Dear all

i´m working with a program i´ve made in R (using functions that others
created)

to run my program i need a sample. if i generate the sample using  for
example, rnorm(n, mu, sigma) i have no problem

but if i obtain a sample from a column in excel and i copy it, the program
says that there is a mistake: it says Error en `[.data.frame`(data,
indices) : undefined columns selected

my program is:

d- read.delim(clipboard, header = T, dec = ,)
#Para determinar los valores de las componentes del vector de capacidad es
necesario definir primero las especificaciones y el valor objetivo, T, así
como el máximo valor admitido para la proporción de producción no
conforme, a cada lado de los límites de especificaciones#
# Ingrese ahora el valor del límite inferior de especificaciones#
LIE - 13
# Ingrese ahora el valor del límite superior de especificaciones#
LSE - 17
# Ingrese ahora el valor objetivo#
T - 14.5
# Ingrese ahora el máximo valor admitido para la proporción de producción
no conforme a cada lado de los límites de especificaciones#
MA- 0.00135
D- min ((LSE-T), (T-LIE))
compo1 - function(data, indices)
{
d- data[indices]
n = length (d)
desvio - sd(d)
y- rep(1:n)
y[x = mean(d)] - 1
y[x mean(d)] - 0
RI1- D/(3*desvio*2*mean(y))
RI2 - D/(3*desvio*2*(1-mean(y)))
return (min (RI1, RI2))
}
compo2- function(data, indices)
{
d - data[indices]
c2 - (abs(mean(d) - T))/D
return (1-c2)
}
compo3-function(data, indices)
{
d- data[indices]
n- length (d)
y- rep(1:n)
y[d  LIE] - 1
y[d = LIE] - 0
INFE - mean (y);
y- rep(1:n)
y[d  LSE] - 1
y[d = LSE] - 0
SUPE- mean (y);
PPI - (1 - INFE)/(1-MA)
PPS - (1 - SUPE)/(1-MA)
return (min (PPI, PPS))
}
save(file = compo1.RData)
save(file = compo2.RData)
save(file = compo3.RData)
compos- function(data, indices)
{
d - data[indices]
capacidad - c(compo1(d), compo2(d), compo3(d))
return(capacidad)
}
save(file = compos.RData)
require (boot)
vectorcapacidad - boot (d, compos, R = 3000)

ETC. ETC.



WHEN I START MY PROGRAM WRITING:
d- rnorm (n, mu, sigma)

I HAVE NO PROBLEM. BUT WHEN I READ A VECTOR FROM EXCEL, R TELLS ME
Error en `[.data.frame`(data, indices) : undefined columns selected


CAN YOU HELP ME THANK YOU VERY MUCH!

NOEMI FERRERI, ROSARIO, ARGENTINA
SCHOOL OF INDUSTRIAL ENGINEERING

__
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] asking about contour plot with R

2011-04-08 Thread nferreri

I'm working in Rosario, Argentina, trying to plot some contours.

I found the function draw.contour created by James Forester at
R-bloggers. If you take a look at that function you'll see it's very
useful!

But I have a problem with it and James is trying to help me (but also
asked me to seek for more help) I hope you can help me (don't worry if you
can't):

Using draw.contour I get the contour but I want to place it in a
cartesian-coordinate system where x = Componente 1 range between -1 y 1
and y = Componente 2 range between 0 and 3, regardless of xrange or
yrange.

Of course, xrange and yrange are important to obtain an adequate contour
plot but I want to see that contour in the cartesian coordinate system I
told you before.

so I put ylim = c(0,3) and xlim = c(-1,1) but R ignores those sentences
and gives me a graphic using xrange and yrange as limits

can anyone help me? I hope you can understand my problem (and my poor
english!!!). if you don't, tell me and i'll send you more information

thank you very much!!!

noemí ferreri

__
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.