[R] Fwd: lattice key inside panel

2010-02-02 Thread Santosh
Dear R-experts.. It is a re-post, as I am not sure if I sent it to the right address... sorry if it is a duplicate... I am trying to generate barchart with legend inside each panel..where the rectangular colors indicate the values for "DN". I have not been successful in generating labels inside..

Re: [R] svm

2010-02-02 Thread Amy Hessen
Hi Steve, Could you please help me in this point?: I use SVM of R and I’m trying some datasets from UCI but when I compare the results of my program( that does not do anything more than calling SVM) with the RMSE of SVM in any other paper, I found a big gap between them. For example, th

Re: [R] odbcConnectExcel2007 connection error

2010-02-02 Thread Gabor Grothendieck
You could try the other methods listed here to see if any of then work in this case: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On Wed, Feb 3, 2010 at 12:46 AM, Liam Blanckenberg wrote: > Hi all, > > Apologies if I violate any posting etiquette - this is my first > submis

Re: [R] Error with write.table

2010-02-02 Thread Peter Ehlers
jlwoodard wrote: I was trying to save a data frame to an excel file using the following command: write.table(myData, file="myData.csv",sep=",", row.names=F) The command works for some data frames, but for other data frames, I get the following error: Error in if (inherits(X[[j]], "data.frame")

[R] odbcConnectExcel2007 connection error

2010-02-02 Thread Liam Blanckenberg
Hi all, Apologies if I violate any posting etiquette - this is my first submission to the R mailing list. I regularly use 'odbcConnectExcel2007' (from package 'RODBC') to read data from named ranges in excel workbooks into R. I recently received the following error message when attempting to set u

[R] polr for ordered multinomial response without additional variables

2010-02-02 Thread Stats Wolf
Dea all, Let's suppose I am studying a questionnaire survey and one of the questions has three ordered categorical responses (say, A, B and C). Eg result<-ordered(c(rep("A",12),rep("B",37),rep("C",6))) Assume the respondents are not grouped. The differences between the subsequent levels can be,

Re: [R] typo in contrast package's vignettes

2010-02-02 Thread David Winsemius
On Feb 3, 2010, at 12:20 AM, Peng Yu wrote: On Tue, Feb 2, 2010 at 11:14 PM, David Winsemius > wrote: On Feb 3, 2010, at 12:11 AM, Peng Yu wrote: On Tue, Feb 2, 2010 at 11:04 PM, David Winsemius > wrote: On Feb 2, 2010, at 11:42 PM, Peng Yu wrote: It seems that Eq (2) in the vignettes for

Re: [R] lattice key inside panel

2010-02-02 Thread Santosh
Dear R-experts.. I am trying to generate legend inside panels of lattice barplots.. Following is a sample dataset.. Sno DN EP Y1 Y2 11 D1 A20 19 19 21 D1 A50 8 9 31 D1 A70 3 4 42 D2 A20 22 22 52 D2 A50 13 14 62 D2 A70 6 7 73 D2 A20 23 23 83 D2 A50 12 13 9

Re: [R] typo in contrast package's vignettes

2010-02-02 Thread Peng Yu
On Tue, Feb 2, 2010 at 11:14 PM, David Winsemius wrote: > > On Feb 3, 2010, at 12:11 AM, Peng Yu wrote: > >> On Tue, Feb 2, 2010 at 11:04 PM, David Winsemius >> wrote: >>> >>> On Feb 2, 2010, at 11:42 PM, Peng Yu wrote: >>> It seems that Eq (2) in the vignettes for the 'contrast' packages is

Re: [R] typo in contrast package's vignettes

2010-02-02 Thread David Winsemius
On Feb 3, 2010, at 12:11 AM, Peng Yu wrote: On Tue, Feb 2, 2010 at 11:04 PM, David Winsemius > wrote: On Feb 2, 2010, at 11:42 PM, Peng Yu wrote: It seems that Eq (2) in the vignettes for the 'contrast' packages is not correct. That is, the numerator on the right hand side should be $c' \bet

Re: [R] typo in contrast package's vignettes

2010-02-02 Thread Peng Yu
On Tue, Feb 2, 2010 at 11:04 PM, David Winsemius wrote: > > On Feb 2, 2010, at 11:42 PM, Peng Yu wrote: > >> It seems that Eq (2) in the vignettes for the 'contrast' packages is >> not correct. That is, the numerator on the right hand side should be >> $c' \beta$ rather than $c' \lambda$, right? I

[R] contrast package tutorial

2010-02-02 Thread Peng Yu
I read the vignette of contrast package. I don't think that I understand how to use it. I made the following simpler example (contrast between '3' and '4'). Could somebody let me know what is the correct way to compute the contrast in the following example? library(contrast) a=3 n=4 A = as.v

Re: [R] How to show the definition of a S3 function?

2010-02-02 Thread David Winsemius
On Feb 3, 2010, at 12:04 AM, David Winsemius wrote: On Feb 2, 2010, at 11:59 PM, Peng Yu wrote: On Tue, Feb 2, 2010 at 10:52 PM, Jeff Laake wrote: Try methods("contrast") to see functions. Depends on class of fit. eg contrast.lm I tried the following command. How to get the definiti

Re: [R] typo in contrast package's vignettes

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 11:42 PM, Peng Yu wrote: It seems that Eq (2) in the vignettes for the 'contrast' packages is not correct. That is, the numerator on the right hand side should be $c' \beta$ rather than $c' \lambda$, right? If I'm correct, could somebody notice the author to fix it? Do it

Re: [R] How to show the definition of a S3 function?

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 11:59 PM, Peng Yu wrote: On Tue, Feb 2, 2010 at 10:52 PM, Jeff Laake wrote: Try methods("contrast") to see functions. Depends on class of fit. eg contrast.lm I tried the following command. How to get the definition of, say, contrast.lm? Just type: constrast.lm

Re: [R] What are Type II or III contrast? (contrast() in contrast package)

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 11:38 PM, Peng Yu wrote: ?contrast in the contrast package gives me the following description. However, I have no idea what Type II and III contrasts are. Could somebody explain it to me? And what does 'type' mean here? *‘type’*: set ‘type="average"’ to average the indivi

Re: [R] How to show the definition of a S3 function?

2010-02-02 Thread Peng Yu
On Tue, Feb 2, 2010 at 10:52 PM, Jeff Laake wrote: > Try methods("contrast") to see functions.  Depends on class of fit.  eg > contrast.lm I tried the following command. How to get the definition of, say, contrast.lm? > methods("contrast") [1] contrast.Design contrast.geese contrast.glscont

[R] How to show the definition of a S3 function?

2010-02-02 Thread Peng Yu
> library(contrast) > contrast function (fit, ...) UseMethod("contrast") I guess the above function is S3. Could somebody let me know how to show the function body in an R session? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] typo in contrast package's vignettes

2010-02-02 Thread Peng Yu
It seems that Eq (2) in the vignettes for the 'contrast' packages is not correct. That is, the numerator on the right hand side should be $c' \beta$ rather than $c' \lambda$, right? If I'm correct, could somebody notice the author to fix it? __ R-help@r-

[R] "read.table" and "scan" skips newlines which "count.fields" finds in Thai textfile

2010-02-02 Thread Andzsin
Hi there, I have some problems reading in a Thai text. Some of the newlines are skipped. (see the contents of my file below) R>count.fields ("my.txt", sep='\n', quote="") [1] 1 1 1 Three lines with one item each, right? R> scan("my.txt", what="", sep="\t", quote="") Read 2 items [1] "犹\x83犧癌

[R] What are Type II or III contrast? (contrast() in contrast package)

2010-02-02 Thread Peng Yu
?contrast in the contrast package gives me the following description. However, I have no idea what Type II and III contrasts are. Could somebody explain it to me? And what does 'type' mean here? *‘type’*: set ‘type="average"’ to average the individual contrasts (e.g., to obtain a Type II o

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
Don't need to convert the factors to numeric as that will happen automatically. See below. However as Rolf pointed out they will be numbered from 1-4 even though only 3 are left in the subset as all 4 levels are maintained. So the snippet below will work as long as you specify 4 possible pch

Re: [R] Update problem? Rcmdr disappears, won't re-open

2010-02-02 Thread G. Jay Kerns
Dear Brian, On Tue, Feb 2, 2010 at 4:33 PM, Liviu Andronic wrote: > On 2/2/10, briancady413 wrote: >>  I am trying unsuccessfully to open RcmdrPlugin.IPSUR from within Rcmdr, via >>  the pulldown tools menu. >>  It insists I restart Rcmdr, which I let happen, then Rcmdr doesn't restart, >>  and

[R] Color code leaves on dendrogram

2010-02-02 Thread Wade Wall
Hi all, I would like to color code the leaves on a dendrogram to reflect group membership. Does anyone know of a function to do this besides code listed at http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=79? I haven't seen anything recently to accomplish this. I basically just wan

[R] Rotating dendrograms

2010-02-02 Thread Wade Wall
Hi all, I have been looking for a method to rotate a dendrogram, but haven't found any references to a way to do this. I basically want to plot two dendrograms and rotate them so that I can compare the leaves to each other for heuristic purposes within R. Any help would be appreciated. Wade __

Re: [R] merging columns

2010-02-02 Thread Chuck White
Additional clarification: the problem only comes when you have one column selected from the original dataframe. You need to make the following modification to the original example: data.df <- data.frame(aa=c(1,1,0), cc=c(1,0,0), aab=c(0,1,0), aac=c(0,0,1), bb=c(1,0,1)) And, the following seem

[R] merging columns

2010-02-02 Thread Chuck White
Hello -- I am trying to merge columns in a dataframe based on substring matches in colnames. I would appreciate if somebody can suggest a faster/cleaner approach (eg. I would have really liked to avoid the if-else piece but rowSums does not like that). Thanks. data.df <- data.frame(aa=c(1,1,0),

Re: [R] Subset and plot

2010-02-02 Thread Dennis Murphy
Let's look at your data frame: > str(daily.sub1) 'data.frame': 9 obs. of 4 variables: $ Trial: Factor w/ 1 level "2": 1 1 1 1 1 1 1 1 1 $ Tanks: Factor w/ 3 levels "a4","c4","h4": 1 1 1 2 2 2 3 3 3 $ Day : Factor w/ 9 levels "10","11","12",..: 4 5 6 7 8 9 1 2 3 $ Wgt : Factor w/ 9 levels

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
Initial email: Here is a runable program. When I plot Day and Wgt, it graphs all the data points. All I need is daily.sub1 plotted. I also need each "Tanks" to have its own col or pch. When I run it with the line with pch, it gives me nothing. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep

[R] Creating missing children element in XML file

2010-02-02 Thread Steven Kang
Dear R users, The following are 2 root elements contained in XML file (of 1 root elements). child element (as highlighted in 2nd root element) is missing in the 1st root element. Consequently, when imported into R (via "xmlToDataFrame" function), the columns ("Section", "ProductionDate" &

Re: [R] Subset and plot

2010-02-02 Thread Rolf Turner
What did you ***expect*** or hope to get out of ``c(2,19,21)[Tanks]'' Please note that this expression makes no sense at all as it stands. You apparently want to use plotting symbols 2, 19, and 21 respectively, depending in some way upon the value in ``Tanks''. Since you have sp

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
I tried the following and still could not get it to work. I understand your logic, but cannot get this to work. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep(c("a3","a4","c4","h4"),each=3,2) Day=rep(c(1:12),2) Wgt=c(1:24) daily<-cbind(Trial, Tanks, Day, Wgt) daily daily.sub<-subset(daily, su

Re: [R] Update problem? Rcmdr disappears, won't re-open

2010-02-02 Thread John Fox
Dear Brian, R for Windows FAQ item 2.8 describes how to upgrade R. What you did seems similar to one of the suggestions there, so I'm not sure why it didn't work. You might try uninstalling R 2.10.1,

Re: [R] how to read this data file into R?

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 6:31 PM, Felipe Carrillo wrote: Convert the file into a csv file( myfile.csv), delete some of the unwanted rows before importing into R. Save the file on your working directory and then import into R: x <- read.csv("myfile.csv") # Change column names names(x) <- LETTERS[1:n

Re: [R] how to read this data file into R?

2010-02-02 Thread Felipe Carrillo
Convert the file into a csv file( myfile.csv), delete some of the unwanted rows before importing into R. Save the file on your working directory and then import into R: x <- read.csv("myfile.csv") # Change column names names(x) <- LETTERS[1:ncol(x)];x Change your column names to whatever you w

Re: [R] how to read this data file into R?

2010-02-02 Thread David Winsemius
If that is the way the data were coming in ... as an irregularly arranged matrix with , I would cut and paste into a text editor, even up the rows, paste into the OpenOffice.org spreadsheet using the fixed width option, trim out the unwanted row names and column names, and then "Save as.."

[R] how to read this data file into R?

2010-02-02 Thread song song
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.010061 -5.223624 2.010061 2.010061 1.463336 1.463336 2.010061 2.010061 [2,] 2.057502 -5.101445 2.057502 2.057502 2.057502 2.057502 2.057502 2.057502 [3,] 2.011081 -5.227745 2.011081 2.011081 2.011081 2.011081 2

Re: [R] iterative regressions, adding a new line of data each, time

2010-02-02 Thread Rolf Turner
On 3/02/2010, at 10:49 AM, Thomas Lumley wrote: > On Tue, 2 Feb 2010, Prof. John C Nash wrote: > >> Possibly of limited use to the original poster, but of interest more >> generally, there are a number of tools developed in the 70s for updating the >> matrix decompositions. There's at least on

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread sjaffe
Thanks! :-) I suppose it's obvious, but one will generally have to use a (anonymous) function to 'unpack' the data.frame into columns, unless the function already knows how to do this. I mention this because when I tested the solution on my example I got an unexpected result -- apparently weig

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
The problem is with attach. You should have seen an error that the objects are aliased. You have Tanks in your workspace and in the attached dataframe. It is using the one in your workspace which is not a factor variable. Try: c(2,19,21)[Tanks] with(daily.sub1,c(2,19,21)[Tanks]) Avoid att

Re: [R] character variables in substitute()

2010-02-02 Thread dkStevens
Well - I am impressed. Between Gabor and Dennis, I now have three for the price of one - for titles, text lines, and legends. Guys, thanks so much - I never would have gotten there without your help. This forum has already paid for itself. Regards, David -- View this message in context: http:/

[R] Error with R CMD check - Packages required but not available:

2010-02-02 Thread Reena Bansal
Hi All, Apologies in advance if this is not the right email to post this question. I successfully created my first R package myPackage1. Now I want to create another R package myPackage2 which requires functions from myPackage1. However when I try R CMD check myPackage2 I get the following error

Re: [R] iterative regressions, adding a new line of data each, time

2010-02-02 Thread Thomas Lumley
On Tue, 2 Feb 2010, Prof. John C Nash wrote: Possibly of limited use to the original poster, but of interest more generally, there are a number of tools developed in the 70s for updating the matrix decompositions. There's at least one in my 1979 book "Compact numerical methods for computers" (

Re: [R] More than on loop??

2010-02-02 Thread che
hey Jim. brilliant, very short and productive, wish that i can have such skill in the future, i will try to learn about all functions that you used. thanks very much for helping me, i really appreciate it. -- View this message in context: http://n4.nabble.com/More-than-on-loop-tp1015851p1460459

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread Steve Jaffe
Excellent! I knew there would be a clever answer using 'do.call' :-) -Original Message- From: Charles C. Berry [mailto:cbe...@tajo.ucsd.edu] Sent: Tuesday, February 02, 2010 4:25 PM To: Steve Jaffe Cc: r-help@r-project.org Subject: Re: [R] tapply for function taking of >1 argument? On Tu

Re: [R] e1071 package

2010-02-02 Thread Steve Lianoglou
Hi, On Tue, Feb 2, 2010 at 4:28 PM, Nancy Adam wrote: > > > hi all, > > I’m trying to install e1071 package to a new computer but I failed. Can any > one please tell me how I download it without installing through R? can anyone > please send it as an attachment please? How did you try to insta

Re: [R] e1071 package

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 4:28 PM, Nancy Adam wrote: hi all, I’m trying to install e1071 package to a new computer but I failed. Can any one please tell me how I download it without installing through R? can anyone please send it as an attachment please? http://lib.stat.cmu.edu/R/CRAN/web/pac

Re: [R] Update problem? Rcmdr disappears, won't re-open

2010-02-02 Thread Liviu Andronic
On 2/2/10, briancady413 wrote: > I am trying unsuccessfully to open RcmdrPlugin.IPSUR from within Rcmdr, via > the pulldown tools menu. > It insists I restart Rcmdr, which I let happen, then Rcmdr doesn't restart, > and then I can not restart it using R's package loading function either. > >Fr

Re: [R] lme4 package and gamma family

2010-02-02 Thread Ben Bolker
cristina gmail.com> writes: > > > Hello, > > I am trying to use the lmer function from the lme4 package I have installed > today (lme4_0.999375-32.zip; R-2.10.1). According to the information, I > should be able to use a generalized linear mixed model. > However when I try to fit a model wit

[R] e1071 package

2010-02-02 Thread Nancy Adam
hi all, I’m trying to install e1071 package to a new computer but I failed. Can any one please tell me how I download it without installing through R? can anyone please send it as an attachment please? Many thanks, Nancy

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread Charles C. Berry
On Tue, 2 Feb 2010, sjaffe wrote: 'fraid not :-(( tapply( data, groups, weighted.mean, weights) won't work because the *entire* weights vector is passed as the 2nd arg to weighted.means. But weighted.mean needs 'weights' to be split in the same way as 'data' -- the first and 2nd args need to

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread Bert Gunter
?by Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of sjaffe Sent: Tuesday, February 02, 2010 1:16 PM To: r-help@r-project.org Subject: Re: [R] tapply for function taking of >1 argument?

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread sjaffe
'fraid not :-(( tapply( data, groups, weighted.mean, weights) won't work because the *entire* weights vector is passed as the 2nd arg to weighted.means. But weighted.mean needs 'weights' to be split in the same way as 'data' -- the first and 2nd args need to correspond. Jorge Ivan Velez wrot

Re: [R] Writing out csv files

2010-02-02 Thread sjaffe
write.table( rbind( quarter=names(maxr), maxr ), ..., col.names=FALSE, ... ) James Rome wrote: > > In my code, I calculate the maximum values with 2 factors using > maxr=with(arrdf, tapply(rate,list(weekday,quarter), max, na.rm=T)) > > and I want to write out the file so that Excel can read it

Re: [R] tapply for function taking of >1 argument?

2010-02-02 Thread Jorge Ivan Velez
Hi sjaffem, You were almost there: tapply( yourdata, groups, weighted.mean, weights) See ?tapply for more information. HTH, Jorge On Tue, Feb 2, 2010 at 3:58 PM, sjaffe <> wrote: > > I'm sure I can put this together from the various 'apply's and split, but I > wonder if anyone has a quick in

Re: [R] Writing out csv files

2010-02-02 Thread James Rome
Yes, that worked. Thank you, Jim On 2/2/10 3:45 PM, jim holtman wrote: > Use 'write.csv' > > write.csv(maxr,fname,na="0") > > this may work better. > > >> write.table(x.df,sep=',') >> > "V1","V2","V3" > "1",1,4,7 > "2",2,5,8 > "3",3,6,9 > >> write.csv(x.df) >> > "","V1","V2","V3"

[R] tapply for function taking of >1 argument?

2010-02-02 Thread sjaffe
I'm sure I can put this together from the various 'apply's and split, but I wonder if anyone has a quick incantation: E.g. I can do tapply( data, groups, mean) but how can I do something like: tapply( list(data,weights), groups, weighted.mean ) ? (or: mapply is to sapply as ? is to tapply ) T

Re: [R] iterative regressions, adding a new line of data each, time

2010-02-02 Thread Prof. John C Nash
Possibly of limited use to the original poster, but of interest more generally, there are a number of tools developed in the 70s for updating the matrix decompositions. There's at least one in my 1979 book "Compact numerical methods for computers" (still in print apparently) -- we didn't have en

Re: [R] Update problem? Rcmdr disappears, won't re-open

2010-02-02 Thread G. Jay Kerns
Dear Brian, On Tue, Feb 2, 2010 at 3:02 PM, briancady413 wrote: > > WinXP, R 2.10.1 > > I just updated R, and now have trouble. Perhaps it was the method I used to > keep all the packages. > > I copied all the new packages from 2.10.1 back into the 2.10.0 folder, then > copied them and all the o

Re: [R] Error with toString

2010-02-02 Thread anna
Ok Peter I think you were right about pointing out the RBloomberg package because here is what I get with getAnywhere('toString'): 2 differing objects matching ‘toString’ were found in the following places package:RBloomberg package:base namespace:base Use [] to view one of them Warning mess

Re: [R] Writing out csv files

2010-02-02 Thread jim holtman
Use 'write.csv' write.csv(maxr,fname,na="0") this may work better. > write.table(x.df,sep=',') "V1","V2","V3" "1",1,4,7 "2",2,5,8 "3",3,6,9 > write.csv(x.df) "","V1","V2","V3" "1",1,4,7 "2",2,5,8 "3",3,6,9 write.csv makes it excel compatible. On Tue, Feb 2, 2010 at 3:32 PM, James Rome wrote:

[R] Basic matrix math question and avoiding additional memory allocation?

2010-02-02 Thread David Reiss
I was not able to find this being specifically addressed previously, so I thought I'd try starting a new thread: I am dealing with a bunch of big matrices and basic mathematics, such as x <- x + y * 3 where x and y are large matrices of the same dimension. I now realize that when I perform the a

Re: [R] Error with toString

2010-02-02 Thread Peter Ehlers
You have another toString function hanging around. Your result is exactly what I get from methods('toString') after I define toString <- function(x) x You could try getAnywhere('toString') -Peter anna wrote: Peter, here is what I get for methods('toString'): [1] toString.default Warning m

[R] Writing out csv files

2010-02-02 Thread James Rome
In my code, I calculate the maximum values with 2 factors using maxr=with(arrdf, tapply(rate,list(weekday,quarter), max, na.rm=T)) and I want to write out the file so that Excel can read it. I used write.table(maxr, fname, sep=",", col.names=TRUE, row.names=TRUE, quote=TRUE, na="0"

Re: [R] Build a matrix from another matrix by specifying the indexes

2010-02-02 Thread anna
ke te pehea koe Peter? I don't see how I could do this with a merge to be honest... - Anna Lippel -- View this message in context: http://n4.nabble.com/Build-a-matrix-from-another-matrix-by-specifying-the-indexes-tp1460326p1460355.html Sent from the R help mailing list archive at Nabble.com

[R] February/March 2010***R Courses*** by XLSolutions Corp in San Francisco and other USA cities

2010-02-02 Thread s...@xlsolutions-corp.com
Check out our February/March R courses schedule in San Francisco and other USA cities. http://www.xlsolutions-corp.com/Rcourses *** S-PLUS / R : Programming Essentials. *** R/S+ Fundamentals and Programming Techniques *** R/S-PLUS Functions by Example. *** S/R-PLUS Programming 3: Advanced Techniq

Re: [R] Subset and plot

2010-02-02 Thread Chuck Cleland
On 2/2/2010 2:51 PM, Marlin Keith Cox wrote: > Here is a runable program. When I plot Day and Wgt, it graphs all the data > points. All I need is daily.sub1 plotted. I also need each "Tanks" to have > its own col or pch. When I run it with the line with pch, it gives me > nothing. DF <- data.f

Re: [R] Build a matrix from another matrix by specifying the indexes

2010-02-02 Thread Peter Alspach
Tena koe Anna This sounds like merge to me. ?merge HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of anna > Sent: Wednesday, 3 February 2010 9:07 a.m. > To: r-help@r-project.org > Subject: [R] Build a

[R] Build a matrix from another matrix by specifying the indexes

2010-02-02 Thread anna
Hello R specialists, I have a base vector called vBase with 102 elements. I have another vector vec1 which elements are only part of vBase but is shorter. I transform vec1 so I get a vector with the same size as vBase and with each common element on the same indexed row. If a value is missing in v

[R] Update problem? Rcmdr disappears, won't re-open

2010-02-02 Thread briancady413
WinXP, R 2.10.1 I just updated R, and now have trouble. Perhaps it was the method I used to keep all the packages. I copied all the new packages from 2.10.1 back into the 2.10.0 folder, then copied them and all the others I've previously added from the 2.10.0 folder and pasted them back into 2.1

[R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
Here is a runable program. When I plot Day and Wgt, it graphs all the data points. All I need is daily.sub1 plotted. I also need each "Tanks" to have its own col or pch. When I run it with the line with pch, it gives me nothing. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep(c("a3","a4","c

Re: [R] Error with toString

2010-02-02 Thread anna
Peter, here is what I get for methods('toString'): [1] toString.default Warning message: In methods("toString") : function 'toString' appears not to be generic - Anna Lippel -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1460296.html Sent from the R hel

Re: [R] Error with toString

2010-02-02 Thread Peter Ehlers
I don't think that rJava has a toString function. It does use the function in base. I see a function toString.XMLNode() in the XML package which is used as toString(x), so maybe that's where your problem lies; but I didn't see the XML package in your list of attached packages. Anyway, here are tw

Re: [R] Error with toString

2010-02-02 Thread anna
ok so this way it worked...it's probably calling the toString function from another package but I don't understand which one...obrigadinha Henrique! - Anna Lippel -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1460286.html Sent from the R help mailing li

Re: [R] Error with toString

2010-02-02 Thread Henrique Dallazuanna
Try: base::toString On Tue, Feb 2, 2010 at 5:16 PM, anna wrote: > > isn't there a way to specify from which library I am taking the method > from...like rjava.toString or base.toString.. > > - > Anna Lippel > -- > View this message in context: > http://n4.nabble.com/Error-with-toString-tp12

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 1:33 PM, trece por ciento wrote: Thanks again, David I think that this could work. Final questions: 1. I have read that read.fwt could be slow for big tables (my tables have aprox. 16 records, with 176 characters of recordlenght, almost 28MBytes). Could that be a prob

Re: [R] mysterious extra spaces appearing in expression paste

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 2:13 PM, George Locke wrote: Hi, i'm trying to put a legend on some figures and they're coming out a bit wonky. here's an example: a <- c(1:10) par(mfrow=c(2,1)) plot(a,type="s",lwd=3) leg <- c(expression(paste("data1 (",rho,"=1)")), expression(paste("data2 (",rho,"=0.0)")

Re: [R] mysterious extra spaces appearing in expression paste

2010-02-02 Thread anna
try putting sep="" in your paste method - Anna Lippel -- View this message in context: http://n4.nabble.com/mysterious-extra-spaces-appearing-in-expression-paste-tp1460261p1460264.html Sent from the R help mailing list archive at Nabble.com. __ R

Re: [R] Error with toString

2010-02-02 Thread anna
isn't there a way to specify from which library I am taking the method from...like rjava.toString or base.toString.. - Anna Lippel -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1460262.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-02 Thread trece por ciento
Thanks again, David I think that this could work. Final questions: 1. I have read that read.fwt could be slow for big tables (my tables have aprox. 16 records, with 176 characters of recordlenght, almost 28MBytes). Could that be a problem? 2. If using read.fwt is not a problem, wouldn't be be

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-02 Thread trece por ciento
Thanks Jim, As I know nothing about Perl (is it really necessary?), I think that I will try with David's approach. What I want to do is to for a pseudo-panel with my survey data (that is collected periodically), and process it with the survey package. The resulting data set will be big (around 3

Re: [R] StructTS standard errors

2010-02-02 Thread MY
I just did a search on StructTS on the same topic and ended up here. Did this issue ever get resolved here or elsewhere? Regards, Myron -- View this message in context: http://n4.nabble.com/StructTS-standard-errors-tp966079p1460216.html Sent from the R help mailing list archive at Nabble.com.

[R] mysterious extra spaces appearing in expression paste

2010-02-02 Thread George Locke
Hi, i'm trying to put a legend on some figures and they're coming out a bit wonky. here's an example: a <- c(1:10) par(mfrow=c(2,1)) plot(a,type="s",lwd=3) leg <- c(expression(paste("data1 (",rho,"=1)")), expression(paste("data2 (",rho,"=0.0)"))) legend("bottomright",legend=leg,col=c(1,2),lwd=3)

Re: [R] merging data frames gives all NAs

2010-02-02 Thread David Winsemius
Yeah, sometimes the vocabulary we bring to a task does not match up (or "merge" properly) with the vocabulary that the developers use. In this case the merge operation is one that has a precise meaning in database lingo, which apparently you do not have background in. My experience in tryi

Re: [R] merging data frames gives all NAs

2010-02-02 Thread James Rome
I agree. I have a foot of books on R now, for example the R Book by Michael Crowly. But so far, Googling the archives of this list has been the most help. Nonetheless, if I cannot understand the documentation of a function, then the documentation needs to be updated. For example, there needs to be

[R] factorial map?

2010-02-02 Thread Sacha Viquerat
hello! i'm dealing with the following: i've collected a factor covariable at irregularly placed sampling points along a line with spatial informations, i.e.: dataset<-c(x-coordinates, y-coordinates, level-of-factor) the factor describes the density of vegetation between 0 (no ground cover) and

Re: [R] population variance and sample variance

2010-02-02 Thread Ista Zahn
Probably a simple typo, but just to keep things straight: you want to divide by n when describing the standard deviation of a sample, and divide by n-1 when estimating a population standard deviation (your initial description had it backwards I think). On Tue, Feb 2, 2010 at 5:25 PM, Peng Yu wrot

Re: [R] List of object properties

2010-02-02 Thread Peter Ehlers
Philipp, Check ?str which displays the structure of R objects. And do use extractor functions when available: coef(yourModel) instead of yourModel$coef -Peter Ehlers Philipp Rappold wrote: Dear all, I have a simple question: How can I retrieve a list with all properties of an object? Exam

Re: [R] merging data frames gives all NAs

2010-02-02 Thread Erik Iverson
James Rome wrote: On 2/1/2010 5:51 PM, David Winsemius wrote: I figured this out finally. I really believe that the R help write-ups are sorely lacking. The help docs are probably not the best way to learn R, but they are great for users of the functions. I have found that after going thro

Re: [R] Subset and point plot

2010-02-02 Thread Peter Ehlers
I tried your code and a funny thing happened: I got an error object 'Foodin' not found Hmmm; could you try to post something _reproducible_ (and minimal, please)? But here are some suggestions: 1. investigate '%in%' 2. put a comma after Wgt in your plot call 3. see what you get from c("red"

Re: [R] Deleting many columns of a data frame with the same name in a row

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 12:04 PM, Steve Lianoglou wrote: Hi, On Tue, Feb 2, 2010 at 11:47 AM, anna wrote: This is what I just found now but I guess there is a simpler way: datas[which(names(datas)=="A")]<- list(rep(NULL,length(which(names(datas)=="A" but it worked For what it's worth,

Re: [R] List of object properties

2010-02-02 Thread David Winsemius
On Feb 2, 2010, at 1:08 PM, Philipp Rappold wrote: Dear all, I have a simple question: How can I retrieve a list with all properties of an object? Example: If I fit a regression with model <- coxph(Surv()~...) I know that I can access the coefficients with model $coefficients[...] a

Re: [R] merging data frames gives all NAs

2010-02-02 Thread James Rome
On 2/1/2010 5:51 PM, David Winsemius wrote: I figured this out finally. I really believe that the R help write-ups are sorely lacking. As soon as I looked at http://www.statmethods.net/management/merging.html, it was obvious: Adding Columns To merge two dataframes (datasets) horizontally, us

Re: [R] character variables in substitute()

2010-02-02 Thread Dennis Murphy
Hi: Taking David's and Gabor's contributions, I came up with a function that I hope satisfies David's needs: parText <- function(names, pars) { p1 <- paste("* '= ", pars[-length(pars)], ", '*", sep = "") p2 <- paste("* '= ", pars[length(pars)], "'") p <- c(p1, p2) txt <- paste

Re: [R] Error with toString

2010-02-02 Thread Peter Ehlers
Anna, Try omitting pkg:RBloomberg. If you really need to use that package, you will have to install the non-CRAN package RDCOMClient from omegahat. I still don't see why toString() wouldn't do its job, even with RBloomberg loaded. -Peter Ehlers anna wrote: Here is the list of the loaded pack

Re: [R] create an object in a loop (v3)

2010-02-02 Thread Chris Campbell
On Tue, Feb 2, 2010 at 11:44, Ivan Calandra wrote: > Hi David, > > Thanks for your answer. > But I don't really see how I can extend it with my real data. > The thing is that I have more than 3 names and 1 value for each name. > Moreover, each is different from one run to another. That is why I wa

Re: [R] Retrieve distinct values within a whole data frame

2010-02-02 Thread anna
ok it worked so the key is unlist() from what I see :working: - Anna Lippel -- View this message in context: http://n4.nabble.com/Retrieve-distinct-values-within-a-whole-data-frame-tp1460205p1460217.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Error with write.table

2010-02-02 Thread Erik Iverson
How about a MINIMAL example of a data.frame that produces the error message you see? That will help track down what's going on... jlwoodard wrote: I was trying to save a data frame to an excel file using the following command: write.table(myData, file="myData.csv",sep=",", row.names=F) The co

Re: [R] Retrieve distinct values within a whole data frame

2010-02-02 Thread Steve Lianoglou
Hi, On Tue, Feb 2, 2010 at 1:19 PM, anna wrote: > > Hello everyone, > I am trying to retrieve the list of distinct values within a whole data > frame. I tried to use unique() function but it retrieves the distinct values > within each column or row, I want it for the entire data frame, any idea?

Re: [R] Deleting many columns of a data frame with the same name in a row

2010-02-02 Thread anna
yes it looks really simpler, thank you! - Anna Lippel -- View this message in context: http://n4.nabble.com/Deleting-many-columns-of-a-data-frame-with-the-same-name-in-a-row-tp1460078p1460213.html Sent from the R help mailing list archive at Nabble.com.

  1   2   >