[R] boxplot will remember the factor levels

2007-08-30 Thread Luis Ridao Cruz
R-help, I'm trying to do a simple box-and-whisker plot to some data. The data are a subset of a large data frame but when running the boxplot function on the subset data all the factors are still present in the graph leaving a huge empty space until the actuals factors are shown. This produces a

[R] Find out the workspace name

2007-08-08 Thread Luis Ridao Cruz
R-help, Sometimes there might be several R sessions open at the same time. In Windows no name appears in the R main bar (just R Console) Is it possible to know the name of the workspace. I ussually write it on the script I am working on but I wish to know without having to search in a text file.

[R] R and excell differences in calculation F distributionfunction

2007-08-07 Thread Luis Ridao Cruz
case are substantial. Can anyone give me a hint on this? Thanks in advance Luis Ridao Cruz Faroese Fisheries Laboratory Nóatún 1, P.O. Box 3051 FR-110 Tórshavn Faroe Islands Tel : (+298) 353900, Tel (direct) : (+298) 353912

[R] test the significances of two regression lines

2007-08-06 Thread Luis Ridao Cruz
R-help, I'm trying to test the significance of two regression lines , i.e. the significance of the slopes from two samples originated from the same population. Is it correct if I fit a liner model for each sample and then test the slope signicance with 'anova'. Something like this: lm1 - lm(Y~

[R] 'font' argument in text function unevaluated

2007-08-03 Thread Luis Ridao Cruz
R-help, I have a plot in which I use the following: text(1 , 2, expression(61*degree ~ paste(N)), font = 2) but the expression(61*degree ~ paste(N)) will not come out in font = 2. However cex=2 will work. What is the problem? Thanks in advance. version _

[R] reading and storing files in the workspace

2007-07-31 Thread Luis Ridao Cruz
R-help, I have a vector containing (test) some file names. The files contents are matrixes. test [1] aaOki.txtaOki.txt bOki.txt c1Oki.txt c2Oki.txtc3Oki.txtcOki.txt dOki.txt dyp100.txt dyp200.txt [11] dyp300.txt dyp400.txt dyp500.txt dyp600.txt

[R] exporting character vector to text files

2007-07-27 Thread Luis Ridao Cruz
R-help, I have a character vector whose elements are the names of matrixes. Something like this: test - ls(pattern=Oki) [1] aaOkiaOki bOki c1Okic2Okic3Oki cOki dOki eOki fOki gprsOki hOki iOki [14] jOki kOki lOki mOki

[R] gam parameter predictions --Sorry for double posting

2007-03-27 Thread Luis Ridao Cruz
R-help, Sorry for posting again the same question (dated 26-03-2007) but all my mails have been sent to the recycle bin without possibility of recovering and thus I don't know if anyone has answer my query. Here is the original message: I'm applying a gam model (package mgcv) to predict

[R] impose points on lattice plot

2007-03-27 Thread Luis Ridao Cruz
R-help, I'm using the lattice package to plot 2 variables (vekt ~ aldur) conditioned to a third (kyn * 2 categories). I use the following: xyplot(vekt ~ aldur|kyn, , data = sexSu) I want to superimpose the average(vekt) by 'aldur' conditioned to kyn by using something like:

[R] gam parameter predictions

2007-03-26 Thread Luis Ridao Cruz
R-help, I'm applying a gam model (package mgcv) to predict relative abundances of a fish species. The covariates are year, month, vessel and statistical rectangle. The model looks like this: g1 - gam(log(cpue) ~ s(rekt1) + s(year) + s(mon) + s(reg1), data = dataTest) Once the model is

[R] for loop in assigning column names

2007-03-21 Thread Luis Ridao Cruz
R-help, I have a data frame (df) and I want to add some columns whose names should correspond to the i index in the loop below. for(i in 1:10) { df$eval(paste(St, as.character(i), sep = )) - ObJeCt[i] } An error message comes out : Error: attempt to apply non-function How can I get

[R] gsub

2006-11-15 Thread Luis Ridao Cruz
R-help, I want to remove the following strings cpue and nogd string - c(upsanogd ,toskanogd , hysunogd , konganogd ,gullaksnogd , longunogd , blalongunogd , brosmunogd) I could use first : first - gsub(cpue , , string) and then : second - gsub(nogd , , first) Can it be done at

[R] Discriminant Analysis- Apparent error rate

2006-11-09 Thread Luis Ridao Cruz
R-help, I'm trying to evaluate the misclasification rate of an estimated discrimated function (hyDA) hyDA - with(hyB, lda(Maturity ~ Length + Weight)) , so here is what I do (code from S-plus 6.1 Guide to Statistics Vol. 2 p 101) test - predict(hyDA) tbl - table(hyB$Maturity, test$class)

[R] read file problem

2006-11-03 Thread Luis Ridao Cruz
R-help, I have the following file I want to import to R (some lines removed) Calibrated CTD data for station:00280001 Calibrated:23/8 2001, Salinity Unsmoothed, Fluorescence Uncalibrated Maximum observed depth:36 m QUAL has one digit for each of

[R] get the parameter estimates from lm model

2006-04-18 Thread Luis Ridao Cruz
R-help, Sorry for posting the same question (almost) once again. I'm using a lm model for some data. The code is below: fitData - glm(pm ~ age + mw , family = binomial(link = logit), maxit = 30, data = inputModel1) age is a factor and mw is a continous variable. The summary function does not

[R] get the parameter estimates from lm model - was glm

2006-04-18 Thread Luis Ridao Cruz
R-help, Sorry for the mistake in my previous message. I have written lm but in the function call is glm. Everything should be glm. Sorry for the inconvenience. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] summary(lm) * lack of a parameter estimate

2006-04-11 Thread Luis Ridao Cruz
R-help, I'm using a lm model for some data. The code is below: fitData - lm(formula = log(f1) ~ year + mon + pair + rek, weights = w, data = data) I want to get the fitted values of log(f1) for every year so I do: tapply(fitted(fitData), list(data96$year), mean) but there is no parameter

[R] does ctest package exist?

2006-03-01 Thread Luis Ridao Cruz
R-help, I was searching the R archives for information on multiple comparisons and found that ctest package may contain something useful for my study. But there seems not to be such a package on CRAN. Anything I am missing? Thanks in advance __

[R] plot(...., type = h, lwd = 10) results in square tops

2006-02-10 Thread Luis Ridao Cruz
R-help, I'm using the following code: plot(1985:2005, data, type = h, lwd = 10) which should plot histogram like figure. The bar tops are square and I was wondering if it is intended to be so or not (I can of course use barplot instead). Thanks __

[R] match and %in%

2005-11-10 Thread Luis Ridao Cruz
R-help, I have two data frames with a commom column (but with different size) What I want is to get a column (say df1$mycolumn ) according to the matches of common columns in both data frames. I have tried this but it is not working: transform(fb, breidd = ifelse (match

[R] paste argument of a function as a file name

2005-11-10 Thread Luis Ridao Cruz
R-help, I have a function which is exporting the output to a file via write.table(df, file = file name.xls ) What I want is to paste the file name (above) by taking the argument to the function as a file name something like this: MY.function- function(df) { ... ...

[R] String manipulation

2005-10-20 Thread Luis Ridao Cruz
R-help, I have a data frame which contains a character string column that is something like; II11 II18 II23 III1 III13 III16 III19 III2 III7 IV10 IV11 IV12 IX16 IX4 V12 V18 V2 V20 V23 V4 VII14 VII18 VII21 VII26 VII28 VII33 VII4 VII48 VII5 I want to apply a function (e.g mean) by

[R] apply and plot

2005-10-13 Thread Luis Ridao Cruz
R-help, I use the code below to plot some data by applying apply function. But I don't know how I can get the argument type or col on the plot function to distinguish the different lines in the graph: apply ( my.data, 2, function ( x ) lines ( dimnames ( my.data ) [[1]] , x ) ) Thank you in

Re: [R] How to erase objects

2005-09-13 Thread Luis Ridao Cruz
?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would

[R] Different y-axis limits in lattice panels

2005-06-01 Thread Luis Ridao Cruz
R-help, I want to keep the original y-axis limits in panels when drawing lattice plots. My data contain some few large values making dificult to see any patterns/trends in different plots. What I want to do is to keep the original scale (y-axis) in every single panel. I have searched in the

[R] R-help,

2005-05-19 Thread Luis Ridao Cruz
R-help, I usually call lapply to plot some dat frames structures.Something like this: par(mfrow=c(4,3),mar=c(2, 4, 2, 1) + 0.1) lapply(my.list , function(x) { plot(colnames(x) , apply(x,2,mean), type=o, pch = 16, ylab = Index , xlab = ) } ) But it is difficult for me to put a title on every

[R] not plotting when non-existent

2005-04-12 Thread Luis Ridao Cruz
R-help, I'm trying to plot the following: year lgd 1 1986 136.97479 2 1987 69.10377 3 1988 67.66744 4 1989 71.60316 5 1990 62.06897 6 1992 6.25000 7 1993 27.72021 8 1995 23.83648 9 1996 10.29412 10 1997 95.67487 11 1998 82.09367 12 1999 56.60401 13 2000 29.80864

[R] Introduce a new function in a package?

2005-04-06 Thread Luis Ridao Cruz
R-help, Sometimes I define functions I wish to have in any R session. The obvious thing to do is copy-paste the code The thing is that sometimes I don't know where I have the function code. My question is if somehow I could define a function and introduce it (let's say 'base' package ) so that

[R] Remove save workspace image? window when exit R

2005-03-21 Thread Luis Ridao Cruz
R-help, I wish to remove the message at the end of a session save workspace image? . By googling I found no answer . Thanks in advance I run on Windows XP version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32

[R] Note: The default device has been opened to honour attempt to modify trellis settings

2005-03-16 Thread Luis Ridao Cruz
R-help, I'm using a function whose end result is a trellis plot. When I call the function I get sometimes the following message: Note: The default device has been opened to honour attempt to modify trellis settings leading up to any plot whatsoever. I call the package 'lattice' within the

[R] 'pch' plot symbol with more than one character

2005-03-14 Thread Luis Ridao Cruz
R-help, Argument 'pch' in 'plot' can only represent a single character. Is it possible to represent, let's say, two instead? Thanks in advance. I'm running on Windows Xp version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386,

[R] lattice -- panel order display

2005-03-01 Thread Luis Ridao Cruz
R-help, I'm using 'xyplot' in lattice package which plots length frecuencies by year (10). The order I get is not logical and the 'index.cond' argument to 'xyplot' is a bit cumbersome when it comes to plot a great deal of (in my case years). I have tried sorting the conditioning variable but

Re: [R] lattice -- panel order display

2005-03-01 Thread Luis Ridao Cruz
2003 39 4 390 2003 40 26 391 2003 41 25 392 2003 42 41 393 2003 43 59 438 2004 35 4 439 2004 36 3 440 2004 37 4 441 2004 38 18 442 2004 39 24 443 2004 40 50 Uwe Ligges [EMAIL PROTECTED] 01/03/2005 15:40:15 Luis Ridao Cruz wrote: R-help, I'm using

Re: [R] lattice -- panel order display

2005-03-01 Thread Luis Ridao Cruz
I do the following: test$year - factor (test$year , ordered = TRUE) xyplot ( number~cm | year, data = test , type = l ) and still get the same. Luis Sundar Dorai-Raj [EMAIL PROTECTED] 01/03/2005 16:04:34 Luis Ridao Cruz allegedly said on 3/1/2005 8:50 AM: R-help, I'm using 'xyplot

[R] filling columns in frame according to another column frame

2005-02-23 Thread Luis Ridao Cruz
R-help, I have a frame which I want to fill up conditioning to another data frame column. The one I want to fill up is as follows (basically an empty one): test2 cm 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Re: [R] filling columns in frame according to another column frame

2005-02-23 Thread Luis Ridao Cruz
# values that will be used to impute the zero's in a b[w] [1] 7 5 8 6 # impute the values of a with b where a is zero a[w] - b[w] # the result a [,1] [,2] [,3] [1,]111 [2,]156 [3,]781 Regards, Adai On Wed, 2005-02-23 at 14:14 +, Luis Ridao Cruz

[R] R-help

2005-02-22 Thread Luis Ridao Cruz
R-help, I am tring to create a plot with two y-axis. I found an example which is fine but the problem is that the range of the second y-axes appears in the first y-axes causing confusion. The example I refer to is : ## dev.off() ## start with a new graphics

[R] Lattice --reference line in panels does not come up

2005-02-16 Thread Luis Ridao Cruz
R-help, I am quite new to lattice. I am plotting something in which I want some reference lines. I do the foolowing : library ( lattice ) reference.line - trellis.par.get ( reference.line ) reference.line$lty - 2## not working with any of the reference.line components # reference.line$col -

Re: [R] Lattice --reference line in panels does not come up

2005-02-16 Thread Luis Ridao Cruz
Thank you Uwe, It worked ! Luis Uwe Ligges [EMAIL PROTECTED] 16/02/2005 13:21:27 Luis Ridao Cruz wrote: R-help, I am quite new to lattice. I am plotting something in which I want some reference lines. I do the foolowing : library ( lattice ) reference.line - trellis.par.get

[R] Double sort a data frame

2005-02-11 Thread Luis Ridao Cruz
R-help, Long ago I asked how to sort a data frame according to one of the columns. But Iwas wondering ho I could double sort , i.e, sort according to one column and another one afterwards. It is quite easy in Excel but I am unable to implemented in R. I have searched in the R help archives and

RE: [R] Double sort a data frame

2005-02-11 Thread Luis Ridao Cruz
You are right Andy, I just found on the archives soon after I tried searching for a second time. Sorry Luis Liaw, Andy [EMAIL PROTECTED] 11/02/2005 13:15:16 From: Luis Ridao Cruz R-help, Long ago I asked how to sort a data frame according to one of the columns. But Iwas wondering ho