Re: [R] read multiple large files into one dataframe

2010-01-25 Thread Brad Patrick Schneid
Thats it Hadley!!! Thank you. -- View this message in context: http://n4.nabble.com/read-multiple-large-files-into-one-dataframe-tp891835p1290089.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

Re: [R] Matching a character in a string

2010-01-25 Thread Fabrice DELENTE
> grep("o", "hello") Thanks, I hadn't noticed R has grep included! -- Fabrice DELENTE __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

Re: [R] Hypothsis simulation

2010-01-25 Thread Jim Silverton
I wish to simulate: Ho: Odds Ratio =1 H1 Odds Ratio <> 1 Can any of the R users show me how to generate this data for say 20% from Ho and 80% from H1? Thanks, Jim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list http

[R] Problem with "nls" function

2010-01-25 Thread hammadi jbeli
Dear R users, I have a response variable in a csv file called "y" and a matrix of predictor variables in a csv file called "mat". I have used the function "nls" I have specified the nonlinear relation between these variable.The code I have witten is called Rprog which begins with the phrase: L.mino

[R] a question about the variance of growth model

2010-01-25 Thread 孟欣
Hi all: In the growth model (Ref.Multilevel Modeling in R (2.3)),I have a question about the variance: On p.73, it says:"To model decreasing variance one can use the varExp option. In cases where variance increases can use the varFixed option (see Pinheiro & Bates, 2000 for details)." My que

Re: [R] More than on loop??

2010-01-25 Thread jim holtman
It sounds like you want to use 'barplot' like below given that it appears that the value in x.c would be the matrix you want to graph: x.c <- cleaved(x) barplot(x.c, col=c("#FF", "#CC", "#99", "#66", "#33", "#00", "#FFCCFF", "#FF", "#FFCC99", "#FFCC66", "#FFCC33",

Re: [R] R2WinBUGS/ trap

2010-01-25 Thread Ben Bolker
julien martin gmail.com> writes: > > I am generating 1000 replicate data sets in R, each data set is then > analyzed with WinBUGS in batch mode using R2WinBUGS. Unfortunately, > occasionally some data sets lead WinBUGS to open a "trap" window; and the > simulations are interrupted as result of t

Re: [R] More than on loop??

2010-01-25 Thread che
70% yes, the problem is i am trying to produce a graph similar to the one in attachments in this message, which represents the frequency of each letter "aminoacid" in the cleaved function and the noncleaved function. some thing else i added to the attachments is the pattern which seemingly working

Re: [R] ff package: ff objects don't reload completely on NFS drives from a different machine

2010-01-25 Thread Hao Cen
Hi Jens, Thanks for the suggestions. I tried closing the ff file on one nfs client and open that file from another client. It doesn't work. Jeff -Original Message- From: Jens Oehlschlägel [mailto:oehl_l...@gmx.de] Sent: Monday, January 25, 2010 5:07 PM To: h...@andrew.cmu.edu Cc: R-help@

Re: [R] problem with "nls" function

2010-01-25 Thread Walmes Zeviani
I supose you are following the SAS formulation style. R has a different formulation style, such as: da <- expand.grid(A=factor(1:3), x=1:10) da$y <- as.numeric(da$A)*da$x/(1.2+da$x)+rnorm(da$x, 0, 0.1) m0 <- nls(y~Asym[A]*x/(Time[A]+x), data=da, start=list(Asym=c(1,2,3), Time=c(1,1,1))) summary(

Re: [R] More than on loop??

2010-01-25 Thread jim holtman
Does this do what you want? You were not initializing the plot before calling 'rect'. also it appears that you only have to call cleaved(x) once to get the matrix and then use it in the loop -- more efficient that way. x<-read.table("C:/hiv.txt", header=TRUE) num<-nrow(x) AA<-c('A','C','D','E','

Re: [R] More than on loop??

2010-01-25 Thread che
hopefully it is here, two files, one of them is .dat and the others is .txt, just in case. http://n4.nabble.com/file/n1290026/hiv.dat hiv.dat http://n4.nabble.com/file/n1290026/hiv.txt hiv.txt -- View this message in context: http://n4.nabble.com/More-than-on-loop-tp1015851p1290026.html Sent f

[R] problem with "nls" function

2010-01-25 Thread hammadi jbeli
Dear R users, I have a response variable in a csv file called "y" and a matrix of predictor variables in a csv file called "mat". I have used the function "nls" I have specified the nonlinear relation between these variable.The code I have witten is called Rprog which begins with the phrase: L.mino

Re: [R] More than on loop??

2010-01-25 Thread che
here you are the whole code, and the data is attached: > x<-read.table("C:/Uni/502/CA2/hiv.dat", header=TRUE) > num<-nrow(x) > AA<-c('A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y') > nc<-x$Label[61:308] > c<-x$Label[nc] > noncleaved<-function(x) + { + y<-matrix(0,2

Re: [R] Matching a character in a string

2010-01-25 Thread GlenB
See also ?unlist (you can unlist(strsplit(...)) for the same effect -- View this message in context: http://n4.nabble.com/Matching-a-character-in-a-string-tp1289795p1290011.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pro

[R] newton method for single nonlinear equation

2010-01-25 Thread Roslina Zakaria
Hi r-users,   I would like to solve for z values using newton iteration method.  I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn.  There seem to be some output but what I expected is a vector of z values.  Thank you so much for any he

Re: [R] Matching a character in a string

2010-01-25 Thread GlenB
The output from strsplit("hello","") is not suitable as input for the second argument for charmatch. compare with: charmatch("o",strsplit("hello","")[[1]]) -- View this message in context: http://n4.nabble.com/Matching-a-character-in-a-string-tp1289795p1289976.html Sent from the R help maili

[R] Summer internships

2010-01-25 Thread Nicholas Lewin-Koh
Hi I am forwarding this announcement the list, as one of our projects is focused on statistical computing and graphics. Among our other projects we have a project which involves linking dynamic graphics to genomic information. Graduate students with a strong interest in computing are urged to a

Re: [R] Microsoft SQL Server and R

2010-01-25 Thread Seeliger . Curt
r-help-boun...@r-project.org wrote on 01/25/2010 03:32:41 PM: Jim writes to David: > These days I tend to use RJDBC http://www.rforge.net/RJDBC/ which is a > bit less of a hassle. > > Hint use the jtds driver http://jtds.sourceforge.net/ > ... > > > > I have a client running Microsoft SQL Server.

Re: [R] Min hash

2010-01-25 Thread Bert Gunter
Did you perchance try RSiteSearch("hash",restr="func") or check the "hash" package on CRAN (or BioConductor or ...) ?? No clue whether any of this is relevant, but it seems like a sensible first place to look. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- Fro

Re: [R] Microsoft SQL Server and R

2010-01-25 Thread Jim Porzak
David, You can certainly use RODBC to get to MS SQL, once you configure the ODBC connection in windows. These days I tend to use RJDBC http://www.rforge.net/RJDBC/ which is a bit less of a hassle. Hint use the jtds driver http://jtds.sourceforge.net/ HTH, Jim Porzak Ancestry.com San Francisco,

[R] Min hash

2010-01-25 Thread Nathan Stephens
Anyone know of a min hash algorithm written in R? --Nathan [[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/posting-

Re: [R] Data transformation

2010-01-25 Thread Gabor Grothendieck
Try this: > t(apply(x, 1, function(r) table(factor(r, levels = seq_len(max(x)) 1 2 3 4 5 6 7 8 9 10 [1,] 1 0 1 0 0 0 0 0 0 0 [2,] 0 2 0 0 0 0 0 0 0 0 [3,] 0 0 0 1 0 0 1 0 0 0 [4,] 0 0 0 0 0 1 0 1 0 0 [5,] 0 0 0 0 1 0 0 0 0 1 If you use aaply in the plyr package instead of apply then

Re: [R] Data transformation

2010-01-25 Thread Seeliger . Curt
r-help-boun...@r-project.org wrote on 01/25/2010 02:39:32 PM: > x <- read.table(textConnection("col1 col2 > 3 1 > 2 2 > 4 7 > 8 6 > 5 10"), header=TRUE) > > I want to rewrite it as below: > > var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 > 1 0 1 0 0 0 0

Re: [R] Data transformation

2010-01-25 Thread Lisa
Thank you so much. Lisa -- View this message in context: http://n4.nabble.com/Data-transformation-tp1289899p1289915.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

[R] Microsoft SQL Server and R

2010-01-25 Thread David Scott
I have a client running Microsoft SQL Server. I am interested in ways of accessing data from this server using R. I would welcome any information about how this can be done. I have a reasonable grasp of SQL and have experience with MySQL and RODBC but don't know anything much about Microsof

Re: [R] Data transformation

2010-01-25 Thread Steve Lianoglou
Hi, On Mon, Jan 25, 2010 at 5:39 PM, Lisa wrote: > > Dear all, > > I  have a dataset that looks like this: > > x <- read.table(textConnection("col1 col2 > 3 1 > 2 2 > 4 7 > 8 6 > 5 10"), header=TRUE) > > I want to rewrite it as below: > > var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 >    1

Re: [R] Data transformation

2010-01-25 Thread Sarah Goslee
Well, I have no idea how to get from one to the other. There's col1 and col2 but no var1 var2 var3, etc. I thought perhaps col1 was the row index and col2 was the column index, but that doesn't match up either, and not all the cell values are 1. So you will need to explain more clearly what you in

[R] Data transformation

2010-01-25 Thread Lisa
Dear all, I have a dataset that looks like this: x <- read.table(textConnection("col1 col2 3 1 2 2 4 7 8 6 5 10"), header=TRUE) I want to rewrite it as below: var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 1 0 1 0 0 0 0 0 0 0 0 2

Re: [R] ff package: ff objects don't reload compl etely on NFS drives from a different machine

2010-01-25 Thread Jens Oehlschlägel
Try to close the file on the first nfs client before reopening it on the second nfs client. NFS has something called "close-to-open cache consistency". This means that two clients which have the same nfs file open, cannot rely on seeing the updates from the respective other client. If one clients

[R] Postscript graphs

2010-01-25 Thread Lu Wang
Hi, I tried to use the following commands to create a postscript pie chart using R: postscript(file="H:/piechart.eps") # then I wrote my commands to generate the pie chart pie(filename,labels=,col=,radius=0.6) dev.off() After I ran those commands, instead of giving the pie chart, it showed > de

Re: [R] PCA: Showing file datalabels on biplot

2010-01-25 Thread colin1
Many thanks Kevin, As a result of your advice, and that of other helpful experts, I ended up with the following script, which worked brilliantly: cat <-read.table("R855868825matrix.csv", sep=",", header=T) head (cat, n=24) catopsis = cat[,-1] row.names(catopsis) = cat$sample pca <- prcomp

Re: [R] question on sqldf syntax

2010-01-25 Thread Gabor Grothendieck
On Mon, Jan 25, 2010 at 2:17 PM, GL wrote: > > trying to structure sql to merge two datasets. structure follows: > > dbs.possible.combos (all possible combinations of dates and places) > Date Place > 1/1/10 N-01 > 1/1/10 S-02 > 1/2/10 N-01 > 1/2/10 S-02 > etc... > > dbs.aggregate (the raw data agg

Re: [R] question on sqldf syntax

2010-01-25 Thread lith
On 25 Jan., 20:26, GL wrote: > Actually, better sql would likely be: > > dbs.final <- sqldf("select * from dbs.possible.combos left join > dbs.aggregate using (Date,Place)") > > but this still doesn't work I'd suspect name mangling to cause the problem: http://code.google.com/p/sqldf/#2._Why_does

Re: [R] R Output and ArcGIS

2010-01-25 Thread Paul Hiemstra
Steve Murray wrote: Dear all, I've been using R on a Mac to process some data for export to ArcMap GIS (which only runs on Windows). ArcMap seems to require tab-delimited data (my data are in 3 columns), so I've been using the sep="\t" argument. However, this resulted in strange end-of-line ch

Re: [R] Two == expressions in bquote

2010-01-25 Thread Bert Gunter
Peter's way is better than mine. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Dalgaard Sent: Monday, January 25, 2010 12:57 PM To: Larry Hotchkiss Cc: r-help@r-project.org

Re: [R] Two == expressions in bquote

2010-01-25 Thread Bert Gunter
I think that careful examination will show that Henrique's solution is not quite right: the text '=' character is slightly different than the symbol font character. This is admittedly nitpicking, but ... try instead: text(2,8,bquote(paste(delta==mu^2,phantom()==.(mu^2 Cheers, Bert Gunter Ge

Re: [R] Matching a character in a string

2010-01-25 Thread Paul Hiemstra
Fabrice DELENTE wrote: Hello. Sorry for this very basic question but I didn't find (of didn't understand) the answer either in the help or in the online guide. I have a string, let's say "hello". I want to know if there is some character in it, let's say an 'o'. I tried charmatch("o", str

Re: [R] Two == expressions in bquote

2010-01-25 Thread Peter Dalgaard
Larry Hotchkiss wrote: Hi, I want to put text on a plot containing something like: a = b^2 = using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2))# This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(de

[R] Matching a character in a string

2010-01-25 Thread Fabrice DELENTE
Hello. Sorry for this very basic question but I didn't find (of didn't understand) the answer either in the help or in the online guide. I have a string, let's say "hello". I want to know if there is some character in it, let's say an 'o'. I tried > charmatch("o", strstplit("hello","")) but it

Re: [R] Issue using tapply

2010-01-25 Thread LCOG1
Ista you have suggested the correct solution, i didnt htink it would matter not having that value but it did. Things work as they should now, thankyou -- View this message in context: http://n4.nabble.com/Issue-using-tapply-tp1289681p1289764.html Sent from the R help mailing list archive at Nabb

Re: [R] Two == expressions in bquote

2010-01-25 Thread Henrique Dallazuanna
Try this: text(2,8, bquote(delta~'='~mu^2 == .(mu^2))) On Mon, Jan 25, 2010 at 6:00 PM, Larry Hotchkiss wrote: > Hi, > > I want to put text on a plot containing something like: a = b^2 = numeric value of b> using bquote. > > Example: > >  mu = 5 >  plot(1:10,1:10) >  text(2,8, bquote(delta == m

Re: [R] Error in plot.new()

2010-01-25 Thread jean luc picard
My distribution is Ubuntu. xwininfo: Window id: 0x441 "R Graphics: Device 2 (ACTIVE)" Absolute upper-left X: 558 Absolute upper-left Y: 27 Relative upper-left X: 558 Relative upper-left Y: 27 Width: 787 Height: 744 Depth: 24 Visual Class: TrueColor Border width: 1 Cla

[R] Two == expressions in bquote

2010-01-25 Thread Larry Hotchkiss
Hi, I want to put text on a plot containing something like: a = b^2 = using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2))# This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(delta == mu^2 == .(mu^2)))

Re: [R] Issue using tapply

2010-01-25 Thread Henrique Dallazuanna
Try this: tapply(Emp.Et.Em[EtToEm..$Et], EtToEm..$Em, sum, na.rm = TRUE) On Mon, Jan 25, 2010 at 4:57 PM, LCOG1 wrote: > > Hello all, >   I am trying to use the tapply function to sum some values and change the > column names of the resulting vector. > > I input >     Emp  Et > 1  10565 ACC > 2

Re: [R] Issue using tapply

2010-01-25 Thread Ista Zahn
I think the problem is that there is no value for RST in Emp.Et.Em. -Ista On Mon, Jan 25, 2010 at 6:57 PM, LCOG1 wrote: > > Hello all, >   I am trying to use the tapply function to sum some values and change the > column names of the resulting vector. > > I input >     Emp  Et > 1  10565 ACC > 2

Re: [R] Delete components of a list

2010-01-25 Thread Lisa
It works well. Thank you very much. Lisa -- View this message in context: http://n4.nabble.com/Delete-components-of-a-list-tp1289732p1289745.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

[R] R2WinBUGS trap

2010-01-25 Thread julien martin
I am generating 1000 replicate data sets in R, each data set is then analyzed with WinBUGS in batch mode using R2WinBUGS. Unfortunately, occasionally some data sets lead WinBUGS to open a "trap" window; and the simulations are interrupted as result of the message. Is there any ways to set R2WinBUGS

Re: [R] Delete components of a list

2010-01-25 Thread Henrique Dallazuanna
Try this: # Exclude the first column: lapply(l, '[', -1) # Remove the second row: lapply(l, '[', , i = -2) On Mon, Jan 25, 2010 at 5:37 PM, Lisa wrote: > > Dear all, > > I have a question about deleting components of a list. For example, I have a > list that looks like this: > > [[1]] > var1

[R] R2WinBUGS/ trap

2010-01-25 Thread julien martin
I am generating 1000 replicate data sets in R, each data set is then analyzed with WinBUGS in batch mode using R2WinBUGS. Unfortunately, occasionally some data sets lead WinBUGS to open a "trap" window; and the simulations are interrupted as result of the message. Is there any ways to set R2WinBUGS

[R] Delete components of a list

2010-01-25 Thread Lisa
Dear all, I have a question about deleting components of a list. For example, I have a list that looks like this: [[1]] var1 var2 var3 134 221 [[2]] var1 var2 var3 251 217 [[3]] var1 var2 var3 167 384 Ho

Re: [R] question on sqldf syntax

2010-01-25 Thread GL
Actually, better sql would likely be: dbs.final <- sqldf("select * from dbs.possible.combos left join dbs.aggregate using (Date,Place)") but this still doesn't work -- View this message in context: http://n4.nabble.com/question-on-sqldf-syntax-tp1289707p1289718.html Sent from the R help maili

Re: [R] problem with the precision of numbers

2010-01-25 Thread Hans W Borchers
kayj yahoo.com> writes: > > > Hi All, > > thank you all for your help. I have tried Bill's script and it works! so I > am trying to think what was the problem and it looks like it i sthe > precision. so you defined a function of the precision and evaluates at > precision=500. Bill, I was wonder

[R] question on sqldf syntax

2010-01-25 Thread GL
trying to structure sql to merge two datasets. structure follows: dbs.possible.combos (all possible combinations of dates and places) Date Place 1/1/10 N-01 1/1/10 S-02 1/2/10 N-01 1/2/10 S-02 etc... dbs.aggregate (the raw data aggregated by date and location) Date Place Days 1/1/10 N-01 6 1/1/1

Re: [R] z value from wilcox.exact

2010-01-25 Thread Peter Ehlers
netrunner wrote: Hi, does anibody know if is possible to have as ouptut from the wilcox.exact function also a z value to "link" the U value at the normal distribution? I don't think that wilcox.exact() provides this directly. I would use wilcox_test() in pkg 'coin'. If you do want to restri

[R] Issue using tapply

2010-01-25 Thread LCOG1
Hello all, I am trying to use the tapply function to sum some values and change the column names of the resulting vector. I input Emp Et 1 10565 ACC 2 7515 ADM 3625 AGF 4 6243 CNS 5 12721 EDU 6 3924 FIN 7 18140 HLH 8 3686 INF 9 15841 MFG 10 243 MIN 11 1864 MNG 12

Re: [R] R Output and ArcGIS

2010-01-25 Thread Michael Denslow
Hi Steve, On Mon, Jan 25, 2010 at 12:54 PM, Steve Murray wrote: > > Dear all, > > I've been using R on a Mac to process some data for export to ArcMap GIS > (which only runs on Windows). ArcMap seems to require tab-delimited data (my > data are in 3 columns), so I've been using the sep="\t" arg

[R] (no subject)

2010-01-25 Thread Chuck White
Hello -- I would like to know of a more efficient way of writing the following piece of code. Thanks. options(stringsAsFactors=FALSE) orig <- c(rep('',10),rep('',20),rep('',30),rep('',40)) orig.unique <- unique(orig) system.time(df <- as.data.frame

Re: [R] Quartiles and Inter-Quartile Range

2010-01-25 Thread David Freedman
please do some reading - I *think* the main difference is that the x and y axes are reversed, but I really don't know what SAS prints out there are a many 'defaults' that are rather arbitrary - sometimes SAS uses 1, while R uses another ??qqnorm brings up a list of functions, including stats::qq

Re: [R] Rearranging long dataframe for printing in Sweave (andrecoding a factor)

2010-01-25 Thread Jean-Louis Abitbol
Ista, Thanks, you got the question perfectly well. And the proposed solution gets me on my way. I just corrected the typo n.cbroup to n.cgroup. Thanks again, Best wishes, JL On Mon, 25 Jan 2010 17:42 +, "Ista Zahn" wrote: > If I understand the OP's issue correctly, this is how I would do

Re: [R] Quartiles and Inter-Quartile Range

2010-01-25 Thread Peter Ehlers
eeramalho wrote: Thank you David. I got it now. Maybe you can help again. I am typing the following code to draw a QQ plot but the line does not look right? *** qqnorm(cbiomass) qqline(cbiomass) *** the graph looks very different from the graph generated

Re: [R] problem with the precision of numbers

2010-01-25 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of kayj > Sent: Monday, January 25, 2010 8:04 AM > To: r-help@r-project.org > Subject: Re: [R] problem with the precision of numbers > > > Hi All, > > thank you all for your help.

Re: [R] More than on loop??

2010-01-25 Thread che
can i ask your help again, please excuse my questions: It is working perfectly now, i still have the last part which i tried a lot with but still i can’t translate it properly for the computer through R. I need to draw rectangular based on the frequency of each residue, actually i found the patter

Re: [R] Quartiles and Inter-Quartile Range

2010-01-25 Thread eeramalho
Thank you David. I got it now. Maybe you can help again. I am typing the following code to draw a QQ plot but the line does not look right? *** qqnorm(cbiomass) qqline(cbiomass) *** the graph looks very different from the graph generated by SAS. Thank you

Re: [R] binary

2010-01-25 Thread Peter Ehlers
Val wrote: Hi all Assume I have a data set xx; Group: 1=group1 , 2=group2 IQ: 1= High, 0 =low fit <- glm(IQ ~group, data = xx, family = binomial()) summary(fit) Results Estimate Std. Error z value Pr(>|z|) (Intercept) -2.554560.210 -12.273 < 5e-16 *** group

Re: [R] R Output and ArcGIS

2010-01-25 Thread milton ruser
Hi Steve, As I have no problem with this because I run windows, I prefere to use .txt files. But may be on your case you install xlsReadWrite (or WriteRead), because .xls file works fine for ArcGis. Remember not use complex (like having dots) or large names because some times you get error on Arc

[R] R Output and ArcGIS

2010-01-25 Thread Steve Murray
Dear all, I've been using R on a Mac to process some data for export to ArcMap GIS (which only runs on Windows). ArcMap seems to require tab-delimited data (my data are in 3 columns), so I've been using the sep="\t" argument. However, this resulted in strange end-of-line characters when displa

Re: [R] locfit questions/problems

2010-01-25 Thread Liaw, Andy
Just replacing preplot() with predict() should be fine. BTW, it's always a good idea to specify the version of the package you're using as well. Best, Andy From: mh...@berkeley.edu > > Hi, > > I'm trying to work through the examples and code in Loader's > LOCAL REGRESSION AND LIKELIHOOD, and

Re: [R] Rearranging long dataframe for printing in Sweave (andrecoding a factor)

2010-01-25 Thread Ista Zahn
If I understand the OP's issue correctly, this is how I would do it: library(Hmisc) test <- data.frame(conc=trunc(runif(1000, 1,1000)),nam=rep(c("A","B"),500)) final <- cbind(test[1:200,], test[201:400,], test[401:600,], test[601:800,], test[801:1000,]) latex(final, cgroup=c(paste("Obs. ",seq(1

Re: [R] Fwd: how to write a long string to many lines in a fasta text file

2010-01-25 Thread jim holtman
?strwrap On Mon, Jan 25, 2010 at 11:02 AM, mary guo wrote: > Hi, > I want to write a long string to many lines in R, but I do not know how to > do it. > Hope to get your help. > > Thanks. > > Mary > >        [[alternative HTML version deleted]] > > __ >

Re: [R] problem with the precision of numbers

2010-01-25 Thread kayj
Hi All, thank you all for your help. I have tried Bill's script and it works! so I am trying to think what was the problem and it looks like it i sthe precision. so you defined a function of the precision and evaluates at precision=500. Bill, I was wondering how did you choose 500? is it arbitrar

Re: [R] reshape package cast() function

2010-01-25 Thread Ista Zahn
OK, I think I figured it out (each level of id corresponds to only one level of variable in m.test). Thanks, Ista On Mon, Jan 25, 2010 at 4:59 PM, Ista Zahn wrote: > Hi all, > I think I'm cracking up. Please help me understand why I'm getting > different results with m.test and m.test2 in the exa

[R] Fwd: how to write a long string to many lines in a fasta text file

2010-01-25 Thread mary guo
Hi, I want to write a long string to many lines in R, but I do not know how to do it. Hope to get your help. Thanks. Mary [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] summing a large, partitioned data frame

2010-01-25 Thread Benilton Carvalho
check aggregate() (the examples are quite helpful) b On Mon, Jan 25, 2010 at 4:07 PM, wrote: > Dear R community, > I'm trying to develop a fast way of summing specific rows of a large data > frame. > Here is an example of the kind of data frames I'm dealing with: > >> refls > H K L M/I

Re: [R] PCA: Showing file datalabels on biplot

2010-01-25 Thread Kevin Wright
str(catopsis) shows no labels, so how can biplot know what to use? Try this before call prcomp: colnames(catopsis) <- c('a','b','c','d') rownames(catopsis) <- cat$sample Also, see the 'reshape' package for easier data manipulation. Kevin On Mon, Jan 25, 2010 at 10:39 AM, colin1 wrote: > > Th

[R] reshape package cast() function

2010-01-25 Thread Ista Zahn
Hi all, I think I'm cracking up. Please help me understand why I'm getting different results with m.test and m.test2 in the example below. > library(reshape) Loading required package: plyr > > m.test <- data.frame(id = factor(rep(1:10, 2)), > variable=rep(c("var1","var2"),10), value=rnorm(20)) >

[R] PCA: Showing file datalabels on biplot

2010-01-25 Thread colin1
The script below successfully produces a biplot of the data but the 'site names' (rows) and the names of the 'response variables' (columns) are shown as simple numerals (rather than the column and row names). How might I 'enforce' the use of the row/column names used in the datafile (section of da

Re: [R] binary

2010-01-25 Thread Val
Thanks for your response. Do you mean that both the log-odds and odd ratio have the same meaning? My question is that the log-odd estimate 0.3618 is it for group1 or group2? normally 1vs2, glm takes 2 as reference, in the group1 the IQ increase by 0.3618compared to group 2 What does

[R] z value from wilcox.exact

2010-01-25 Thread netrunner
Hi, does anibody know if is possible to have as ouptut from the wilcox.exact function also a z value to "link" the U value at the normal distribution? thank you! netrunner -- View this message in context: http://n4.nabble.com/z-value-from-wilcox-exact-tp1289481p1289481.html Sent from the R

Re: [R] Help with subset

2010-01-25 Thread Jerry Floren
Hi Peter, Thanks again for showing me how to do this. This will save me hours of tedious work, and I can't believe how quickly R reads in and processes my data. It was taking about 40 minutes when I used Word's mail merge for this. When I first switched from Excel to R, R was so much faster than

[R] summing a large, partitioned data frame

2010-01-25 Thread james.foadi
Dear R community, I'm trying to develop a fast way of summing specific rows of a large data frame. Here is an example of the kind of data frames I'm dealing with: > refls H K L M/ISYM BATCH I SIGI 43247 1 0 5 2179 61.44117 2.20553 1040 1 0 5257 6 15.16316

Re: [R] binary

2010-01-25 Thread Mohamed Lajnef
Hi val, Val a écrit : Hi all Assume I have a data set xx; Group: 1=group1 , 2=group2 IQ: 1= High, 0 =low fit <- glm(IQ ~group, data = xx, family = binomial()) summary(fit) Results Estimate Std. Error z value Pr(>|z|) (Intercept) -2.554560.210 -12.273 < 5e-16 **

[R] Rscript is not loading some of one of the standard R packages

2010-01-25 Thread petertait
Hi, I have a script I can run step by step through the R interpreter and it works fine. I then run as a shell script with Rscript and it fails. The error message comes when I am creating a model matrix with model.matrix.default(). Error in `contrasts<-`(`*tmp*`, value = "contr.Treatment")

[R] glmnet in caret packge

2010-01-25 Thread Alex Roy
Dear all, I want to train my model with LASSO using caret package (glmnet). So, in glmnet, there are two parameters, alpha and lambda. How can I fix my alpha=1 to get a lasso model? con<-trainControl(method="cv",number=10) model <- train(X, y, "glmnet", metric="RMSE",tuneLength =

Re: [R] How to define degree=1 in mgcv

2010-01-25 Thread Simon Wood
On Monday 25 January 2010 02:40, hellen lee wrote: > Hi, all > > I have a question on mgcv and ns. Now I want to compare the results from > glm, gam and ns. Take a simple model y~x for example. > > glm1 = glm(y~x, data=data1) > gam1 = gam(y~s(x), data=data1) > ns1 = glm(y~ns(x),data=data1) > > In o

Re: [R] sequence of equal-length numbers (for filenames)

2010-01-25 Thread Don MacQueen
One can also use formatC() with the flag option. -Don At 10:47 AM -0200 1/25/10, Henrique Dallazuanna wrote: Try sprintf: sprintf("%03d", Sequence) sprintf("file%03d.dat", Sequence) On Mon, Jan 25, 2010 at 10:39 AM, Îroutík wrote: Dear R-users, I'd like to create filenames in a mask

Re: [R] Display of results

2010-01-25 Thread Robert Baer
I don't know this test, but as written, LM <- Lo.Mac(y,kvec), will just make an assignment. To display the result you could write: (LM <- Lo.Mac(y,kvec)) - Original Message - From: "Hichem Ben Khedhiri" To: Sent: Sunday, January 24, 2010 9:47 AM Subject: [R] Display of results D

[R] Same y-axis on multiple plots?

2010-01-25 Thread Andreas Bergstrøm
Greetings, I am attempting to use R throug PL/R in PostgreSQL to make several graphs (they show usage over time for radiochannels). However, as some never go above 100 in a 24 hour period, and others go well over 500, they get different y-axis values (which normally would be a good thing). How

[R] binary

2010-01-25 Thread Val
Hi all Assume I have a data set xx; Group: 1=group1  , 2=group2 IQ:  1= High, 0 =low fit <- glm(IQ ~group, data = xx, family = binomial()) summary(fit) Results    Estimate Std. Error z value Pr(>|z|) (Intercept) -2.55456    0.210 -12.273  < 5e-16 *** group  0.36180

Re: [R] Rearranging long dataframe for printing in Sweave (andrecoding a factor)

2010-01-25 Thread Steve Sidney
JL The solution which was proposed by Joseph Wright on the Latex Community Forum was as follows 1) Use R to create the table and then save it in csv format 2) Use LaTex to print the table. 3) LaTex on it's own is not able to do this and you must install the 'datatool' package. 4) What 'da

Re: [R] R Memory Problem

2010-01-25 Thread Johann Hibschman
prem_R writes: > I'm running predictive analytics using R and to calibrate my model i > used to adjust the variables used in the model and the problem happens > here.R just runs out of memory .I tried garbage cleaning also. I'm analyzing a 8 GB data set using R, so it can certainly handle large

Re: [R] Where can I get training for R-PLUS

2010-01-25 Thread Romain Francois
On 01/25/2010 03:02 PM, jamy wrote: Hi friends, Does any one know ,where can I get free training for R-PLUS.If any one know please let me know. Thanks, James. http://lmgtfy.com/?q=R-plus+training -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free

[R] frequency table help

2010-01-25 Thread Paola Pesci
Hi, I have a dataset like this: Specieslength (cm) A 12.4 B 45 A 34.6 C 73 C 24.5 D 4.5 .. I'm trying to obtain a barplot with the class length in x (fixed classes, 5 cm) and the number of

[R] Where can I get training for R-PLUS

2010-01-25 Thread jamy
Hi friends, Does any one know ,where can I get free training for R-PLUS.If any one know please let me know. Thanks, James. -- View this message in context: http://n4.nabble.com/Where-can-I-get-training-for-R-PLUS-tp1289371p1289371.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] read multiple large files into one dataframe

2010-01-25 Thread hadley wickham
On Mon, Jan 25, 2010 at 4:43 AM, Paul Hiemstra wrote: > Brad Patrick Schneid wrote: >> >> ###  The following is very helpful # listOfFiles <- >> list.files(pattern= ".txt") d <- do.call(rbind, lapply(listOfFiles, >> read.table)) ### >> >> but what if each file c

Re: [R] Quantile loess smother?

2010-01-25 Thread Dieter Menne
Tal Galili wrote: > > Something that will be a combination of what rq (package quantreg} does, > with loess. > qss in quantreg comes close. Dieter -- View this message in context: http://n4.nabble.com/Quantile-loess-smother-tp1289277p1289349.html Sent from the R help mailing list archive a

Re: [R] R Memory Problem

2010-01-25 Thread jim holtman
How big is your data set (use object.size on the object and 'str'). Exactly what statements are you executing? Exactly what error message are you getting? On Mon, Jan 25, 2010 at 5:44 AM, prem_R wrote: > > Is anyone could help me to resolve this problem?I'm presently an SAS user for > my applica

Re: [R] sequence of equal-length numbers (for filenames)

2010-01-25 Thread Henrique Dallazuanna
Try sprintf: sprintf("%03d", Sequence) sprintf("file%03d.dat", Sequence) On Mon, Jan 25, 2010 at 10:39 AM, Žroutík wrote: > Dear R-users, > > I'd like to create filenames in a mask "file000.dat" numbered from 1 to e.g. > 123. The last problem I'm dealing with is creating the sequence of numbe

[R] sequence of equal-length numbers (for filenames)

2010-01-25 Thread Žroutík
Dear R-users, I'd like to create filenames in a mask "file000.dat" numbered from 1 to e.g. 123. The last problem I'm dealing with is creating the sequence of numbers with equal length, i.e. 001, 002, 023, 024, 122, 123. The closest I got is by a repetition: Sequence <- c(1:123) for(i in

Re: [R] Quantile loess smother?

2010-01-25 Thread Gavin Simpson
On Mon, 2010-01-25 at 14:08 +0200, Tal Galili wrote: > Hello all, > > I wish to fit a loess smother to a plot of Y`X, but in predicting the 95% > quantile. > Something that will be a combination of what rq (package quantreg} does, > with loess. > > Is there a function/method for doing this? ?rqs

  1   2   >