[R] data frame manipulation with zero rows

2010-05-31 Thread arnaud Gaboury
Dear group, Here is the kind of data.frame I obtain every day with my function : futures <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "LIVE CATTLE Aug/10", "LIVE CATTLE Aug/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR N

Re: [R] Faster matrix operation?

2010-05-31 Thread Bill.Venables
> xyzs <- matrix(rnorm(3*10,0,1),ncol=3) > > V <- c(2,3,4) > system.time(vx <- apply(t(xyzs) * V, 2 ,sum)) user system elapsed 1.060.021.08 > > system.time(wx <- as.vector(xyzs %*% V)) user system elapsed 0 0 0 > all.equal(vx, wx) [1] TRUE > ? -

[R] Faster matrix operation?

2010-05-31 Thread Remko Duursma
Dear R-helpers, I have a three-column matrix with lots of rows: xyzs <- matrix(rnorm(3*10,0,1),ncol=3) # And I am multiplying it with some vector V, and summing the rows (columns after t()) in this way: V <- c(2,3,4) system.time(vx <- apply(t(xyzs) * V, 2 ,sum)) Ok, this does not take long

Re: [R] arrange data

2010-05-31 Thread Bill.Venables
Here is one way. Suppose your data frame is called 'dat'. o <- with(dat, order(as.Date(paste(year, month, day, sep="-" newDat <- dat[o, c("year", "month", "day", "rain")] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rosl

[R] arrange data

2010-05-31 Thread Roslina Zakaria
Hi r-users,   I have a data below but I would like to rearrange my data so that it will be in the following format: year, month, day, rain.  I also would like the data to be arranged so that it will be continues for example year 1939 it will go from january 1 to december 31 and continue with yea

[R] n-dimensional vector plot

2010-05-31 Thread suman dhara
Sir, I have n p-dimensional regressor vectors corresponding to n responses. I want to plot n regressor vectors in R. Is it possible to plot them in R? If yes, please send me the code. Thanks, Suman Dhara [[alternative HTML version deleted]] __

[R] selecting monotone pattern of missing data from a dataframe with mixed pattern of missingness

2010-05-31 Thread john james
Dear R- User,   I have a dataset that looks like the following:   jh<-data.frame(  'id'=seq(1,10,1),   'time0'=c(8,5,8,8,9,NA,NA,2,4,5),   'time4'=c(NA,NA,9,8,NA,2,3,2,4,5),  'time8'=c(NA,2,8,NA,5,NA,2,3,NA,4),  'time12'=c(NA,2,NA,NA,NA,3,3,2,3,NA),   'sex'=c('m','f','m','m','f','f','f','m','f','m'

[R] mvbutils and trackObjs

2010-05-31 Thread Day, Roger S
Hello Colleagues, I've recently become a fan of Mark Bravington's mvbutils package for organizing analysis projects in a tree. Using cd(), Save(), fixr(), mlazy() etcetera solves nicely some of the nuisances that have worried or annoyed me and sometimes caused big problems over the years. We

[R] help on gtk

2010-05-31 Thread amalia Haye
I need help:   In DSC 2003 Working Papers (Draft Versions) http://www.ci.tuwien.ac.at/Conferences/DSC-2003/   I found some code that I want to practice with. But I also found, that the code was deprecated. Can anybody help me with this lines of code, how can I Re-write it with the new cod

[R] Printing page nmbers in multi-page pdf

2010-05-31 Thread Nevil Amos
Is it possible to print page numbers in pdf() with multiple pages? thanks Nevil Amos __ 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 pro

Re: [R] help with importing SPSS file

2010-05-31 Thread Orvalho Augusto
I am not sure about this but a sav file contains only one dataset. Meaning one table only. That table could be a joining of another tables. The R read.spss works with that on mind. Caveman On Tue, Jun 1, 2010 at 12:41 AM, wrote: > Hi, > > I have a SPSS .sav file which contains a database of

[R] New behavior of 'write.csv' append argument?

2010-05-31 Thread Steven Worthington
Dear R users, I have recently begun to reuse some functions I made several months ago. The scripts write to a .csv file using the 'write.csv' function with the append option set to TRUE. This used to work fine, albeit with the warning "appending column names to file". I upgraded to R version 2.11

[R] help with importing SPSS file

2010-05-31 Thread jinbo_bi
Hi, I have a SPSS .sav file which contains a database of multiple tables, and each table contains multiple variables. I used read.spss function to load the data A<-read.spss("datafile.sav",to.data.frame = TRUE) I see variable names, but do not know how to retrieve the table (or all the variabl

Re: [R] correcting a few data in a large data frame. Thanks

2010-05-31 Thread Mr. Natural
David: Thanks. I cannot believe that I had not tried the simple, lwf[lwf$bushno==145 , "bout3"] <- 1 I will mess around with the runs suggestion too. Thanks, Don -- View this message in context: http://r.789695.n4.nabble.com/correcting-a-few-data-in-a-large-data-frame-tp2237834p2237892.html S

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread Mr. Natural
Dennis. Tres cool. I will try it. regards, MN -- View this message in context: http://r.789695.n4.nabble.com/correcting-a-few-data-in-a-large-data-frame-tp2237834p2237891.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] Ignoring initial rows in a text file import

2010-05-31 Thread David Winsemius
On May 31, 2010, at 9:14 PM, jim holtman wrote: This is the case where '\t' is the tab character; '\\t' would give you the backslash followed by 't' which is not what you want. Both versions "worked" in the sense of returning the number of the line with "\tBegin Main\t" > txt <- "\n\tBegi

Re: [R] two questions about PLOT

2010-05-31 Thread Jannis
I would wote this question one of the most often asked questions here on that list ;-). Try searching the help archiwe (www.rseek.org) and you will find solutions. I would guess that you need to use something like: axis(4) as the sides of the plot are always numbered from bottom,left,top,right

Re: [R] Ignoring initial rows in a text file import

2010-05-31 Thread jim holtman
This is the case where '\t' is the tab character; '\\t' would give you the backslash followed by 't' which is not what you want. On Mon, May 31, 2010 at 8:19 PM, David Winsemius wrote: > > On May 31, 2010, at 8:14 PM, jim holtman wrote: > >> try this: >> >> input  <- readLines("yourfile.txt") >>

Re: [R] Y-axis range in histograms

2010-05-31 Thread Jannis
library(plotrix) break.axis() No clue how good this works with histograms though. HTH Jannis Aarne Hovi schrieb: Hi, I'm trying to create a histogram with R. The problem is that the frequency is high for a couple of x-axis categories (e.g. 1500) and low for most of the x-axis categorie

Re: [R] Ignoring initial rows in a text file import

2010-05-31 Thread David Winsemius
On May 31, 2010, at 8:14 PM, jim holtman wrote: try this: input <- readLines("yourfile.txt") # determine start start <- grep("\tBegin Main\t", input)[1] # first line if many Puzzled. I thought backslashes in grepping patterns needed to be doubled? I guess not. -- David. if (length(st

Re: [R] Ignoring initial rows in a text file import

2010-05-31 Thread jim holtman
try this: input <- readLines("yourfile.txt") # determine start start <- grep("\tBegin Main\t", input)[1] # first line if many if (length(start) == 1 && (start > 1)){ input <- tail(input, -(start - 1)) # delete heading lines } # find lines you want to delete breaks <- grep("\tBreak\t", input

Re: [R] Ignoring initial rows in a text file import

2010-05-31 Thread David Winsemius
On May 31, 2010, at 7:51 PM, Kevin Burnham wrote: I am trying to import a series of text files generated by stimulus presentation software. The problem that I am having is that the number of rows I need to skip is not fixed (depending on subject's pretest behavior) nor is the first row of

[R] Ignoring initial rows in a text file import

2010-05-31 Thread Kevin Burnham
I am trying to import a series of text files generated by stimulus presentation software. The problem that I am having is that the number of rows I need to skip is not fixed (depending on subject's pretest behavior) nor is the first row of the data I want always the same (the stimuli were presente

Re: [R] Vegan fisher.alpha error

2010-05-31 Thread Ben Bolker
Kang Min gmail.com> writes: > I have an error with fisher.alpha from the vegan package. > > > fisher.alpha(data[[1]]) > Error in nlm(Dev.logseries, n.r = n.r, p = p, N = N, hessian = > TRUE, ...) : > missing value in parameter > > I am trying to find fisher alpha for a list of 100 data frames

Re: [R] Sweave & png

2010-05-31 Thread Ben Bolker
Gildas Mazo curie.fr> writes: > Is there a simple way to save my figures in png instead of pdf with > Sweave ?? See http://sites.google.com/site/thibautjombart/r-packages (scroll to the bottom) __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Corrections for Solaris stuff in manual

2010-05-31 Thread Ben Bolker
Dr. David Kirkby onetel.net> writes: > > There are a number of errors in the R manual about Solaris. [snip] These comments should probably be posted on the R-devel list instead (*possibly* submitted as a bug too, but better to solicit comments on R-devel first) ___

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread Dennis Murphy
Hi: A simple diagnostic is to check how many distinct run lengths exist in a row - ideally, it should be one or two. If it's more than two, something is amiss. Hence, define f() as a function to determine the number of distinct runs in a given row and call the apply() function with it: f <- funct

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread David Winsemius
On May 31, 2010, at 5:29 PM, Mr. Natural wrote: The data frame is lwf that records the survival of bushes over an 8 year period. Years are called bouts. Dead bushes are recorded as zeros, and live bushes as "1." str(lwf) 'data.frame': 638 obs. of 9 variables: $ bushno: int 1 2 3 4 5 6

Re: [R] geepack installation problem?

2010-05-31 Thread Denis B
Dear Peter, Sincere thanks. Problem solved! Kind regards, Denis -- View this message in context: http://r.789695.n4.nabble.com/geepack-installation-problem-tp2236893p2237868.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

[R] correcting a few data in a large data frame

2010-05-31 Thread Mr. Natural
The data frame is lwf that records the survival of bushes over an 8 year period. Years are called bouts. Dead bushes are recorded as zeros, and live bushes as "1." str(lwf) 'data.frame': 638 obs. of 9 variables: $ bushno: int 1 2 3 4 5 6 7 8 9 10 ... $ bout1 : int 0 1 0 1 1 1 0 1 0 1 ...

Re: [R] [BioC] after updating biomaRt cannot connect any more

2010-05-31 Thread Sean Davis
On Mon, May 31, 2010 at 8:03 AM, wrote: > I recently updated R 2.10.1 Patched (2010-02-20 r51163) > This morning I reinstalled biomaRt using biocLite. > Now I can no more connect to biomaRt and even the following instruction is > hanging for a while until > the same error message pops up. > > l

Re: [R] solve_TSP ignores control data, or I'm reading the help doc incorrectly.

2010-05-31 Thread Michael Hahsler
the correct way to do it is solve_TSP(tsp, "2-opt", control=list(rep=56)) -Michael -- Dr. Michael Hahsler, Visiting Assistant Professor Department of Computer Science and Engineering Lyle School of Engineering Southern Methodist University, Dallas, Texas (214) 768-8878 * mhahs...@lyl

[R] Can not save plot to png file correctly

2010-05-31 Thread Felipe Carrillo
With ggsave the graph windows pops up but using: png("mypng.png") qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off() The graph is saved in the background Is there a way to hide the graph window when using ggsave? You can save as png like this too: library(ggplot2) data=data.frame(

Re: [R] geom_ribbon removes missing values

2010-05-31 Thread Hadley Wickham
Hi Karsten, There's no easy way to do this because behind the scenes geom_ribbon uses grid.polygon. Hadley On Sun, May 30, 2010 at 7:26 AM, Karsten Loesing wrote: > Hi everyone, > > it looks like geom_ribbon removes missing values and plots a single > ribbon over the whole interval of x values.

Re: [R] Can not save plot to png file correctly

2010-05-31 Thread Felipe Carrillo
You can save as png like this too: library(ggplot2) data=data.frame(   X=sample(10,1000,replace=T)   , Y=letters[1:10]) png("mypng.png") qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off()   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildli

Re: [R] Fancy Page layout

2010-05-31 Thread Noah Silverman
Lattice looks nice, but how can I put some summary text at the bottom? On 5/31/10 11:27 AM, RICHARD M. HEIBERGER wrote: > Use lattice. > > require(lattice) > ?lattice > ?xyplot > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] How to skip negative values when calculating average

2010-05-31 Thread David Winsemius
On May 31, 2010, at 2:06 PM, ecvet...@uwaterloo.ca wrote: I have a data frame 10 by 12 with positive and negative numbers. I want to select only the positive numbers and find the average. This calculates the average of everything: av5 <- subset(ER9r, Day == 253, select = c (Depth1j:Depth0.7

Re: [R] Fancy Page layout

2010-05-31 Thread baptiste auguie
Hi, ggplot2 or lattice could help you in creating the plots. Adding a summary will however require some play with Grid graphics; either using gridBase to mix lattice / ggplot2 output with base R graphics (e.g. textplot() from some package I forget), or you'll need to produce the textual summary i

[R] How to skip negative values when calculating average

2010-05-31 Thread ecvetano
I have a data frame 10 by 12 with positive and negative numbers. I want to select only the positive numbers and find the average. This calculates the average of everything: av5 <- subset(ER9r, Day == 253, select = c (Depth1j:Depth0.75j) av5 <- mean(av5) I need something along the lines of "sel

Re: [R] Fancy Page layout

2010-05-31 Thread RICHARD M. HEIBERGER
Use lattice. require(lattice) ?lattice ?xyplot [[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-guide.html a

[R] Fancy Page layout

2010-05-31 Thread Noah Silverman
Hi, Working on a report that is going to have a large number of graphs and summaries. We have 80 "groups" with 20 variables each. Ideally, I'd like to produce ONE page for each group. It would have two columns of 10 graphs and then the 5 number summary of the variables at the bottom. So, perhap

Re: [R] error on Windows OS [SEC=UNCLASSIFIED]

2010-05-31 Thread RICHARD M. HEIBERGER
M.Ribeiro, You can install on Windows from the tar.gz using the RTools. You need to set the PATH to find RTools and it looks like you skipped that step. Full details are in the R Extensions manual. Here are my notes, from several years ago as you can see by the R-2.8.0 paths and the Rtools29.exe

Re: [R] Put two plots side by side

2010-05-31 Thread Felipe Carrillo
Two different ways: library(ggplot2) x=5 size=50 A=data.frame(X=sample(x, size, replace=T), Y=sample(x, size, replace=T),a=rep(1:2,each=25));A # Facetting qplot(X,Y,data=A) + geom_jitter(position=position_jitter(width=.03)) + facet_grid(.~a) # Or with vp p=qplot(X, Y, data=A) + geom_jitter(positi

Re: [R] how to extract the 1st field from a vector of strings

2010-05-31 Thread Gabor Grothendieck
Try replacing a space followed by anything (.*) with the empty string: > x <- c("hsa-let-7a MIMAT062 Homo sapiens let-7a", + "hsa-let-7a* MIMAT0004481 Homo sapiens let-7a*", + "hsa-let-7a-2* MIMAT0010195 Homo sapiens let-7a-2*") > > sub(" .*", "", x) [1] "hsa-let-7a""hsa-let-7a*" "hsa-le

Re: [R] store and repeat data based on row names (loop, if statement)

2010-05-31 Thread RCulloch
Hi Jim, Many thanks - that has worked perfectly, thanks so much for your help! Best wishes, Ross -- View this message in context: http://r.789695.n4.nabble.com/store-and-repeat-data-based-on-row-names-loop-if-statement-tp2236928p2237628.html Sent from the R help mailing list archive at Nabble

Re: [R] Problems with apply

2010-05-31 Thread Joris Meys
Ivan is -partly- right. However, in the details it says as well that : If X is not an array but has a dimension attribute, apply attempts to coerce it to an array via as.matrix if it is two-dimensional (e.g., data frames) or via as.array. The main problem is the fact that what goes into the PromP

[R] Corrections for Solaris stuff in manual

2010-05-31 Thread Dr. David Kirkby
There are a number of errors in the R manual about Solaris. http://cran.r-project.org/doc/manuals/R-admin.html#Solaris 1) Firstly, Sun are now owned by Oracle, who bought them for $7 billion. 2) "(Recent Sun machines are Opterons (‘amd64’) rather than ‘x86’, but 32-bit ‘x86’ executables are th

Re: [R] error on Windows OS

2010-05-31 Thread Duncan Murdoch
On 31/05/2010 9:13 AM, M.Ribeiro wrote: Ok, I re-installed the Rtools (now Rtools211 because I was in another computer with R version 2.10) , and the message now when I tried to install the package was Warning: invalid package 'GWSR_1.0.tar.gz' Erro: ERROR: no packages specified Warning message

Re: [R] how to extract the 1st field from a vector of strings

2010-05-31 Thread Henrique Dallazuanna
My mistake: "\\1" is a backreference - see replacement argument in ?gsub. This work: gsub("(.*) MIMA.*", "\\1", desc) On Mon, May 31, 2010 at 2:00 PM, Juliet Hannah wrote: > What is the meaning of "\\1" here? Thanks. > > desc <- c("hsa-let-7a MIMAT062 Homo sapiens let-7a","hsa-let-7a* > MI

Re: [R] how to extract the 1st field from a vector of strings

2010-05-31 Thread Juliet Hannah
What is the meaning of "\\1" here? Thanks. desc <- c("hsa-let-7a MIMAT062 Homo sapiens let-7a","hsa-let-7a* MIMAT0004481 Homo sapiens let-7a*","hsa-let-7a-2* MIMAT0010195 Homo sapiens let-7a-2*") I'm missing something: > gsub(" MIMA.*", "\\1", desc) [1] "hsa-let-7a""hsa-let-7a*" "hsa-l

Re: [R] Problems with apply

2010-05-31 Thread Ivan Calandra
Hi, Here is what ?apply says: "Returns a vector or array or list of values obtained by applying a function to margins of an array." So apply() works on arrays, not on dataframes! Maybe lapply() would do what you're looking for (don't have time to look more into it) And you don't do "exactly the

[R] Sweave & png

2010-05-31 Thread Gildas Mazo
Hi, Is there a simple way to save my figures in png instead of pdf with Sweave ?? Thanks in advance, Gidas __ 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] Y-axis range in histograms

2010-05-31 Thread Duncan Murdoch
On 31/05/2010 10:49 AM, Aarne Hovi wrote: Hi, I'm trying to create a histogram with R. The problem is that the frequency is high for a couple of x-axis categories (e.g. 1500) and low for most of the x-axis categories (e.g. 50) http://r.789695.n4.nabble.com/file/n2237476/LK3_hist.jpg . When I c

Re: [R] How to delete the previously saved workspace restored

2010-05-31 Thread Yanwei Tan
Thanks a lot David! I use MacOSX and deleted the .RData file, then everything is fine. Best wishes, Wei On 5/31/10 2:49 PM, David Winsemius wrote: On May 31, 2010, at 5:10 AM, Yanwei Tan wrote: Dear all, I am a new user of R, here I have a question about remove the previous restored work

Re: [R] error on Windows OS

2010-05-31 Thread M.Ribeiro
Thanks for all the help, So let me undestand, The Rtools is currently installed in c:\Rtools\bin; c:\Rtools\perl\bin; c:\Rtools\MinGW\bin; %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; C:\Program Files (x86)\QuickTime\QTSystem\; C:\Program Files (x86)\SAS\Shared Files\Format

Re: [R] about heatmap

2010-05-31 Thread sheng zhao
Hi : try this: col=rev(your color) Regards, Sh.Z On Mon, May 31, 2010 at 2:16 PM, Jorge Ivan Velez wrote: > Hi there, > > Take a look at > > http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/heatmap/ > > HTH, > Jorge > > > On Mon, May 31, 2010 at 3:54 AM, 孟欣 <> wrote: > >

Re: [R] What does LOESS stand for?

2010-05-31 Thread Tal Galili
Hi Peter, If this article is correct: http://www.r-bloggers.com/abbreviations-of-r-commands-explained-250-r-abbreviations/ Loess stands for: [LO]cally [E]stimated [S]catterplot [S]moothing Best, Tal Contact Details:--- Contact

Re: [R] [BioC] after updating biomaRt cannot connect any more

2010-05-31 Thread Heidi Dvinge
On 31 May 2010, at 13:03, wrote: I recently updated R 2.10.1 Patched (2010-02-20 r51163) This morning I reinstalled biomaRt using biocLite. Now I can no more connect to biomaRt and even the following instruction is hanging for a while until the same error message pops up. listMarts() E

Re: [R] error on Windows OS

2010-05-31 Thread M.Ribeiro
Ok, I re-installed the Rtools (now Rtools211 because I was in another computer with R version 2.10) , and the message now when I tried to install the package was Warning: invalid package 'GWSR_1.0.tar.gz' Erro: ERROR: no packages specified Warning message: In install.packages("GWSR_1.0.tar.gz",

[R] Problems with apply

2010-05-31 Thread Luis Felipe Parra
Hello I am tryin to use the apply functions with two data frames I've got and I am getting the following error message Error en HistRio$SecSte : $ operator is invalid for atomic vectors I don't understand why. when I use the apply I am doing: PromP <- function(HistRio,AnaQuim){ xx <- c(0,0,0) i

Re: [R] What does LOESS stand for?

2010-05-31 Thread Ted Harding
On 31-May-10 15:52:56, David Winsemius wrote: > On May 31, 2010, at 11:44 AM, Peter Neuhaus wrote: > >> Thanks a lot... >> >> ... makes it a bit difficult to explain, though... > > We drink no wine before its time. Somewhat like trying to explain > splines to non-technical types: > > http://ww

Re: [R] after updating biomaRt cannot connect any more

2010-05-31 Thread Uwe Ligges
On 31.05.2010 17:55, Uwe Ligges wrote: On 31.05.2010 14:03, mau...@alice.it wrote: I recently updated R 2.10.1 Patched (2010-02-20 r51163) This morning I reinstalled biomaRt using biocLite. Now I can no more connect to biomaRt and even the following instruction is hanging for a while until t

Re: [R] after updating biomaRt cannot connect any more

2010-05-31 Thread Uwe Ligges
On 31.05.2010 14:03, mau...@alice.it wrote: I recently updated R 2.10.1 Patched (2010-02-20 r51163) This morning I reinstalled biomaRt using biocLite. Now I can no more connect to biomaRt and even the following instruction is hanging for a while until the same error message pops up. listMar

Re: [R] What does LOESS stand for?

2010-05-31 Thread David Winsemius
On May 31, 2010, at 11:44 AM, Peter Neuhaus wrote: Thanks a lot... ... makes it a bit difficult to explain, though... We drink no wine before its time. Somewhat like trying to explain splines to non-technical types: http://www.duckworksmagazine.com/03/r/articles/splineducks/splineDucks.h

Re: [R] What does LOESS stand for?

2010-05-31 Thread Peter Neuhaus
Thanks a lot... ... makes it a bit difficult to explain, though... Peter Quoting Joris Meys : This is the paper on which the loess algorithm is based in general: http://www.econ.pdx.edu/faculty/KPL/readings/cleveland88.pdf The explanation about the origin of the term LOESS is given on page 5

Re: [R] Y-axis range in histograms

2010-05-31 Thread Ted Harding
On 31-May-10 14:49:43, Aarne Hovi wrote: > Hi, > > I'm trying to create a histogram with R. The problem is that the > frequency is high for a couple of x-axis categories (e.g. 1500) > and low for most of the x-axis categories (e.g. 50) > http://r.789695.n4.nabble.com/file/n2237476/LK3_hist.jpg .

Re: [R] Y-axis range in histograms

2010-05-31 Thread Andy Rominger
A few ideas: Make a log-scale y-axis like: hist(my.data,...,log="y") argument yaxp can help make the ticks look pretty...see ?par. Or use various functions from the package `plotirx': axis.break and gap.barplot might be helpful. For those functions, you'll probably need to get your frequencies

Re: [R] two questions about PLOT

2010-05-31 Thread Ivan Calandra
Hi, Not sure it is the best solution, but I would create the layout of the plot part by part: plot(type="n") #does not plot axis(1, at=1:6,...) #set the x-axis at the bottom axis(4,...) #set the y-axis on the right. I'm not sure that's what you were looking for, didn't really understand it lines

[R] Y-axis range in histograms

2010-05-31 Thread Aarne Hovi
Hi, I'm trying to create a histogram with R. The problem is that the frequency is high for a couple of x-axis categories (e.g. 1500) and low for most of the x-axis categories (e.g. 50) http://r.789695.n4.nabble.com/file/n2237476/LK3_hist.jpg . When I create the histogram, it is not very informa

[R] two questions about PLOT

2010-05-31 Thread Jie TANG
here ,I want to plot two lines in one figure.But I have two problems 1) how to move one of the y-axis to be the right ? I tried to the command"axis(2)",But I failed. 2) how to add the axis information correctly.Since I have use the cmommand "axis(1,at=1:6,labels=gradeinfo$gradenam)" but it seems

Re: [R] store and repeat data based on row names (loop, if statement)

2010-05-31 Thread jim holtman
try this: > x <- read.table(textConnection("TO DISTID + 1 2.63981 'A1' + 2 0 'A1' + 3 6.95836 'A1' + 4 8.63809 'A1' + 1 0 'A1.1' + 2 2.63981 'A1.1' + 3 8.03071 'A1.1' + 4 8.90896 'A1.1' + 1 8.90896 'A2

Re: [R] How to delete the previously saved workspace restored

2010-05-31 Thread jim holtman
The easiest way (I use WIndows) is to start each session without loading the previous workspace. I explicitly save what I need and then explicitly restore it. In most cases, I always reconstruct the data I need. I use the '--no-restore --no-save' options. On Mon, May 31, 2010 at 10:04 AM, Joris

Re: [R] read in data file into R

2010-05-31 Thread jim holtman
Here is the answer to your second part. You can use the one file and look for some type of indicator between each section. I used the example you sent: > input <- readLines('/temp/tempxx.txt') Warning message: In readLines("/temp/tempxx.txt") : incomplete final line found on '/temp/tempxx.txt'

Re: [R] read in data file into R

2010-05-31 Thread David Winsemius
On May 31, 2010, at 9:47 AM, Benedikt Gehr wrote: Hi I'm trying to read a data file with output from another program (admb) into R for further analysis. However I'm not very successfull. The file extension for the data file is file.rep but it also doesn't help when I change it to file.txt

Re: [R] How to delete the previously saved workspace restored

2010-05-31 Thread Joris Meys
If you start R, type : unlink(".RData") This deletes the workspace file. Cheers Joris On Mon, May 31, 2010 at 11:10 AM, Yanwei Tan wrote: > Dear all, > > I am a new user of R, here I have a question about remove the previous > restored workspace. I saved the workspace last time, but R always >

Re: [R] read in data file into R

2010-05-31 Thread Peter Ehlers
On 2010-05-31 7:47, Benedikt Gehr wrote: Hi I'm trying to read a data file with output from another program (admb) into R for further analysis. However I'm not very successfull. The file extension for the data file is file.rep but it also doesn't help when I change it to file.txt I have two prob

Re: [R] read in data file into R

2010-05-31 Thread Ivan Calandra
Hi, For your first question, scan() might do what you want. I have never used it, but if I understood it well, it should do what you're looking for. See ?scan I would separate your 2nd file. But someone else more competent probably knows a better way for both questions HTH, Ivan Le 5/31/20

Re: [R] read in data file into R

2010-05-31 Thread jim holtman
Try using 'scan' to read in the data: > x <- scan(textConnection("3709.17 2660.93 2045.36 2090.33 2096.93 2205.65 > 2083.72 1797.53 1884.61 1946.59 2101.66 2220.03 2080.04 2097.07 2332.9 > 2325.47 2091.67 2091.54 2072.38 2025.31 1919.54 1781.95 1867.96 1685.12 > 1826.31 1654.25 1593.84 1430.96

[R] read in data file into R

2010-05-31 Thread Benedikt Gehr
Hi I'm trying to read a data file with output from another program (admb) into R for further analysis. However I'm not very successfull. The file extension for the data file is file.rep but it also doesn't help when I change it to file.txt I have two problems/questions: 1. The file is a sin

Re: [R] How to delete the previously saved workspace restored

2010-05-31 Thread David Winsemius
On May 31, 2010, at 5:10 AM, Yanwei Tan wrote: Dear all, I am a new user of R, here I have a question about remove the previous restored workspace. I saved the workspace last time, but R always automatically load the workspace when I open it. I try to remove the object and then close R

Re: [R] about heatmap

2010-05-31 Thread Jorge Ivan Velez
Hi there, Take a look at http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/heatmap/ HTH, Jorge On Mon, May 31, 2010 at 3:54 AM, 孟欣 <> wrote: > Hi all: > As to the "heatmap" function, the default style is "red and yellow",and red > refers to low level and yellow refers to

[R] after updating biomaRt cannot connect any more

2010-05-31 Thread mauede
I recently updated R 2.10.1 Patched (2010-02-20 r51163) This morning I reinstalled biomaRt using biocLite. Now I can no more connect to biomaRt and even the following instruction is hanging for a while until the same error message pops up. > listMarts() Error in value[[3L]](cond) : Request to

Re: [R] missing values in autocorelation

2010-05-31 Thread Joris Meys
Could you specify the problem and give a minimal example that represents your datastructure and reproduces the error? See also the posting guides : http://www.R-project.org/posting-guide.html Cheers Joris On Mon, May 31, 2010 at 1:12 PM, nuncio m wrot

Re: [R] R 2.11.1 is released

2010-05-31 Thread Peter Dalgaard
On May 31, 2010, at 1:38 PM, Dr. David Kirkby wrote: > On 05/31/10 10:16 AM, Peter Dalgaard wrote: >> >> CHANGES IN R VERSION 2.11.1 >> >> >> INSTALLATION >> >> o Command 'gnutar' is preferred to 'tar' when configure sets >> TAR. This is needed on Mac OS 10.6, w

Re: [R] What does LOESS stand for?

2010-05-31 Thread Joris Meys
This is the paper on which the loess algorithm is based in general: http://www.econ.pdx.edu/faculty/KPL/readings/cleveland88.pdf The explanation about the origin of the term LOESS is given on page 597. Cheers Joris On Mon, May 31, 2010 at 11:33 AM, Peter Neuhaus wrote: > Dear R-community, > > m

Re: [R] accessing a data frame with row names

2010-05-31 Thread Ivan Calandra
Hi, Let's create your data.frame: > dataframe <- structure(list(column1 = c(0.1, 0.3), column2 = c(0.2, 0.4)), .Names = c("column1", "column2"), row.names = c("row1", "row2"), class = "data.frame") > dataframe[,2] [1] 0.2 0.4 > dataframe[,2, drop=FALSE] column2 row1 0.2 row2 0.4 S

Re: [R] R 2.11.1 is released

2010-05-31 Thread Dr. David Kirkby
On 05/31/10 10:16 AM, Peter Dalgaard wrote: I've rolled up R-2.11.1.tar.gz a short while ago. This is an update release, which fixes a number of mostly minor issues. The most annoying one was probably the problem with format.POSIXlt causing C stack overflow on long date vectors. See the full l

Re: [R] Building a what list for scan to use

2010-05-31 Thread Duncan Murdoch
On 31/05/2010 7:07 AM, Alex van der Spek wrote: Using read.table now on large files. Scan should be faster reading and parsing the files if a 'what' list is provided. How would I generate a what list that repeats the the last 4 elements n (n=14 or 10 or 8) times? whatlist=list(Tstamp="",Cond

Re: [R] accessing a data frame with row names

2010-05-31 Thread Gabor Grothendieck
Use read.csv or read.table(..., sep = ","). Also note that if you delete the first comma of the header (as in the second example below) you won't have to specify row.names since it can figure it out from the fact that there is one fewer column name than data fields. > Lines <- ",column1,column2 +

Re: [R] error on Windows OS

2010-05-31 Thread Peter Dalgaard
On May 31, 2010, at 12:53 PM, Duncan Murdoch wrote: > > That's the one that stopped the install. Apparently the Rtools bin directory > is not being found by Windows in your PATH. The Rtools installer can put it > there; maybe you should just reinstall Rtools and choose that option. Also not

Re: [R] about heatmap

2010-05-31 Thread Joris Meys
Hi, Take a look at the heatmap.2 function in the library gplots, and the brewer.pal in the library RColorBrewer. With this combination you have a far bigger flexibility on the colors and the output, plus you get a colorcoded legend. There used to be a bug in that function distorting the legend whe

Re: [R] Replacing NAs with 0 for a list of data frames

2010-05-31 Thread Kang Min
Thanks, it works except that I had to add xx <- as.data.frame(xx) into func. I am trying to calculate diversity indices using the vegan package, and the functions require zeroes instead of NAs. Thanks. Kang Min On May 31, 5:09 pm, Tal Galili wrote: > I would consider trying the plyr package usi

[R] Vegan fisher.alpha error

2010-05-31 Thread Kang Min
Hi, I have an error with fisher.alpha from the vegan package. > fisher.alpha(data[[1]]) Error in nlm(Dev.logseries, n.r = n.r, p = p, N = N, hessian = TRUE, ...) : missing value in parameter I am trying to find fisher alpha for a list of 100 data frames, and I tried it on individual data frame

[R] accessing a data frame with row names

2010-05-31 Thread e-letter
Readers, I have entered a file into r: ,column1,column2 row1,0.1,0.2 row2,0.3,0.4 using the command: dataframe<-read.table("/path/to/file.csv",header=T,row.names=1) When I try the command: dataframe[,2] I receive the response: NULL I was expecting: row1 0.2 row2 0.4 What is my error with

[R] missing values in autocorelation

2010-05-31 Thread nuncio m
Hi all, I am trying to find the autocorrelation of some time series. I have say 100 files, some files have only missing values(-99.99, say). I dont want to exclude these files as they represent some points in a grid. But when the acf command is issued i get an error. Error in plot.window

[R] Building a what list for scan to use

2010-05-31 Thread Alex van der Spek
Using read.table now on large files. Scan should be faster reading and parsing the files if a 'what' list is provided. How would I generate a what list that repeats the the last 4 elements n (n=14 or 10 or 8) times? whatlist=list(Tstamp="",Condition=0,A1=0,B1=0,C1=0,D1=0) All are numeric, ei

Re: [R] error on Windows OS

2010-05-31 Thread Duncan Murdoch
M.Ribeiro wrote: I received by email an R package (file.tar.gz) that was created in Linux. The package was already installed in another computer in linux using install.packages and it worked I am not familiar with installing packages but I would like to install it on Windows I downloaded the Rt

Re: [R] What does LOESS stand for?

2010-05-31 Thread Prof Brian Ripley
See http://en.wikipedia.org/wiki/Loess . It is not an acronym: the derivation is given in the reference given by ?loess, p.314. On Mon, 31 May 2010, Peter Neuhaus wrote: Dear R-community, maybe someone can help me with this: I've been using the loess() smoother for quite a while now, and fo

Re: [R] Post-hoc tests for repeated measures in balanced experimental design

2010-05-31 Thread Thomas Meigen
Dear Dennis, thank you for your fast response. Perhaps I should have described the experimental situation in more detail. > This tells you that Subject is being treated as a random block > factor, and that > Conditions 1 and 2 are combinations of treatments applied to each > subject. In > o

Re: [R] geepack installation problem?

2010-05-31 Thread Peter Ehlers
On 2010-05-31 0:46, Denis B wrote: Hello R Forum members. I have installed for my statistician user, apparently without error, both the concord and geepack packages. The target system is R 2.10.1 on a 64-bit RedHat Enterprise Linux platform. However when she attempts to invoke a function in

  1   2   >