[R] help:Vector vs array

2009-08-05 Thread chalie epps
Greetings R-help community, I am relatively new to R, which may be why I am having trouble understanding this problem. I want to know the differences between vector and array. could someone tell me something about this question. Thanks in advance, __

Re: [R] array slice notation?

2009-08-05 Thread Søren Højsgaard
Hi, 1) I think vector subscripting is faster than the solution below. 2) I don't understand the question, but it may be an idea to look at ?tableSlice and ?tableMargin in the gRbase package. Regards Søren Fra: r-help-boun...@r-project.org

Re: [R] labeling in qplot

2009-08-05 Thread Nikos Alexandris
On Tue, 2009-08-04 at 20:16 -0700, Mohan S wrote: HI am plotting different density plots in one graph each with a different color. And i want to add labels to plot mentioning which color belongs to which data series. p2 - qplot(corArms, data = data1, geom = density, adjust=0.4,

[R] feature weighting in randomForest

2009-08-05 Thread Häring, Tim (LWF)
Hello ! I´m using randomForest for classifacation problems. My dataset has 21.000 observations and 96 predictors. I know that some predictors of my dataset have more influence to classify my data than others. Therefore I would like to know if there is a way to weight my predictors. I know that

Re: [R] labeling in qplot

2009-08-05 Thread ONKELINX, Thierry
Dear Mo, This is rather easy. Add an ID to each data series, rbind them into one data.frame and use the colour argument of qplot. data1 - data.frame(corArms = rnorm(1000)) data2 - data.frame(corArms = rnorm(3000, sd = 0.5)) data3 - data.frame(corArms = rnorm(2000, sd = 2)) data1$ID - Data 1

Re: [R] lme funcion in R

2009-08-05 Thread ONKELINX, Thierry
Harry, I you use dummy variables, then you can only use (n-1) dummy variables if your variable has n levels. Otherwise you introduce multicollinearity! If you use n dummy variable then you can express one dummy variable as a linear combination of the others. Make use of a factor variable. That

[R] Austria, September, 2009: Statistical Learning and Data Mining Course

2009-08-05 Thread Trevor Hastie
Short course: Statistical Learning and Data Mining III: Ten Hot Ideas for Learning from Data Trevor Hastie and Robert Tibshirani, Stanford University Danube University Krems, Austria 25-26 September 2009 This two-day course gives a detailed overview of statistical models for data mining,

Re: [R] read.csv from a remote machine

2009-08-05 Thread Olga Lyashevska
Thanks for your suggestions Mark, On 04.08.2009, at 19:16, Mark Wardle wrote: Alternatively, can't you copy the data to the Linux box using sftp first? This is perhaps the easiest option. I have established sftp connection. Now I simply add all files I need to use. So the problem is

[R] S4 method dispatch: coercion of arguments with setAs defined

2009-08-05 Thread Renaud Gaujoux
Hi list, I've got a class B that contains a slot obj of class A. I'd like to be able to call all the methods of class A directly on objects of class B as if I had called the method on slot obj. This without overloading all methods of class A to work on class B. I don't define B as an

[R] Double cross validation and prediction error

2009-08-05 Thread linda garcia
Dear all, I want to do double cross validation for example for Ridge regression/ lasso . One round of cross validation for optimising the parameter (lambda) and another round of cross validation for MSEP(Mean Square Error for Prediction). Any package which does it or some code??

[R] Decision boundaries for lda function?

2009-08-05 Thread Thomas Larsen
Hi, I am using the lda function from the MASS library. I would to find the decision boundaries of each class and subsequently plot them. I wonder if anybody can offer any help on this topic? Below I applied the lda function on a small dataset of mine. Any help will be much appreciated.

Re: [R] Stacked plots with common x-axis and different y-axis

2009-08-05 Thread Jim Lemon
Jason Rupert wrote: Is there a place that shows how to create two plots that are stacked on top of each other where they share a common x-axis scale, but have differnt y-axis scale? Say have the following data: airquality Stack plot(airquality$Day, airquality$Wind) on top of

[R] regarding Rglpk loading

2009-08-05 Thread Baidya Nath Mandal
Hi everybody, I installed Rglpk package from local zip files. Then I tried to load the package in a R session. But R shows following message. Loading required package: slam Error: package 'slam' could not be loaded In addition: Warning message: In library(pkg, character.only = TRUE,

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread hannesPretorius
When I read the entire text file in I get the following message x - read.table('c:/small.txt', sep='\t', header=TRUE) Warning message: number of items read is not a multiple of the number of columns. thanks. hannesPretorius wrote: Ok i feel pretty stupid.. been trying to read a text

[R] overlap two graph

2009-08-05 Thread Hemavathi Ramulu
Hi everyone,I need you all help. I want to create few image in same diagram. For example, I wan draw two ellipse in same diagram. plot(ellipsePoints(2,5, alpha = 60), asp=1) and plot(ellipsePoints(2,5, alpha = 30), asp=1) How to display both ellipse together? both is different in angle. Thank

[R] missing value in Elastic Net

2009-08-05 Thread ram basnet
Dear R users,    Does Elasticnet (package elasticnet) handle the missing value in predictors ? If some one can provide the way to hadle missing value, it will great. Thanks in advance.   Sincerely, Ram Kumar Basnet Wageningen University, The Netherlands   [[alternative HTML

[R] acf Significance

2009-08-05 Thread Steve Jones
Hi List, I'm trying to calculate the autocorrelation coefficients for a time series using acf at various lags. This is working well, and I can get the coefficients without any trouble. However, I don't seem to be able to obtain the significance of these coefficients from the returned acf object,

Re: [R] Counting things

2009-08-05 Thread Gabor Grothendieck
Try this using built in data frame iris: length(subset(iris, Sepal.Length = 7, Sepal.Width)[[1]]) [1] 13 length(subset(iris, Sepal.Length = 7 Species == 'virginica', Sepal.Width)[[1]]) [1] 12 # or the following (note that dot in Sepal.Length is automatically # converted to _ because dot

Re: [R] fitted.values less than observed values

2009-08-05 Thread Gavin Simpson
On Tue, 2009-08-04 at 18:37 +0100, Federico Calboli wrote: On 4 Aug 2009, at 18:27, David Winsemius wrote: Your first posting made me think that you were complaining that the fitted values were less than the raw values. Your second posting makes me think that you may be conflating the

[R] Durbin-Watson

2009-08-05 Thread Hardi
Hi, I ran an experiment with 3 factors, 2 levels and 200 replications and as I want to test for residuals independence, I used Durbin-Watson in R. I found two functions (durbin.watson and dwtest) and while both are giving the same rho, the p-values are greatly differ: durbin.watson(mod1) lag

Re: [R] Caculate first difference from a dataframe; write a simulation

2009-08-05 Thread Gavin Simpson
On Tue, 2009-08-04 at 23:42 +0530, Meenu Sahi wrote: Dear R Users I'm writing my first simulation in R. I've put across my problems with a smaller example in the attachment along with the questions. Q1 - mydat4[, 1:2] is not a matrix! It is a data.frame. class(mydat4[, 1:2]) [1]

Re: [R] Build a dataframe row by row?

2009-08-05 Thread Gavin Simpson
On Wed, 2009-08-05 at 10:28 +1000, Remko Duursma wrote: Nice, but I need a few columns for the data. Don't know how to do this with the method you suggest. For each iteration, you make a vector of your 'data', in the example it is a vector of length 3. Each of the elements in this vector

Re: [R] Durbin-Watson

2009-08-05 Thread Achim Zeileis
On Wed, 5 Aug 2009, Hardi wrote: Hi, I ran an experiment with 3 factors, 2 levels and 200 replications and as I want to test for residuals independence, I used Durbin-Watson in R. I found two functions (durbin.watson and dwtest) and while both are giving the same rho, the p-values are

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread Mark Difford
Hannes, When I read the entire text file in I get the following message Then you have not followed the very simple instructions I gave you above, which I repeat below. Or you have changed small.txt. ## TDat - read.csv(small.txt, sep=\t) TDat str(TDat) Mark. hannesPretorius wrote: When

Re: [R] stepwise

2009-08-05 Thread David Winsemius
It's a bit of a puzzle to me that this has remained unanswered for 7 hours. Perhaps the readers who know the answers are reluctant to offer them because they have such low opinions of stepwise strategies but do not want to express such negativity. Or perhaps they thought that an

Re: [R] R Excel

2009-08-05 Thread spencerg
Have you looked at Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's not yet available. However, the Springer booth at the Joint Statistical Meetings was

Re: [R] RE xcel Macro Mode

2009-08-05 Thread spencerg
Have you looked at RExcel and the RExcelInstaller package? There is now a companion book: Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's not yet

Re: [R] regarding Rglpk loading

2009-08-05 Thread David Winsemius
On Aug 5, 2009, at 3:32 AM, Baidya Nath Mandal wrote: Hi everybody, I installed Rglpk package from local zip files. What files? What system? How installed? Then I tried to load the package in a R session. But R shows following message. Perhaps you did not install the dependencies?

[R] Lattice: change background of conditioning variable box

2009-08-05 Thread Alex van der Spek
For publication purposes I need to come up with BW images (grey codes allowed). For normal R graphics this presents no problem. For lattice graphics, I can get everything BW except for the box in which the conditioning variables are written per panel. I have searched the manuals but to no avail.

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread David Winsemius
What do you get with: count.fields(c:/small.txt', sep='\t', header=TRUE) On Aug 5, 2009, at 5:09 AM, hannesPretorius wrote: When I read the entire text file in I get the following message x - read.table('c:/small.txt', sep='\t', header=TRUE) Warning message: number of items read is not a

Re: [R] RE xcel Macro Mode

2009-08-05 Thread Tobias Verbeke
spencerg wrote: Have you looked at RExcel and the RExcelInstaller package? There is now a companion book: Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread Jason Rupert
You can also try: readLines(...) This seems to be able to read in difficult txt files. Good luck. --- On Wed, 8/5/09, hannesPretorius talk2han...@gmail.com wrote: From: hannesPretorius talk2han...@gmail.com Subject: Re: [R] i'm so stuck with text file and contour plot To:

[R] Scientific Format E

2009-08-05 Thread Wittmer, Irene
Dear Helpers, I would like to export a large dataset to a txt file in order to use it in an other programm. Unfurtunatly the R the scientific format is a small e: 2 e-1 while the other programm requires the format to be a capital E: 2E-1 How can I change this in R? Thanks for your help

Re: [R] problem with pattern matching

2009-08-05 Thread Rnewbie
I wanted to extract my interested rows from a dataframe. I used: grep(list$ID, dataframe$ID, value=T) #list contains a list of my interested IDs I got one match in return, which is the very first ID in list. It seems the matching process just stopped, once the first match was found. David

Re: [R] Generating and naming multiple time series

2009-08-05 Thread jim holtman
Here is one way: # use 'lapply' to generate your list of 'sets' sets - lapply(1:100, function(x){ # create your set of data runif(100) # test data }) # put into matrix for 'matplot' # generates a very busy plot with 100 sets of data sets.m - do.call(cbind, sets) matplot(sets.m, type='l')

Re: [R] help:Vector vs array

2009-08-05 Thread jim holtman
Intro to R should tell you. A vector is basically a one-dimensional object (addressed x[i]) and an array has multiple dimensions (addressed x.array[i,j,k]). What confusion do you have? Think of a 2-dimensional array as a matrix or an Excel worksheet. On Wed, Aug 5, 2009 at 12:42 AM, chalie

Re: [R] Scientific Format E

2009-08-05 Thread Henrique Dallazuanna
You can try this: toupper(format(0.2, scientific = TRUE)) On Wed, Aug 5, 2009 at 9:05 AM, Wittmer, Irene irene.witt...@eawag.chwrote: Dear Helpers, I would like to export a large dataset to a txt file in order to use it in an other programm. Unfurtunatly the R the scientific format is a

Re: [R] Scientific Format E

2009-08-05 Thread jim holtman
Use 'sprintf' to format your data before writing out: sprintf(%G, runif(10,1e6, 1e10)) [1] 3.67382E+09 9.47111E+09 1.02591E+09 5.368E+09 8.17346E+08 2.89006E+09 6.62398E+09 1.29721E+09 9.99348E+09 [10] 6.73539E+09 On Wed, Aug 5, 2009 at 8:05 AM, Wittmer, Ireneirene.witt...@eawag.ch wrote:

Re: [R] problem with pattern matching

2009-08-05 Thread jim holtman
I think you want to use either 'match' or '%in%' x - dataframe$ID %in% list$ID # TRUE if it is in list On Wed, Aug 5, 2009 at 5:36 AM, Rnewbiexua...@yahoo.com wrote: I wanted to extract my interested rows from a dataframe. I used: grep(list$ID, dataframe$ID, value=T) #list contains a list

Re: [R] Scientific Format E

2009-08-05 Thread Henrique Dallazuanna
Another options is: sprintf(%.0E, 0.2) On Wed, Aug 5, 2009 at 9:18 AM, Henrique Dallazuanna www...@gmail.comwrote: You can try this: toupper(format(0.2, scientific = TRUE)) On Wed, Aug 5, 2009 at 9:05 AM, Wittmer, Irene irene.witt...@eawag.chwrote: Dear Helpers, I would like to export

Re: [R] Caculate first difference from a dataframe; write a simulation

2009-08-05 Thread David Winsemius
On Aug 4, 2009, at 2:12 PM, Meenu Sahi wrote: Dear R Users I'm writing my first simulation in R. I've put across my problems with a smaller example in the attachment along with the questions. Please help. See Simpson reply to Q1 ##Question2: How can I easily identify which out of the 9

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread Tal Galili
Hi Hannes, From my experience, this error usually happens when you've got spaces in the header row, in the column names. An easy solution would be to open the file in excel, then run search-and-replace on the header row for all spaces and replace them with a hyphen -. Hope it helped (please let

Re: [R] min frequencies of categorical predictor variables in GLM

2009-08-05 Thread Marc Schwartz
On Aug 5, 2009, at 12:51 AM, Thomas Mang wrote: Marc Schwartz wrote: On Aug 3, 2009, at 12:06 AM, Thomas Mang wrote: Hi, Suppose a binomial GLM with both continuous as well as categorical predictors (sometimes referred to as GLM-ANCOVA, if I remember correctly). For the categorical

Re: [R] i'm so stuck with text file and contour plot

2009-08-05 Thread David Winsemius
Doubtful. The OP did have spaces in his header. but by specifying that only tabs should be used as delimiters the default parameters to both read.table and read.csv would have converted the spaces to periods. See: read.table(file=http://www.nabble.com/file/p24777697/small.txt;, sep=\t,

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
Just replying to bring back some attention on my post, which might have slept through on Saturday. Thank you for your help. - Mail Original - De: pomc...@free.fr À: r-h...@stat.math.ethz.ch Envoyé: Samedi 1 Août 2009 15h48:24 GMT -05:00 USA/Canada - États de l'Est Objet: Transparency

Re: [R] overlap two graph

2009-08-05 Thread Scott Sherrill-Mix
Did you try already try: plot(ellipsePoints(2,5, alpha = 30), asp=1) points(ellipsePoints(2,5, alpha = 60), asp=1,col='red') ? Scott Scott Sherrill-Mix Department of Microbiology University of Pennsylvania 402B Johnson Pavilion 3610 Hamilton Walk Philadelphia, PA 19104-6076 On Wed, Aug

Re: [R] Standard deviation for rows

2009-08-05 Thread ferreirafm
Take a look on the package bellow. rowSds, colSds and much more. install.packages(matrixStats) -- View this message in context: http://www.nabble.com/Standard-deviation-for-rows-tp19998106p24827130.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] problem with pattern matching

2009-08-05 Thread Rnewbie
the problem in my case is that some of the cells in dataframe$ID contain multiple IDs, but in list$ID there is only one ID in each cell, so some of the IDs cannot be matched if using the fucntion 'match' or '%in%' jholtman wrote: I think you want to use either 'match' or '%in%' x -

Re: [R] Help with data type

2009-08-05 Thread Don MacQueen
Something like this should work: tmp - as.Numeric(Delta) tmp3 - tmp[ -c(1,2)] ## elements 3 through last (the i in the loop) tmp2 - tmp[ -c(1,length(tmp)) ] ## elements 2 through next to last (the i-1 in the loop) mysum - sum( tmp3[tmp3 tmp2]) ## sum of

Re: [R] Lattice: change background of conditioning variable box

2009-08-05 Thread Erik Iverson
Alex, Does changing the color argument of the default theme associated with the device to what you want? See the color argument in ?trellis.device. As an example, try the following with and without the trellis.device call... trellis.device(color = FALSE) dotplot(t(USPersonalExpenditure),

[R] [R-pkgs] parser 0.0-3 on CRAN

2009-08-05 Thread Romain Francois
Hello, The version 0.0-3 of the parser package has been published to CRAN a few days ago. The package defines a parser for R code very similar to the parse function in base but organize the information differently, in a flat data frame. There is a more complete announcement in my blog:

Re: [R] problem with pattern matching

2009-08-05 Thread Don MacQueen
Perhaps intersect() or merge() will help. But, like others, I find it difficult to understand exactly what you want. I'd suggest providing a short example with actual ID values. -Don At 2:36 AM -0700 8/5/09, Rnewbie wrote: I wanted to extract my interested rows from a dataframe. I used:

Re: [R] Lattice: change background of conditioning variable box

2009-08-05 Thread Alex van der Spek
Yes it does! Thank you Erik! I had not thought about searching under 'trellis'! Alex van der Spek On Wed, 2009-08-05 at 09:53 -0500, Erik Iverson wrote: Alex, Does changing the color argument of the default theme associated with the device to what you want? See the color argument in

[R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Michal Figurski
Hello, I have made an R script that prepares a NONMEM dataset and I would like to start the NONMEM run right after the dataset is ready. I am using windows XP, R 2.9.1 and NONMEM 6. I have prepared a run.bat file that looks like this: call

[R] for loop

2009-08-05 Thread waltzmiester
I am trying to get the function Models to work each time there is an instance of k. This code will stop after the first model is complete. I need it to come back and pass the next value of c into the Initial.State function. any ideas? col-c(23:28) #Setup for(k in col){

Re: [R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Scott Sherrill-Mix
I believe R does system calls from its current working directory (getwd() will tell you where that is). This may not be the same directory you designed your .bat for. What if you use the full path for your files in the batch file? e.g. call K:\nmvi\nmfe6 K:\nmvi\path\control.txt

[R] how import Excel data into R?

2009-08-05 Thread Inchallah Yarab
Hi I want to import Excel data into R I have used this code data-read.table(C:\Total_Art_Policies.xls,header=TRUE,sep=;) i have an error msg: Erreur dans file(file, r) : impossible d'ouvrir la connexion De plus : Warning message: In file(file, r) : impossible d'ouvrir le fichier 

Re: [R] how import Excel data into R?

2009-08-05 Thread Gabor Grothendieck
See: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On Wed, Aug 5, 2009 at 11:56 AM, Inchallah Yarabinchallahya...@yahoo.fr wrote: Hi I want to import Excel data into R I have used this code data-read.table(C:\Total_Art_Policies.xls,header=TRUE,sep=;) i have an error

Re: [R] how import Excel data into R?

2009-08-05 Thread Patrick Burns
I suspect that your problem is that you didn't put in a second backslash to escape the backslash in your path. ('The R Inferno' talks about backslashes if this doesn't make sense to you.) 'The R Inferno' also would have said that it was very good of you to show the actual error message, but in

[R] polygon centroids

2009-08-05 Thread Herbert Rantus
Hi Everyone, Concerning the maptools package and get.Pcent() to get polygon centroids, does somebody know how to define the number of returned decimal places? Thanks a lot in advance. Herbert -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller

[R] import data into R

2009-08-05 Thread Inchallah Yarab
Thank you Gabor Grothendieck for your answer !! i have charge the pachage but now i have this massage  read.table(c:/TOTAL.xls,h=T) [1] ÐÏ.à.. 0 rows (or 0-length row.names) Warning messages: 1: In read.table(c:/TOTAL.xls, h = T) :   incomplete final line found by readTableHeader on

Re: [R] survdiff for left-truncated data?

2009-08-05 Thread Rajen Shah
Thank you very much that's perfect. Rajen 2009/8/4 Terry Therneau thern...@mayo.edu Does anyone know if there is a function like survdiff which can also handle left-truncated and right-censored data? When I use it on left-truncated and right-censored data I get an error message saying

Re: [R] polygon centroids

2009-08-05 Thread Daniel Malter
Not knowing the package or the function. Could the round() function help you? Or do you mean decimals shown in a plot? Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org

Re: [R] import data into R

2009-08-05 Thread Ronggui Huang
You can not import xls file by read.table. You may save xls as csv file, and import it by read.csv. 2009/8/6 Inchallah Yarab inchallahya...@yahoo.fr: Thank you Gabor Grothendieck for your answer !! i have charge the pachage but now i have this massage  read.table(c:/TOTAL.xls,h=T) [1]

Re: [R] Testing year effect in lm() ***failed first time, sending again

2009-08-05 Thread Emmanuel Charpentier
Le jeudi 30 juillet 2009 à 16:41 -0600, Mark Na a écrit : Dear R-helpers, I have a linear model with a year effect (year is coded as a factor), i.e. the parameter estimates for each level of my year variable have significant P values (see some output below) and I am interested in testing:

Re: [R] for loop

2009-08-05 Thread jim holtman
What do you mean by stop? Is there an error message? What are you getting as output? I don't see you saving or printing the output from Models (whatever that is). PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] import DATA

2009-08-05 Thread Inchallah Yarab
hi !! it is me again sorry but until now i don't found  how i can import data form excel to R? i have this message error read.table(c:/TOTAL.xls) V1 1 ÐÏ\021ࡱ Warning message: In read.table(c:/TOTAL.xls) :   incomplete final line found by readTableHeader on 'c:/TOTAL.xls' thank you

Re: [R] for loop

2009-08-05 Thread Daniel Malter
Either you use for (k%in%col) or for (k in min(col):max(col)) does that work for you? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag

Re: [R] import data into R

2009-08-05 Thread Gabor Grothendieck
read.table is used for text data, not Excel data. Suggest you re-read the cited link. On Wed, Aug 5, 2009 at 12:16 PM, Inchallah Yarabinchallahya...@yahoo.fr wrote: Thank you Gabor Grothendieck for your answer !! i have charge the pachage but now i have this massage  

Re: [R] problem with pattern matching

2009-08-05 Thread xavier . chardon
Hi, I don't think grep can handle a vector of patterns. grep( c(foo1, foo2), c(fffoo5, fffoo6, fffoo2, fffoo1)) [1] 4 This call is equivalent to: grep( foo1, c(fffoo5, fffoo6, fffoo2, fffoo1) ) Maybe you could use the plyr package. I am only speculating, but something like this might work:

Re: [R] Transparency and trellis device

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, pomc...@free.fr pomc...@free.fr wrote: Just replying to bring back some attention on my post, which might have slept through on Saturday. Thank you for your help. - Mail Original - De: pomc...@free.fr À: r-h...@stat.math.ethz.ch Envoyé: Samedi 1 Août 2009 15h48:24

Re: [R] import data into R

2009-08-05 Thread Jun Shen
Alternatively, you can download and install the package gdata. The function read.xls in it can read Excel sheets directly from .xls files. Basically the function is doing the csv conversion for you. See ?read.xls for details. On Wed, Aug 5, 2009 at 11:16 AM, Inchallah Yarab

Re: [R] Testing year effect in lm() ***failed first time, sending again

2009-08-05 Thread Mark Difford
Emmanuel, somewhat incomplete help pages : what in h*ll are valid arguments to mcp() beyond Tukey ??? Curently, you'll have to dig in the source to learn that...). Not so: they are clearly stated in ?contrMat. Regards, Mark. Emmanuel Charpentier-3 wrote: Le jeudi 30 juillet 2009 à

Re: [R] problem with pattern matching

2009-08-05 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jim holtman Sent: Wednesday, August 05, 2009 5:23 AM To: Rnewbie Cc: r-help@r-project.org Subject: Re: [R] problem with pattern matching I think you want to use either

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
Hi Deepayan, Thank for you reply. I am a little bit confused now. In the one hand, the trellis.device function has lost his bg argument as explained in the Note section of ?trellis.device, but the background info provided by a theme does not seem to impact the background of the device. In the

Re: [R] Counting things

2009-08-05 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman Sent: Tuesday, August 04, 2009 8:40 PM To: r help Subject: [R] Counting things I've completed an experiment and want to summarize the results. There are two

Re: [R] Transparency and trellis device

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, pomc...@free.fr pomc...@free.fr wrote: Hi Deepayan, Thank for you reply. I am a little bit confused now. In the one hand, the trellis.device function has lost his bg argument as explained in the Note section of ?trellis.device, but the background info provided by a theme does

Re: [R] for loop

2009-08-05 Thread waltzmiester
Jim Settle down, just because you can't understand my post doesn't mean I didn't follow the guidlines. 1)The code is commented. 2)The problem in the code is succinct and therefore minimal even though it cannot be self contained, the user-defined function itself is. 3) In order for you to be

[R] multiple lty on same panel in xyplot

2009-08-05 Thread Jacob Wegelin
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types lty or colors col to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using

[R] Infix all.equal operator for vectors of unequal length

2009-08-05 Thread David Winsemius
I was trying to use all.equal inside subset() and getting errors because I was comparing vectors of unequal length (a column versus a constant). I defined an function that did not throw the same errors, but wondered if something similar (and probably better designed than my noobish

Re: [R] for loop

2009-08-05 Thread waltzmiester
The Initial.State function is the setup for Models. So Models will apply the function to k columns in Initial.State. It will only work for the first element in vector col however, and will not loop the function through all elements in vector col -C waltzmiester wrote: I am trying to get

Re: [R] Transparency and trellis device

2009-08-05 Thread pomchip
One thing that I did not mention is that my themes contain additional settings (like margin definitions). By looking at the code of trellis.device, it look like the operation of this function can be simplified a device opening followed by a trellis.par.set call. Am I correct? If so, I think I

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Jacob Wegelin
On Wed, Aug 5, 2009 at 1:30 PM, Jacob Wegelin jacob.wege...@gmail.comwrote: I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types lty or colors col to distinguish the functions (or groups). In

Re: [R] for loop

2009-08-05 Thread Daniel Malter
No, Jim is right. My answer is a shot in the blue, an attempt to guess from your writing what you (might) want to do. It is actually completely unclear from your question what you mean by pass the next value of c into Initial.State What is c anyway? There is no c in your code. That your function

Re: [R] for loop

2009-08-05 Thread Daniel Malter
and I may quote David Winsemius at this point: In general this falls into the category of a request to read my mind. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org

[R] binning results

2009-08-05 Thread Noah Silverman
Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That result is added back to the original data. So I wind up

Re: [R] for loop

2009-08-05 Thread David Winsemius
On Aug 5, 2009, at 1:22 PM, waltzmiester wrote: Jim Settle down, just because you can't understand my post doesn't mean I didn't follow the guidlines. 1)The code is commented. 2)The problem in the code is succinct and therefore minimal even though it cannot be self contained, the

[R] reading and frequency analysis of Spanish text

2009-08-05 Thread Michael Friendly
For an historical paper I'm working on, I have some Spanish plaintext, presently in the form of a Word .doc file, http://euclid.psych.yorku.ca/SCS/Gallery/images/Private/Langren/Verdadera-spanish-stripped.doc and also some ciphered text from the same original source. The ultimate goal is to

Re: [R] multiple lty on same panel in xyplot

2009-08-05 Thread Deepayan Sarkar
On 8/5/09, Jacob Wegelin jacob.wege...@gmail.com wrote: I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types lty or colors col to distinguish the functions (or groups). In traditional graphics,

Re: [R] binning results

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 2:11 PM, Noah Silverman wrote: Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That

Re: [R] for loop

2009-08-05 Thread waltzmiester
Um I still followed the guidelines... David Winsemius wrote: On Aug 5, 2009, at 1:22 PM, waltzmiester wrote: Jim Settle down, just because you can't understand my post doesn't mean I didn't follow the guidlines. 1)The code is commented. 2)The problem in the code is succinct

Re: [R] reading and frequency analysis of Spanish text

2009-08-05 Thread David Winsemius
When I open that link in OpenOffice.org Writer and then save in Text encoded format with Unicode encoding, the diacriticals (is that the correct font-ish term?) seem to remain intact wehn re-opended. When I read that file in, not with scan() but with readLines(), here is what I get for

Re: [R] binning results

2009-08-05 Thread Noah Silverman
Thanks Steve, I'm halfway there with: foo - cbind(foo, range_group=cut(foo$score, breaks=c(.9, .8, .7, .6, .5, .4, .3, .2, .1))) with(foo, tapply(score, list(range_group), mean)) This works, but I only get one of the 3 columns I need, mean(score). I'm not sure how to get the other two. It

Re: [R] Starting NONMEM (nmfe6) from R

2009-08-05 Thread Michal Figurski
Dear Scott (and all), Thanks for sharing your idea - it helped me solve the problem. The issue was actually the nmfe6.bat itself - there was plenty of references such as %dir%, %nmdir%, etc. I replaced them all with full paths. Additionally, I put all the PATH settings from NMdirectories.bat

Re: [R] for loop

2009-08-05 Thread David Winsemius
You followed only the ones you thought were important, but failed... a) to reduce the problem to a reproducible form (and gave no evidence of even trying to do so.) and failed ... b) to read the helpful reply you got from Jim, which I suspect contained the answer, and now ... c) persist in

Re: [R] for loop

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 2:36 PM, waltzmiester wrote: Um I still followed the guidelines... Focus on trying to ask a better question rather than going down this route ... Honestly, your original question is rather vague and leaves us to guess (i) what you're trying to do, and (ii) how to

[R] using ddply but preserving some of the outside data

2009-08-05 Thread Jarrett Byrnes
I have a bit of a quandy. I'm working with a data set for which I have sampled sites at a variety of dates. I want to use this data, and get a running average of the sampled values for the current and previous date. I originally thought something like ddply would be ideal for this,

Re: [R] reading and frequency analysis of Spanish text

2009-08-05 Thread Sam Thomas
I used the readDOC function in tm. After storing the document locally on a Windows pc... langren.sp.path - C:\\text\\ #store file by itself in this directory langren.corpus - (Corpus(DirSource(langren.sp.path), readerControl = list(reader

Re: [R] using ddply but preserving some of the outside data

2009-08-05 Thread David Winsemius
library(zoo) ?rollmean On Aug 5, 2009, at 3:00 PM, Jarrett Byrnes wrote: I have a bit of a quandy. I'm working with a data set for which I have sampled sites at a variety of dates. I want to use this data, and get a running average of the sampled values for the current and previous

Re: [R] for loop

2009-08-05 Thread Daniel Malter
No, you did not. To show what David, Jim, or I are talking about, consider this example: x1=rnorm(100,5,1) x2=rnorm(100,3,2) e=rnorm(100) y1=x1+e y2=2*x2+e x=data.frame(x1,x2) y=data.frame(y1,y2) results=list for(i%in%length(x)){ print(summary(lm(y[,i]~x[,i]))) } ##WHOOPS, THIS ONLY

  1   2   >