Re: [R] strip levels

2015-04-06 Thread David Winsemius
On Apr 6, 2015, at 9:38 PM, Christine Lee via R-help wrote: > Thank you Duncan, > > I am new to R. Could you please tell me how to download the latticeExtra > package to get stationx time conditioning? I am terribly sorry that I have > read 3-4 R books for dummies but I am still quite helple

Re: [R] R crashes upon changing directories, loading files, etc.

2015-04-06 Thread Nicole Ford
Yes, it definitely is the GUI as it works just fine when I load data using a file path. I can work around it, thankfully, but it would be great if this issue could be fixed. I suspected Yosemite as it's given me multiple problems since install. Thanks for the input. Hopefully someone with th

Re: [R] Simulate values

2015-04-06 Thread Kehl Dániel
People do not usually do homework stuff here but I do not see the point in repeating the same sample 500 times. You might want to simulate 40x500 independent samples and put those in a matrix (see ?matrix) with lets say 40 rows and 500 columns. Once done, you can apply calculate the 500 sample

Re: [R] strip levels

2015-04-06 Thread Christine Lee via R-help
Thank you Duncan, I am new to R. Could you please tell me how to download the latticeExtra package to get stationx time conditioning? I am terribly sorry that I have read 3-4 R books for dummies but I am still quite helpless with using R. >_< Regards, Christine

Re: [R] problem in search function

2015-04-06 Thread ARNAB KR MAITY
Please try help(rnorm) Thanks & Regards,Arnab Arnab Kumar Maity Graduate Teaching Assistant Division of Statistics Northern Illinois University DeKalb, Illinois 60115 U.S.A From: Debojyoti Samadder To: r-help@r-project.org Sent: Monday, April 6, 2015 7:50 AM Subject: [R] problem in searc

[R] Simulate values

2015-04-06 Thread Osiris10101
Hello, I'm facing the following task: Simulate 500 values of the statistic (n-1)s^2/sigma^2 based on taking 500 samples of size n=40 from the N(mu=10; sigma^2 = 25) distribution. I think with the following command: rep(rnorm(40,10,25),times=500) I was able to simulate the samples but how I now ca

Re: [R] Combine list element by column name to make a dataframe

2015-04-06 Thread Duncan Mackay
forgot to cc to list have a look at https://stat.ethz.ch/pipermail/r-help/2012-January/300275.html and other messages in the sequence if you use Marc Schwartz's list2df you with have to transpose it with t() Duncan Duncan Mackay Department of Agronomy and Soil Science University of New Englan

Re: [R] strip levels

2015-04-06 Thread Duncan Mackay
Hi also have a look at useOuterStrips in the latticeExtra package if you want station x time conditioning useOuterStrips(strip = strip.custom(par.strip.text = list(cex = 0.75)), strip.left = strip.custom(horizontal = FALSE, par.strip.text = list(cex

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Bert Gunter
Does not min(abs(diff(z))) give you the scaling you need to set a tolerance? -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Mon, Apr 6, 2015 at 2:55 PM, M

Re: [R] Fast multiple match function

2015-04-06 Thread William Dunlap
split() might help, but you should give a more complete explanation of your problem. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Apr 6, 2015 at 1:56 PM, Keshav Dhandhania wrote: > Hi, > > I know that one can find all occurrences of x in a vector v by doing > > which(x == v). > > Howeve

Re: [R] Fast multiple match function

2015-04-06 Thread David Winsemius
On Apr 6, 2015, at 1:56 PM, Keshav Dhandhania wrote: > Hi, > > I know that one can find all occurrences of x in a vector v by doing >> which(x == v). > > However, if I need to do this again and again, where v is remaining the > same, then this is quite inefficient. In my particular case, I need

[R] Fast multiple match function

2015-04-06 Thread Keshav Dhandhania
Hi, I know that one can find all occurrences of x in a vector v by doing > which(x == v). However, if I need to do this again and again, where v is remaining the same, then this is quite inefficient. In my particular case, I need to do this millions of times, and length(v) = 100 million. Does an

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Marc Lamblin
The first solution with diff works for uniform abscissa only with integer values. z <- seq(0, 10, length=100) all(diff(z) == z[2] - z[1] ) ## FALSE In this case, as you recommended, I could use signif or round or a tolerance for real numbers. In my particular case, in order to set a tolerance, I

Re: [R] sort adjacency matrix

2015-04-06 Thread David Winsemius
On Apr 6, 2015, at 11:15 AM, Bert Gunter wrote: > Not quite, David. > > If I understand the OP's query, he wants the ties to be broken by the > "lexicographic" order (with apologies if I have misused this term) of > the 1's within the rows. Makes things a bit more interesting. This should corre

Re: [R] R crashes upon changing directories, loading files, etc.

2015-04-06 Thread peter dalgaard
> On 06 Apr 2015, at 22:17 , Prof Brian Ripley wrote: > > Nicole Ford wrote: [snip] >> >> I found a page where people were indicating they had this issue, but there >> was no one responding with a fix. see below: >> >> bugs.r-project.org/bugzilla/show_bug.cgi?id=14240 > > Which is about Wi

Re: [R] R crashes upon changing directories, loading files, etc.

2015-04-06 Thread Prof Brian Ripley
It seems this is not R but R.app (the separate project providing an OS X console: see the 'R Installation and Administration' manual). If so, the only appropriate list is R-sig-Mac (see the posting guide). On 06/04/2015 19:14, Nicole Ford wrote: Hello, I am experiencing an issue, repeatedly,

Re: [R] stripchart

2015-04-06 Thread catalin roibu
​Mi data is like that: i tried: stripchart(spei[, 1:3], method="jitter", xlim=c(1,2.5),at=c(1.25, 1.75, 2.25),offset=1/2,vertical=TRUE, pch=19, las=1, subset(spei, speia,1]==quantile(spei[,1],c(.10,.90 structure(list(year = 1901:2013, J = c(1.547878, -1.100605, -0.4222952, -1.221505, -0.2250

Re: [R] stripchart

2015-04-06 Thread catalin roibu
original data are something like that: structure(list(year = 1901:2013, J = c(1.547878, -1.100605, -0.4222952, -1.221505, -0.2250523, -0.1260924, -0.6251569, -0.7348371, 0.9646313, 1.21345, 0.9746932, 0.5155271, -0.3323591, -0.6689715, 0.8461724, 1.772659, 1.436295, -1.108881, -1.196227, 1.445744,

Re: [R] stripchart

2015-04-06 Thread John Kane
Reproducibility https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada > -Original Message- > From: catalinro...@gmail.com > Sent: Mon, 6 Apr 2015 20:16:39 +0300 > To: r

Re: [R] sort adjacency matrix_with data

2015-04-06 Thread Ragia Ibrahim
Hi again the data represents a directed graph represented in a matrix e.g library(igraph) g <- forest.fire.game(10, fw.prob=0.3 , bw.factor=0.32/0.3, directed = TRUE) m=get.adjacency(g , attr=NULL) print(m) -- many thanks and pardon me for multiple posts Ragia > Date: Mon, 6 Apr 2015

Re: [R] sort adjacency matrix

2015-04-06 Thread Rui Barradas
Hello, You should have used ?dput to post your data example. Since you haven't, I've made up one. set.seed(4795) mat <- matrix(sample(0:1, 24, replace = TRUE), nrow = 6) mat inx <- order(rowSums(mat), decreasing = TRUE) mat[inx, ] Hope this helps, Rui Barradas Em 06-04-2015 18:18, Ragia Ibr

[R] R crashes upon changing directories, loading files, etc.

2015-04-06 Thread Nicole Ford
Hello, I am experiencing an issue, repeatedly, which began today. Example code: load(file.choose()) ##sometimes it crashes here/ endless spinner/ other times I can get through. or: i go up to options at the top to set wd, or select ‘file’ -> ‘open’ and it will do the same thing. I found a

Re: [R] sort adjacency matrix

2015-04-06 Thread Bert Gunter
Not quite, David. If I understand the OP's query, he wants the ties to be broken by the "lexicographic" order (with apologies if I have misused this term) of the 1's within the rows. Makes things a bit more interesting. Have at it! Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (6

Re: [R] sort adjacency matrix

2015-04-06 Thread David L Carlson
The answer depends on what kind of matrix/data frame you have. That is why we encourage people to use dput() to create a copy of the sample data in their email. Some combination of order() function the rowSums() function will probably get you what you want. For example, dat[order(rowSums(dat=="

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Bert Gunter
... correction: you need to use absolute value for the comparison, of course. all(abs(diff(z) - z[2] + z[1]) < tol) -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Sto

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Bert Gunter
Perhaps ?diff might be useful here: z <- runif(20) all(diff(z) == z[2] - z[1] ) ## FALSE z <- seq_len(10) all(diff(z) == z[2] - z[1] ) ##TRUE You can use signif or round as before to allow for "near uniformity" or use ?zapsmall or an explicit comparison with a tolerancec instead of ==, e.g. all(

[R] sort adjacency matrix

2015-04-06 Thread Ragia Ibrahim
Dear group i have the following matrix 1 . . 1 . . 1 . . . . 2 . . . . . . 1 . . . 3 1 . . . 1 . . 1 . 1 4 . . . . . 1 . . . . 5 . . 1 . . . . . . 1 6 1 . . 1 . . . . 1 . 7 . 1 . . . . . 1 . . 8 . . 1 . . . 1 . . 1 9 . . . . . 1 . . . 1 10 . . 1 . 1 . . 1 1 . I want to sort it according

[R] stripchart

2015-04-06 Thread catalin roibu
Dear all! I have a problem! I want to plot temperature anomalies per months until 1901-2014. For this I want to make a stripchart. I used the specified command, but I want to plot the extreme values with full dots above 90th and bellow 10th percentile, and the normal values with hallow dots. Ple

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Marc Lamblin
The aim is to control if a given abscissa/grid is uniform or not. Abscissa in generic vector of real ordered numbers. Here a reproducibile code: # uniform abscissa/grid abscissa1 <- seq(0, 1, length=100) # non-uniform abscissa/grid abscissa2 <- sort(runif(100)) control1 <- all(signif(abscissa1[1

Re: [R] strip levels

2015-04-06 Thread Sarah Goslee
Please use dput() to provide your data, as already requested. Just providing the text file doesn't tell us enough about the structure: are some columns factors? etc. Or, if you must provide an attachment (really not preferred, as many attachments won't make it to the list, and many people do not w

Re: [R] strip levels

2015-04-06 Thread Christine Lee via R-help
Thank you very much to Both Sarah and Michael, Your responses are deeply appreciated. TxT I have omitted the reinstatement of the data source as follows: library(lattice) histogram(~Width|Station*Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='whit

Re: [R] problem in search function

2015-04-06 Thread Sarah Goslee
It still sounds like a broken installation. I'd uninstall and reinstall, I think. But I've copied this back to the list (rather than just to me), and someone else might have a better solution. Sarah On Mon, Apr 6, 2015 at 12:02 PM, Debojyoti Samadder wrote: > Dear list memeber, >

Re: [R] strip levels

2015-04-06 Thread Michael Dewey
See inline On 06/04/2015 15:39, Sarah Goslee wrote: Hi, On Mon, Apr 6, 2015 at 7:44 AM, Christine Lee via R-help wrote: To whom it may help, I am new to R. I have been tring to have a lattice plot in two strip levels: 4 stations in 2 years. I type in: histogram(~Raw.no10$Width|Raw.no10$S

Re: [R] problem in search function

2015-04-06 Thread Jeff Newmiller
In this case I think it means your installation of the R software is broken, though if you are messing around with environment variables that could probably also do this. You should read the Posting Guide and follow the guidance there if you want more specific feedback. -

Re: [R] strip levels

2015-04-06 Thread Sarah Goslee
Hi, On Mon, Apr 6, 2015 at 7:44 AM, Christine Lee via R-help wrote: > To whom it may help, > > I am new to R. > > I have been tring to have a lattice plot in two strip levels: 4 stations in 2 > years. > > I type in: > > histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, >

Re: [R] recode the same subset of variables in several list elements

2015-04-06 Thread Simon Kiss
Hi Jim, So that does the rescale part very efficiently. But I’d like to know how to do that on each list element using lapply or llply. I have about 4 data frames and a few other recodes to do so automating would be nice, rather than applying your code to each individual list element. simon > O

Re: [R] problem in search function

2015-04-06 Thread Sarah Goslee
On Mon, Apr 6, 2015 at 8:50 AM, Debojyoti Samadder wrote: > Dear sir, The masculine is no longer the default form of address. "Dear list" is fine, as are many other options. > I tried "help.search("rnorm")" in R version 3.1.2 . > It gave a error > "Error in `[<-`(`*tmp*`, , "name", value = sub

Re: [R] Verify that a grid is uniform

2015-04-06 Thread Sarah Goslee
Without a reproducible example that includes some sample data (fake is fine), the code you used (NOT in HTML format), and some clear idea of what output you expect, it's impossible to figure out how to help you. Here are some suggestions for creating a good reproducible example: http://stackoverflo

[R] problem in search function

2015-04-06 Thread Debojyoti Samadder
Dear sir, I tried "help.search("rnorm")" in R version 3.1.2 . It gave a error "Error in `[<-`(`*tmp*`, , "name", value = sub("\\.[^.]*$", "", basename(vDB$File))) : subscript out of bounds". Can you tell me the reason.It may be silly.

[R] strip levels

2015-04-06 Thread Christine Lee via R-help
To whom it may help, I am new to R. I have been tring to have a lattice plot in two strip levels: 4 stations in 2 years. I type in: histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab=

[R] Verify that a grid is uniform

2015-04-06 Thread Marc Lamblin
I need to control of a given grid is uniform. This control using signif until now works: if (all(signif(abscissa[1:(length(abscissa) - 1) + 1] - abscissa[1:(length(abscissa) - 1)]) == signif(rep((range(abscissa)[2] - range(abscissa)[1])/(length(abscissa) - 1), length(abscissa) - 1 { #

Re: [R] Trim and fill procedure

2015-04-06 Thread Michael Dewey
Hello Carlijn Well the documentation for trimfill says they are added. library(metafor) example(trimfill) This now leaves you with res res.tf By looking at these and seeing which vectors have grown you should be able to extract the yi and vi which you want. Wolfgang will doubtless be on the

Re: [R] Combine list element by column name to make a dataframe

2015-04-06 Thread Michael Hannon
Maybe something like the appended? -- Mike lst <- list(setNames(c(1,10,50,60,70,80), c("id","id1","math","phy","che","bio")), setNames(c(2,20,45), c("id","id1","phy")), setNames(c(3,30,75), c("id","id1","bio"))

Re: [R] Combine list element by column name to make a dataframe

2015-04-06 Thread peter dalgaard
> On 06 Apr 2015, at 08:05 , Mohammad Tanvir Ahamed via R-help > wrote: > > Hi ,� > > I have a example list like follow� > > > > > lst<-list(setNames(c(1,10,50,60,70,80),c("id","id1","math","phy","che","bio")),setNames(c(2,20,45),c("id","id1","ph

[R] Combine list element by column name to make a dataframe

2015-04-06 Thread Mohammad Tanvir Ahamed via R-help
Hi ,� I have a example list like follow� lst<-list(setNames(c(1,10,50,60,70,80),c("id","id1","math","phy","che","bio")),setNames(c(2,20,45),c("id","id1","phy")),setNames(c(3,30,75),c("id","id1","bio"))) My expected outcome :� -