Re: [R] permutations from vectors out of a matrix

2010-01-20 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Well, seems it's an assignment, so you should REALLY get them on your own and not enquire the list. Foolish me... M. > -Original Message- > From: einohr2...@web.de [mailto:einohr2...@web.de] > Sent: Mittwoch, 20. Januar 2010 19:32 > To: Meyners,Michael,LAUSANNE,AppliedMathematics; r-help@

Re: [R] Data Manipulation

2010-01-20 Thread Dieter Menne
Peter Rote wrote: > > > but i still have a problem to write to file. The problem is the slash in > file names (Aerospace/Defense Products & Services ). If i want it to > C:/ab/ > so "C:/ab/AdvertisingAgencies.txt" is ok but > "C:/ab/Aerospace/Defense-MajorDiversified.txt" is not > > As Rol

Re: [R] superimpose histogram and fitted gamma pdf

2010-01-20 Thread Rainer M Krug
On Thu, Jan 21, 2010 at 8:47 AM, Roslina Zakaria wrote: > Hi r-users, > > I try to draw histogram (in terms of probabilty) and superimpose with the > gamma pdf. Using this code below I can get the plots BUT the y scale for the > density is out of scale. How do I change the y-axis scale to max 1?

[R] superimpose histogram and fitted gamma pdf

2010-01-20 Thread Roslina Zakaria
Hi r-users,   I try to draw histogram (in terms of probabilty) and superimpose with the gamma pdf. Using this code below I can get the plots BUT the y scale for the density is out of scale.  How do I change the y-axis scale to max 1?  Another thing, how I do draw smooth line rather that points?

[R] how to give the index with some given index ?

2010-01-20 Thread Carrie Li
Dear R-helpers, I have a question about giving index. Suppose that I have a vector say, id=1:5, and each of them have some given index but some of them may share the same index Now, I have another vector, and I want to give it a index based what just defined. # 5 subjects test1=1:5 # corresponding

Re: [R] Memory usage in read.csv()

2010-01-20 Thread nabble . 30 . miller_2555
Hi Jim & Gabor - Apparently, it was most likely a hardware issue (shortly after sending my last e-mail, the computer promptly died). After buying a new system and restoring, the script runs fine. Thanks for your help! On Tue, Jan 19, 2010 at 2:02 PM, jim holtman - jholt...@gmail.com <+nabble+m

[R] how to give the index with some given index ?

2010-01-20 Thread Carrie Li
Dear R-helpers, I have a question about giving index. Suppose that I have a vector say, id=1:5, and each of them have some given index but some of them may share the same index Now, I have another vector, and I want to give it a index based what just defined. # 5 subjects test1=1:5 # corresponding

[R] how to give the index with some given index ?

2010-01-20 Thread Carrie Li
Dear R-helpers, I have a question about giving index. Suppose that I have a vector say, id=1:5, and each of them have some given index but some of them may share the same index Now, I have another vector, and I want to give it a index based what just defined. # 5 subjects test1=1:5 # corresponding

Re: [R] question about Software for Data analysis book

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:10 PM, Erin Hodgess wrote: Dear R People: I'm sure that this is a very silly question, but I'm reading the Software for Data analysis book by John Chambers, and I can't find the "Declination" data that he refers to on page 15 in the book. I did all of the usual stuff:

Re: [R] concatenate 2 column vectors

2010-01-20 Thread teurlai magali
datatry2=transform(datatry,DIS=as.numeric(paste(datatry[,1],datatry[,2],sep=""))) It works like this !! You understood perfectly well what I needed ;-) Thanks to all that answered Magali --- En date de : Jeu 21.1.10, milton ruser a écrit : De: milton ruser Objet: Re: [R] concatenate 2 column

Re: [R] concatenate 2 column vectors

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:14 PM, teurlai magali wrote: Sorry I forgot the subject in my previous post Here is an example of data : province and district code of 4 locations datatry=matrix(c(8,12,3,3,1,1,16,1),4,2) colnames(datatry)<-c("PROCODE","DISCODE") > cbind( datatry, paste(datatry[, "PR

Re: [R] concatenate 2 column vectors

2010-01-20 Thread milton ruser
Hi Magali, I confess that I still not figured out what you want, but try this: datatry2=transform(datatry,DIS=as.numeric(as.character(paste(datatry[,1],datatry[,2],sep="" bests milton On Wed, Jan 20, 2010 at 11:14 PM, teurlai magali wrote: > Sorry I forgot the subject in my previous post

Re: [R] (no subject)

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:10 PM, Tena Sakai wrote: Hi, When I emulate what's suggested I get an error (shown below). What does this mean? Thank you. Province <- c(1, 1, 13) District <- c(1, 2, 2) df$Distric_Unique <- with(df, paste(Province, District, sep=".") ) Error in eval(substitute(expr)

Re: [R] concatenate 2 column vectors

2010-01-20 Thread teurlai magali
Sorry I forgot the subject in my previous post Here is an example of data : province and district code of 4 locations datatry=matrix(c(8,12,3,3,1,1,16,1),4,2) colnames(datatry)<-c("PROCODE","DISCODE") DISCODE is not unique for each location (there is a distrcit nb 1 in each province) I want to

[R] question about Software for Data analysis book

2010-01-20 Thread Erin Hodgess
Dear R People: I'm sure that this is a very silly question, but I'm reading the Software for Data analysis book by John Chambers, and I can't find the "Declination" data that he refers to on page 15 in the book. I did all of the usual stuff: library(help=SoDA) ??Declination looked for it onlin

Re: [R] (no subject)

2010-01-20 Thread Tena Sakai
Hi, When I emulate what's suggested I get an error (shown below). What does this mean? Thank you. > Province <- c(1, 1, 13) > District <- c(1, 2, 2) > > df$Distric_Unique <- with(df, paste(Province, District, sep=".") ) Error in eval(substitute(expr), data, enclos = parent.frame()) : invalid '

[R] (Solved) Problems completely reading in a "large" sized data set

2010-01-20 Thread Robin Jeffries
I'm not quite sure why, but reading in the *sorted* data (imported into Excel, sorted, written to a text file) worked perfectly fine with read.delim(). Thanks to those that replied! -Robin [[alternative HTML version deleted]] __ R-help@r-proj

Re: [R] Question about many-to-one merge

2010-01-20 Thread hongwei
btw, the re-order and swap make it much clearer, so thanks again! -- View this message in context: http://n4.nabble.com/Question-about-many-to-one-merge-tp1018811p1037860.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] Question about many-to-one merge

2010-01-20 Thread hongwei
Oh, yes, my bad. Merge works! I guess the reordering automatically made by Merge made me confused. I wrote my code using Merge several months ago, and just didn't feel it right today. Thanks anyway! -- View this message in context: http://n4.nabble.com/Question-about-many-to-one-merge-tp101881

Re: [R] R.oo installation warnings?

2010-01-20 Thread Henrik Bengtsson
Hi, don't worry about those setGenericS3()/setMethodS3(0 warnings - they are just informative. I am aware of that last warning: Warning: package 'R.oo' claims to be built under R version 2.10.0 but is missing some help files and needs to be re-installed but it does not go away when you reinstal

Re: [R] (no subject)

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 9:34 PM, teurlai magali wrote: Hi is there a way in R to create a new column vector with the numbers of 2 others columns simply appended? Example : I have a column with provinces codes (1 to 19) I have a second column with districts codes (1 to ##, depending on the pr

Re: [R] (no subject)

2010-01-20 Thread Henrique Dallazuanna
transform(DF, District_Unique = paste(Province, District, collapse = '')) On Thu, Jan 21, 2010 at 12:34 AM, teurlai magali wrote: > Hi > > is there a way in R to create a new column vector with the numbers of 2 > others columns simply appended? > > Example : I have a column with provinces codes

[R] (no subject)

2010-01-20 Thread teurlai magali
Hi is there a way in R to create a new column vector with the numbers of 2 others columns simply appended? Example : I have a column with provinces codes (1 to 19) I have a second column with districts codes (1 to ##, depending on the province) I want to create a third column with a code that wo

Re: [R] Data Manipulation

2010-01-20 Thread Rolf Turner
A name such as ``Aerospace/Defense etc.'' is certainly not a legal file name under unix-alike systems, and I suspect it would not be even under Windoze. Even if it is, you shouldn't use it! Change the name to ``Aerospace-Defense Products & Services'' or something like that, for goodness sake.

[R] Using spec.ls to interpolate very long time series

2010-01-20 Thread Martin Berg
I have an very long, irregularly spaced time series (and I'm also new to spectral analysis, so please be patient.) I want to use spec.ls as an interpolator and then use the output to reconstruct the time series via inverse fft. But so far I've been having difficulty doing this. ts<-read.csv("t

Re: [R] Data Manipulation

2010-01-20 Thread Peter Rote
by the way how do i change the output "1016" "Advertising Agencies" "CMM" "1803" "Advertising Agencies" "FMCN" "2427" "Advertising Agencies" "IPG" "3093" "Advertising Agencies" "MWW" "3372" "Advertising Agencies" "OMC" "4809" "Advertising Agencies" "VCLK" "4832" "Advertising Agencies" "VISN" "500

[R] Problems completely reading in a "large" sized data set

2010-01-20 Thread Robin Jeffries
I have been through the help file archives a number of times, and still cannot figure out what is wrong. I have a tab-delimited text file. 76Mb, so while it's large.. it's not -that- large. I'm running Win7 x64 w/4G RAM and R 2.10.1 When I open this data in Excel, i have 27 rows and 450932 rows, e

Re: [R] Data Manipulation

2010-01-20 Thread Peter Rote
Thank you Dieter, but i still have a problem to write to file. The problem is the slash in file names (Aerospace/Defense Products & Services ). If i want it to C:/ab/ so "C:/ab/AdvertisingAgencies.txt" is ok but "C:/ab/Aerospace/Defense-MajorDiversified.txt" is not > head(AlexETF)

Re: [R] Greek letters on a multi-line plot title

2010-01-20 Thread David Scott
Jason Rupert wrote: David, Thank you very much for your response. Is there any chance you can provide your example where mtext is used? I also tried to use mtext, but I did not have any luck, so any help with the example below working with mtext or otherwise is greatly appreciated. Thanks

Re: [R] x,y plot question (two sets of labels)

2010-01-20 Thread Peter Alspach
Tena koe Jonathan There are lots of ways - using base graphics or lattice or ggplot. As a start, using base graphics: plot(plothelpX, plothelpA2, col=factor(plothelpB)) points(plothelpX, plothelpA1, col=factor(plothelpB)) You'll also need the pch argument to plot and, presumably, xlab, ylab and

Re: [R] S3 tutorial

2010-01-20 Thread Peng Yu
On Wed, Jan 20, 2010 at 5:30 PM, Steve Lianoglou wrote: > Hi, > > On Wed, Jan 20, 2010 at 6:05 PM, Peng Yu wrote: >> On Wed, Jan 20, 2010 at 5:04 PM, Peng Yu wrote: >>> I don't find a tutorial on S3. "Bengtsson.pdf" cites MASS (1999 >>> edition). However, I don't think that MASS (2002 edition) c

Re: [R] standardizing one variable by dividing each value by the mean -but within levels of a factor

2010-01-20 Thread Dimitri Liakhovitski
One follow up question - the proposed solution was (notice - this time I am introducing one NA in data frame "x") x<-data.frame(factor=c("b","b","d","d","e","e"),values=c(1,NA,10,20,100,200)) x$std.via.ave<-ave(x$values, x$factor, FUN=function(x)x/mean(x)) I compared the result to my own clumsy s

Re: [R] Greek letters on a multi-line plot title

2010-01-20 Thread Jason Rupert
David, Thank you very much for your response. Is there any chance you can provide your example where mtext is used? I also tried to use mtext, but I did not have any luck, so any help with the example below working with mtext or otherwise is greatly appreciated. Thanks again, Jason

Re: [R] Printing RVector

2010-01-20 Thread GlenB
Does *cat(v[0])* produce what you need? -- View this message in context: http://n4.nabble.com/Printing-RVector-tp1018770p1025909.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] Merge and join data

2010-01-20 Thread GlenB
Specifically, your setup of the data makes all the columns factors, so to make Peter's code work you need to make the relevant columns numeric first. -- View this message in context: http://n4.nabble.com/Merge-and-join-data-tp1018729p1025642.html Sent from the R help mailing list archive at Nabb

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
It may also be that path names with spaces in them are not supported. Try it using a path that has no spaces in it. On Wed, Jan 20, 2010 at 6:43 PM, Gabor Grothendieck wrote: > On Wed, Jan 20, 2010 at 6:01 PM, Jerry Floren > wrote: >> Next, I tried Gabor's code, which is so much more compact: >

[R] x,y plot question (two sets of labels)

2010-01-20 Thread Jonathan Greenberg
I'm trying to figure out the best way to do a scatterplot using the following data as an example: plothelp_x=1:10 plothelp_A1=sin(plothelp_x) plothelp_A2=tan(plothelp_x) plothelp_B=c("A","B","C","A","B","C","A","B","C","A") (note that all 4 of these vectors have 10 entries each) What I would l

Re: [R] Matrices with randomly generated entries

2010-01-20 Thread GlenB
Why not just use matrix(runif(9),nrow=3) ? -- View this message in context: http://n4.nabble.com/Matrices-with-randomly-generated-entries-tp1018777p1024617.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org ma

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
On Wed, Jan 20, 2010 at 6:01 PM, Jerry Floren wrote: > Next, I tried Gabor's code, which is so much more compact: > > ### Start of Gabor's code ### > library(gdata) > DF <- read.xls(U, pattern = "SAMPLE", as.is = TRUE) > ##  End of Gabor's code ## > > Is "U" the directory and path? Is "SAMPLE" the

Re: [R] Question about many-to-one merge

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 5:37 PM, hongwei wrote: I have spent a whole afternoon searching for the solution, but got nothing so far. It should be a simple problem. I have two datasets to merge. The first one just contains two ID columns and it looks like: FromID ToID 1 2 1

Re: [R] Question about many-to-one merge

2010-01-20 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of hongwei > Sent: Wednesday, January 20, 2010 2:38 PM > To: r-help@r-project.org > Subject: [R] Question about many-to-one merge > > > I have spent a whole afternoon searching for

Re: [R] standardizing one variable by dividing each value by the mean - but within levels of a factor

2010-01-20 Thread Dimitri Liakhovitski
Thanks a lot for your helpful suggestion! Dimitri On Wed, Jan 20, 2010 at 5:56 PM, Chuck Cleland wrote: > On 1/20/2010 5:37 PM, Dimitri Liakhovitski wrote: >> Hello! >> >> I have a data frame with a factor and a numeric variable: >> >> x<-data.frame(factor=c("b","b","d","d","e","e"),values=c(1,2,

Re: [R] S3 tutorial

2010-01-20 Thread Steve Lianoglou
Hi, On Wed, Jan 20, 2010 at 6:05 PM, Peng Yu wrote: > On Wed, Jan 20, 2010 at 5:04 PM, Peng Yu wrote: >> I don't find a tutorial on S3. "Bengtsson.pdf" cites MASS (1999 >> edition). However, I don't think that MASS (2002 edition) clearly >> explain what S3 is and help a user who knew very little

[R] Question about many-to-one merge

2010-01-20 Thread hongwei
I have spent a whole afternoon searching for the solution, but got nothing so far. It should be a simple problem. I have two datasets to merge. The first one just contains two ID columns and it looks like: FromID ToID 1 2 1 3 2 1 2 3 3 1 3

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Eric Ma
Wow, this is as much hand-holding as one can expect, and for a R newbie it is unbelievable and invaluable! Thanks again for all this help Marc! Here is the screen print of my entire R session: > .Machine$sizeof.pointer [1] 8 > > library(RODBC) > conn <- odbcConnect(dsn='qdblocal', uid = "ciqxf

[R] Error on using blpGetData() function from RBloomberg package

2010-01-20 Thread anna
Hello, I am using te blpGetData() function to retrieve closing prices from bloomberg on r. This is the code that I wrote: library(RBloomberg) conn=blpConnect blpGetData(conn,"ANF UN Equity","PX_LAST","2009/09/01","2009/09/10") and I get the following error: Error in substring(paste("0", v$day, se

Re: [R] S3 tutorial

2010-01-20 Thread Peng Yu
On Wed, Jan 20, 2010 at 5:04 PM, Peng Yu wrote: > I don't find a tutorial on S3. "Bengtsson.pdf" cites MASS (1999 > edition). However, I don't think that MASS (2002 edition) clearly > explain what S3 is and help a user who knew very little about S3 to > quickly understand it. Could somebody let me

[R] S3 tutorial

2010-01-20 Thread Peng Yu
I don't find a tutorial on S3. "Bengtsson.pdf" cites MASS (1999 edition). However, I don't think that MASS (2002 edition) clearly explain what S3 is and help a user who knew very little about S3 to quickly understand it. Could somebody let me know if there are some better learning materials to help

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Sorry Gabor, but I am not quite there yet. Thanks David for your suggestion on xlsReadWrite. Your message was posted while I was composing this one. The Excel worksheet I want to read in is named "Paste Special" I started with this code and thought it worked: ### Start of Code ### library(RODB

Re: [R] standardizing one variable by dividing each value by the mean - but within levels of a factor

2010-01-20 Thread Chuck Cleland
On 1/20/2010 5:37 PM, Dimitri Liakhovitski wrote: > Hello! > > I have a data frame with a factor and a numeric variable: > > x<-data.frame(factor=c("b","b","d","d","e","e"),values=c(1,2,10,20,100,200)) > > For each level of "factor" - I would like to divide each value of > "values" by the mean o

Re: [R] question on runif

2010-01-20 Thread Carl Witthoft
While I agree that this is someone's homework, it occur to me that we can mess him up a little more. He asked for 200 points *uniformly* distributed on (or in) a circle. Well, he did NOT say "uniform random distribution". So in fact the plot, "on" a circle would be theta <-seq(0,2*pi, by =

Re: [R] Unclear documentation on 'numeric' and 'integer' (R-lang.pdf)

2010-01-20 Thread Steve Lianoglou
Hi Peng, On Wed, Jan 20, 2010 at 5:37 PM, Peng Yu wrote: > R-lang.pdf has the following description in Section 3.1.1. > > """ > Any number typed directly at the prompt is a constant and is evaluated. >> 1 > [1] 1 > Perhaps unexpectedly, the number returned from the expression 1 is a > numeric. In

[R] Why are there typeof(), mode() and storage.mode()?

2010-01-20 Thread Peng Yu
According to R-lang.pdf (Section 2): Function mode gives information about the mode of an object in the sense of Becker, Chambers & Wilks (1988), and is more compatible with other implementations of the S language. Finally, the function storage.mode returns the storage mode of its argument in the

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Marc Schwartz
On Jan 20, 2010, at 1:36 PM, Eric Ma wrote: > > Thanks Marc for the quick reply. I confirmed the R binary I built is indeed > 64-bit. > > sqlplus works fine, so is the odbcConnect() call. > > Any idea the error is thrown by RODBC or R? > > Eric If you are getting the same error as in the or

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread David Scott
Jerry Floren wrote: Hi Gabor, Thanks for your insights and suggestions. There was a post on the Wiki you mentioned that makes me think this will work. Unfortunately, the spreadsheet was designed to make it easy for lab staff to enter their results, but not so easy for another program to read

[R] Unclear documentation on 'numeric' and 'integer' (R-lang.pdf)

2010-01-20 Thread Peng Yu
R-lang.pdf has the following description in Section 3.1.1. """ Any number typed directly at the prompt is a constant and is evaluated. > 1 [1] 1 Perhaps unexpectedly, the number returned from the expression 1 is a numeric. In most cases, the difference between an integer and a numeric value will b

[R] standardizing one variable by dividing each value by the mean - but within levels of a factor

2010-01-20 Thread Dimitri Liakhovitski
Hello! I have a data frame with a factor and a numeric variable: x<-data.frame(factor=c("b","b","d","d","e","e"),values=c(1,2,10,20,100,200)) For each level of "factor" - I would like to divide each value of "values" by the mean of "values" that corresponds to the level of "factor" In other word

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Thanks a million Gabor. I was able to quickly import 21 test files. This will save me hours, and should eliminate some errors. Thanks, Jerry Floren Minnesota Department of Agriculture -- View this message in context: http://n4.nabble.com/Yet-another-question-about-importing-Excel-xls-files-tp1

Re: [R] Matrices with randomly generated entries

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 4:55 PM, jshort wrote: I'm attempting to generate matrices where the entries are randomly generated numbers of specified distribution. The following code was an attempt to create a 3 by 3 matrix, where my entries where randomly generated from a uniform (0,1) distributio

[R] Matrices with randomly generated entries

2010-01-20 Thread jshort
I'm attempting to generate matrices where the entries are randomly generated numbers of specified distribution. The following code was an attempt to create a 3 by 3 matrix, where my entries where randomly generated from a uniform (0,1) distribution. x = matrix(0,ncol = 3, byrow = T) for(i in 1:

Re: [R] Greek letters on a multi-line plot title

2010-01-20 Thread David Scott
Jason Rupert wrote: I have an instance where I need to include Greek letters on a plot title that is multiple lines. I've searched the forums for an approach to do this, but most of the previous posts and replies seem to just address instances of single line examples and problems:, e.g. http

[R] Printing RVector

2010-01-20 Thread Bhanu Mangipudi
Hi All, I am new to python, R and rpy2. I am trying to print an Rvector say v and I want to print 1st element so the statement will be *print (v[0])* and this gives me *output [1] 876* but the real value I should get is 876. Can any one can help how to get rid of [1] while printing. I am using

Re: [R] Merge and join data

2010-01-20 Thread Peter Alspach
Tena koe Sean I suspect the apply() and merge() functions are working, but they may not be doing what you expect :-) You could try rbind() and aggregate(): > data.frame1$HAD <- as.numeric(NA) > data.both <- rbind(data.frame1, data.frame2) > aggregate(data.both[,-(1:3)], data.both[,1:3], sum, na.

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
Try this: U <- "http://www.mda.state.mn.us/en/sitecore/content/Global/MDADocs/licensing/map/mapreportform.aspx"; library(gdata) DF <- read.xls(U, pattern = "SAMPLE", as.is = TRUE) and now write an R program to create the desired data frame from DF. On Wed, Jan 20, 2010 at 3:56 PM, Jerry Floren

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Hi Gabor, Thanks for your insights and suggestions. There was a post on the Wiki you mentioned that makes me think this will work. Unfortunately, the spreadsheet was designed to make it easy for lab staff to enter their results, but not so easy for another program to read in the data. That is w

Re: [R] Line Plot with Dates on X-axis

2010-01-20 Thread mah
Thank you - zoo did exactly what I needed... On Jan 20, 12:20 pm, Henrique Dallazuanna wrote: > Try the zoo package: > > plot(as.yearqtr(time.val), inc, col = 'red', type = 'l') > > > > On Wed, Jan 20, 2010 at 3:41 PM, mah wrote: > > I am trying to generate a line graph with quarterly time bucke

[R] Merge and join data

2010-01-20 Thread Sean M. Lucey
Hi, I'm looking to combine two data frames. Several of the columns are in common while the others need to be summed up. The apply functions and the merge functions don't seem to be working. I've included a basic example of what I'm trying to do below. Thanks! Sean data.frame1<-as.data.

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Eric Ma
Thanks Marc for the quick reply. I confirmed the R binary I built is indeed 64-bit. sqlplus works fine, so is the odbcConnect() call. Any idea the error is thrown by RODBC or R? Eric -- View this message in context: http://n4.nabble.com/Run-time-error-when-executing-sqlQuery-using-the-64-b

[R] Growth Mixture Modeling

2010-01-20 Thread Rhoderick Machekano
Is there a package for growth mixture modeling in R? Rhoderick [[alternative HTML version deleted]] __ 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/post

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
1. read.xls in gdata has the capability of - reading an xls file starting from the first row with a given pattern - converting an xls file to a csv file - converting an xls file to a data frame Would those capabilities be sufficient for the input side? See examples in ?read.xls 2. If you do a g

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread Glen Sargeant
One way to plot subsets of data identified by a grouping variable is to use lapply() on a list of subsets. The approach is worth mentioning because similar tactics are useful for many problems. #List of unique values for grouping variable #that is not necessarily a factor names <- as.list(uniqu

Re: [R] min and max operations on matrix

2010-01-20 Thread Gabor Grothendieck
Try this: > t(apply(x, 1, function(x) (x == max(x)) - (x == min(x [,1] [,2] [,3] [1,] -101 [2,]1 -10 [3,]10 -1 You can avoid the transpose using plyr: > library(plyr) > aaply(x, 1, function(x) (x == max(x)) - (x == min(x))) Var1 1 2 3 1 -1 0 1 2

[R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Six times a year labs submit individual Excel spreadsheets to me. There are usually around 60 labs and the spreadsheets have 12 columns with 20 rows. Chapter 8 of the R Data Import/Export manual recommends converting .xls files, to a text file. I have been manually converting the individual .xls

[R] Retrieving data through bbg or excel, what is faster?

2010-01-20 Thread anna
Hello, I need to retrieve datas from bloomberg. I want to retrieve those datas in the fastest way as possible. I have two options: writing the datas from bbg to excel and reading from r the excel sheet or directly read the datas from from r with a Rbbg connection. Which connection is faster? Than

Re: [R] legend in multiple plot

2010-01-20 Thread Uwe Ligges
Use outer margins around the whole thing, see argument "oma" in ?par. Uwe Ligges On 20.01.2010 17:53, Lars Skjærven wrote: Dear R users, I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and want a legend for this at the bottom of all the plots. From previous mails it ha

Re: [R] barchart with stacked and beside bars

2010-01-20 Thread RICHARD M. HEIBERGER
I don't understand what you are looking for. The line barplot(t(ld)) is placing the four treatments side by side, and is also stacking the three values of typ. Please indicate what you would like the figure to look like. Rich __ R-help@r-project.org

Re: [R] simulation of binary data

2010-01-20 Thread Rolf Turner
On 21/01/2010, at 4:41 AM, omar kairan wrote: Hi, could someone help me with dilemma on the simulation of logistic regressiondata with multicollinearity effect and high leverage point.. If that is the clearest way in which you can phrase your question then I doubt that *anyone* can help you.

Re: [R] bootstrapping

2010-01-20 Thread aaron.foley
Got it. Thanks > CC: r-help@r-project.org > From: dwinsem...@comcast.net > To: aaron.fo...@students.tamuk.edu > Subject: Re: [R] bootstrapping > Date: Wed, 20 Jan 2010 10:34:20 -0500 > > > On Jan 20, 2010, at 10:23 AM, > > wrote: > > > > > Hello, > > > > > > > > I was able to boot

Re: [R] question on runif

2010-01-20 Thread Rolf Turner
Ted, Alfredo, et al: Please stop doing this jerk's homework for him!!! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

[R] Greek letters on a multi-line plot title

2010-01-20 Thread Jason Rupert
I have an instance where I need to include Greek letters on a plot title that is multiple lines.   I've searched the forums for an approach to do this, but most of the previous posts and replies seem to just address instances of single line examples and problems:, e.g.   https://stat.ethz.ch/p

Re: [R] Problem in NMDS

2010-01-20 Thread Gavin Simpson
On Wed, 2010-01-20 at 23:28 +0800, Bingzhang Chen wrote: > Hi, > > I am stuck in one problem when doing nonmetric multidimensional > scaling. I use the function 'metaMDS' in the package 'vegan' to work > on the presence/absence community data. The problem is when two > samples are identical (dissi

Re: [R] permutations from vectors out of a matrix

2010-01-20 Thread Etienne Stockhausen
Meyners,Michael,LAUSANNE,AppliedMathematics schrieb: Sorry, wrong button. Below a hopefully more helpful solution... Etienne, I don't see the point in avoiding some 'special' packages. If you are willing to change your mind in this regard, try one of the following solutions that work for me: li

Re: [R] Line Plot with Dates on X-axis

2010-01-20 Thread Henrique Dallazuanna
Try the zoo package: plot(as.yearqtr(time.val), inc, col = 'red', type = 'l') On Wed, Jan 20, 2010 at 3:41 PM, mah wrote: > I am trying to generate a line graph with quarterly time buckets (with > nice labels) on the x-axis.  The first block of code below will > generate the graph with nicely fo

[R] Line Plot with Dates on X-axis

2010-01-20 Thread mah
I am trying to generate a line graph with quarterly time buckets (with nice labels) on the x-axis. The first block of code below will generate the graph with nicely formatted x-axis labels, but the "type=" and "col=" options are not recognized when factors are used for the x-axis. The second bloc

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread David Freedman
You'll probably want to look at the 'by' function d=data.frame(sex=rep(1:2,50),x=rnorm(100)) d$y=d$x+rnorm(100) head(d) cor(d) by(d[,-1],d['sex'],function(df)cor(df)) You might also want to look at the doBy package -- View this message in context: http://n4.nabble.com/Mutliple-sets-of-data-in-

Re: [R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread Sundar Dorai-Raj
Try googling "latticeExtra x.same" for some examples. Here's one: http://www.mail-archive.com/r-help@r-project.org/msg39048.html On Wed, Jan 20, 2010 at 9:44 AM, George Chen wrote: > Hello, > > I would like to juxtapose two lattice graphs with common X axes such that > the X axes line up. I am

Re: [R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread baptiste auguie
Hi, try c.trellis() from the latticeExtra package. HTH, baptiste 2010/1/20 George Chen : > Hello, > > I would like to juxtapose two lattice graphs with common X axes such that the > X axes line up.  I am using plot right now but the edges are not neat and it > would be nice if I could just d

[R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread George Chen
Hello, I would like to juxtapose two lattice graphs with common X axes such that the X axes line up. I am using plot right now but the edges are not neat and it would be nice if I could just draw 1 X axis and not both of them. Here is my code: upper<-bwplot(SignalUsed~as.fact

Re: [R] Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements

2010-01-20 Thread Henrique Dallazuanna
Try this: sapply(as.data.frame.table(a), as.numeric) On Wed, Jan 20, 2010 at 3:18 PM, rusers.sh wrote: > Hi, >  See my example below. > a<-array(1:12,c(2,3,2)) >> a > , , 1 > >     [,1] [,2] [,3] > [1,]    1    3    5 > [2,]    2    4    6 > > , , 2 > >     [,1] [,2] [,3] > [1,]    7    9   11 >

Re: [R] Reducing augmented matrices

2010-01-20 Thread Charles C. Berry
On Tue, 19 Jan 2010, jshort wrote: Hi How does one tell R that one is using an augmented matrix as appose to an non-augmented matrix? Explicitly creating an augmented matrix is unnecessary and awkward if the object is to solve a system of linear equations. See: ?solve HTH, Chu

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:07 AM, BioStudent wrote: Hi I'm hoping someone can help me I am a relative newbie to R. I have data that is in a similar format to this... Experiment Score1 Score2 X -0.85 -0.02 X -1.21 -0.02 X 1.05 0.09 Y -1.12 -0.07 Y -0.27 -0.07 Y -0.93 -0.08 Z 1.1 -0.03 Z 2.4 0.

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Henrique Dallazuanna
You can use this instead: with(do.call(rbind, df.list), tapply(Score, list(Date, Show, Time), invisible)) On Wed, Jan 20, 2010 at 3:02 PM, Tony B wrote: > Thank you for taking the time to reply Henrique. Although your > solution does take away the zeroes and replaces them with NA's (which > i pr

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Tony B
Thank you for taking the time to reply Henrique. Although your solution does take away the zeroes and replaces them with NA's (which i prefer), it unfortunately seems to reduce all of the other scores to just '1': > x <- with(do.call(rbind, df.list), tapply(Score, list(Date, Show, Time), > length

[R] Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements

2010-01-20 Thread rusers.sh
Hi, See my example below. a<-array(1:12,c(2,3,2)) > a , , 1 [,1] [,2] [,3] [1,]135 [2,]246 , , 2 [,1] [,2] [,3] [1,]79 11 [2,]8 10 12 I want to get a result something like dim1 dim2 dim3 elements 111 121 1

Re: [R] problem with origin of a plot

2010-01-20 Thread jpardila
Thanks so much for your assistance. In fact I did not read the documentation carefully. -- View this message in context: http://n4.nabble.com/problem-with-origin-of-a-plot-tp1018339p1018518.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread BioStudent
Hi I'm hoping someone can help me I am a relative newbie to R. I have data that is in a similar format to this... Experiment Score1 Score2 X -0.85 -0.02 X -1.21 -0.02 X 1.05 0.09 Y -1.12 -0.07 Y -0.27 -0.07 Y -0.93 -0.08 Z 1.1 -0.03 Z 2.4 0.09 Z -1.0 0.09 Now I can easily have a look at the

[R] simulation of binary data

2010-01-20 Thread omar kairan
Hi, could someone help me with dilemma on the simulation of logistic regressiondata with multicollinearity effect and high leverage point.. Thank you [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] problem of data manipulation

2010-01-20 Thread Matthew Dowle
I see now, thanks for explaining that. Would it be for you to add data.table methods to ddply then, for this to happen? Or does a ddply method need to be added to data.table? "hadley wickham" wrote in message news:f8e6ff051001200825q4009a122m122082a9df5fe...@mail.gmail.com... > On Wed, Jan 20

[R] min and max operations on matrix

2010-01-20 Thread Murali.MENON
Folks, I've got a matrix x as follows: > x <- matrix(c(1,2,3,5,3,4,3,2,1), ncol = 3, byrow = TRUE) > x [,1] [,2] [,3] [1,]123 [2,]534 [3,]321 In each row of x, I want to replace the minimum value by -1, the maximum value by +1 and all other values by 0.

[R] legend in multiple plot

2010-01-20 Thread Lars Skjærven
Dear R users, I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and want a legend for this at the bottom of all the plots. From previous mails it has been suggested to use par(xpd=TRUE), increase the margin at the last plot, and then draw the legend. However, when I do this,

  1   2   >