Re: [R] Assigning variable value as name to cbind column

2010-06-25 Thread Bill.Venables
Why does the naming have to be done inside the cbind()? How about dataTest - data.frame(col1 = c(1,2,3)) new.data - c(1,2) name - test length(new.data) - nrow(dataTest) newDataTest - cbind(dataTest, new.data) names(newDataTest)[[ncol(newDataTest)]] - name newDataTest col1 test 11

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Atte Tenkanen
The values come from this kind of process: The musical composition is segmented into so-called 'pitch-class segments' and these segments are compared with one reference set with a distance function. Only some distance values are possible. These distance values can be averaged over music bars

[R] installing multicore package

2010-06-25 Thread suman dhara
Sir, I want to apply mclapply() function for my analysis. So, I have to install multicore package. But I can not install the package. install.packages(multicore) It gives that package multicore is not available. Can you help me? Regards, Suman Dhara [[alternative HTML version

[R] best way to plot a evolution in time

2010-06-25 Thread nana
Hi everyone, I have the following question: given three objects let's say: a - c( 2 , 5, 15, 16) b - c(1 ,1, 8 , 8) c - c (10, 10 11 ,11) m-matrix(c(a,b,c),byrow=T,nrow=3) rownames(m)-c(gene a, 'gene b','gene c') m gene.dist-dist(m,method='euclidian') gene.dist which is the best way to plot

[R] i want create script

2010-06-25 Thread vijaysheegi
Hi R community, I want to create a script which will take the .csv table as input and do some prediction and output should be returned to some file.Inputs is exel sheet containing some tables of data.out should be table of predicted data.Will some one help me in this regards... Thanks in advance.

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread gokhanocakoglu
In fact, Euclidean Distance Matrix Analysis (EDMA) of form is a coordinate free approach to the analysis of form using landmark data which was developed by Subhash Lele and Joan Richstmeier. They also developed a computer program (http://www.getahead.psu.edu/comment/edma.asp) that allow to

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Dario Solari
I add some scientific references for Google Insights for Search: * Google Predicting the Present http://www.google.com/googleblogs/pdfs/google_predicting_the_present.pdf * Google Econometrics and Unemployment Forecasting http://ftp.iza.org/dp4201.pdf * Query Indices and a 2008 Downturn: Israeli

[R] Optimizing given two vectors of data

2010-06-25 Thread confusedSoul
I am trying to estimate an Arrhenius-exponential model in R. I have one vector of data containing failure times, and another containing corresponding temperatures. I am trying to optimize a maximum likelihood function given BOTH these vectors. However, the optim command takes only one such

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Atte Tenkanen
BTW. If there is not so weak test that would be suitable for my purpose (because of the ties and the shape of the data), could I proceed this way: It is also worth of comparing different samples taken from the data. Since the mean and sd of the data are available, could I approximate p-values

[R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while I'm getting results when i say lapply(x,ets) I am getting an error when I say myprint function(x) { for(i in 1:length(x)) {

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread Paul Hiemstra
On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while I'm getting results when i say lapply(x,ets) I am getting an error

[R] Sweave: The opposite of tangle

2010-06-25 Thread stefan.d...@gmail.com
Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of tangle (that just gives R-chunk). Thanks, Stefan

Re: [R] BBH2 and FrF2 packages

2010-06-25 Thread Dennis Murphy
Hi: MEPlot, IAPlot and cubePlot come from the FrF2 package; the DanielPlot function is in both package BsMD and FrF2. Try library(FrF2) and then run your code again; it worked for me... If you check the list of functions in BHH2 under HTML help, you'll find that none of the plot functions you

[R] HEGY.test, error Mypi not found

2010-06-25 Thread Jessica Oettel
Hi, I'd like to use the HEGY test from the uroot package (s. attachment) and get the following error message: error in dimnames(Mypi)[[2]] - paste(Ypi, 1:s, sep = ) : Object 'Mypi' not found For the air passenger example on http://127.0.0.1:11997/library/uroot/html/HEGY.test.html it works,

Re: [R] Simple qqplot question

2010-06-25 Thread Joris Meys
Sorry, missed the two variable thing. Go with the lm solution then, and you can tweak the plot yourself (the confidence intervals are easily obtained via predict(lm.object, interval=prediction) ). The function qq.plot uses robust regression, but in your case normal regression will do. Regarding

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Joris Meys
As a remark on your histogram : use less breaks! This histogram tells you nothing. An interesting function is ?density , eg : x-rnorm(250) hist(x,freq=F) lines(density(x),col=red) See also this ppt, a very nice and short introduction to graphics in R :

[R] Finding sets

2010-06-25 Thread Muhammad Rahiz
Hi all, I'd like to find how many sets of 1s there are in the following example; x - rep(c(1,2,1,3,5), each=5) I know that there are two sets of 1s, visually. Any function in R that allows me to automate the process? Thanks. Muhammad __

Re: [R] Finding sets

2010-06-25 Thread Dennis Murphy
Hi: Here's one approach: x - rep(c(1,2,1,3,5), each=5) rle(x) Run Length Encoding lengths: int [1:5] 5 5 5 5 5 values : num [1:5] 1 2 1 3 5 table(rle(x)$values) 1 2 3 5 2 1 1 1 unname(table(rle(x)$values))[1] [1] 2 HTH, Dennis On Fri, Jun 25, 2010 at 2:30 AM, Muhammad Rahiz

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Joris Meys
I've been looking around myself, but I couldn't find any. Maybe somebody will chime in to direct you to the correct places. I also checked the papers, and it seems not too hard to implement. If I find some time, I'll take a look at it next week. For the other two gentlemen, check:

Re: [R] Correctly plotting bar and scatter chart on 2-y axis plot with par(new=T)

2010-06-25 Thread Jim Lemon
On 06/25/2010 05:47 AM, dan.weavesham wrote: Hello, Thanks for the advice so far -- still struggling with it, I must admit. Here is some sample data, which I hope helps: # y axis #1 -- data for the bar chart -30353.382 -21693.519 -7049.923 -72968.722 -10267.584 -269432.795 -19847.670

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread Kevin E. Thorpe
stefan.d...@gmail.com wrote: Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of tangle (that just gives

Re: [R] installing multicore package

2010-06-25 Thread Uwe Ligges
On 25.06.2010 06:39, suman dhara wrote: Sir, I want to apply mclapply() function for my analysis. So, I have to install multicore package. But I can not install the package. install.packages(multicore) It gives that package multicore is not available. Can you help me? If this is

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread Kevin E. Thorpe
Kevin E. Thorpe wrote: stefan.d...@gmail.com wrote: Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Liviu Andronic
On Sun, Jun 20, 2010 at 2:31 PM, Muenchen, Robert A (Bob) muenc...@utk.edu wrote: come up with so far at http://r4stats.com/popularity . I'm sure people will have plenty of ideas on how to improve this, so please let me know what you think. This is not much of a metric, probably not even a

Re: [R] i want create script

2010-06-25 Thread John Kane
I'd suggest having a look at the manuals on the [url=http://www.r-project.org][b]R[/b][/url]site, especially the Introduction to R and R Data Import/Export. Some helpful tutorials may be found at http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html and

Re: [R] ask a question about list in R

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 1:00 AM, song song wrote: my list al is as below: al=list(c(2,3),5,7) al [[1]] [1] 2 3 [[2]] [1] 5 [[3]] [1] 7 and I check the second component, its element is 5, then I remove this, now my al is: al[[2]][al[[2]]!=5]-al[[2]] al [[1]] [1] 2 3 [[2]] numeric(0)

Re: [R] Handouts / Reports or just simply printing text to PDF?

2010-06-25 Thread Matt Shotwell
Check out the brew package, by Jeff Horner. Ralf B wrote: I assume R won't easily generate nice reports (unless one starts using Sweave and LaTeX) but perhaps somebody here knows a package that can create report like output for special cases? How can I simply plot output into PDF? Perhaps

Re: [R] Finding sets

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 5:43 AM, Dennis Murphy wrote: Hi: Here's one approach: x - rep(c(1,2,1,3,5), each=5) rle(x) Run Length Encoding lengths: int [1:5] 5 5 5 5 5 values : num [1:5] 1 2 1 3 5 table(rle(x)$values) 1 2 3 5 2 1 1 1 unname(table(rle(x)$values))[1] [1] 2 This method

Re: [R] Optimizing given two vectors of data

2010-06-25 Thread Joris Meys
Optim uses vectors of _parameters_, not of data. You add a (likelihood) function, give initial values of the parameters, and get the optimized parameters back. See ?optim and the examples therein. It contains an example for optimization using multiple data columns. Cheers Joris On Fri, Jun 25,

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread gokhanocakoglu
thanks for your interests Joris Gokhan OCAKOGLU Uludag University Faculty of Medicine Department of Biostatistics http://www20.uludag.edu.tr/~biostat/ocakoglui.htm -- View this message in context:

[R] (no subject)

2010-06-25 Thread ricardo . sousa2001
Hello, I'm new in using the R, but from what I read is an excellent tool. Would you like if I could help, I am trying create an array from reading a text file. The idea is to read the file, and transform the data in binary format, for example. The calves of this file format.

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 7:09 AM, phani kishan wrote: On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
Hey, I only got the output once cuz I was returning from the function at the end of one loop. I set that right and I have printed the values. function being used by me now is: function(x) { for(i in 1:length(x)) { print(names(x[i])) print(myets(x[[i]])) } } where myets is my customized

Re: [R] Assigning variable value as name to cbind column

2010-06-25 Thread Henrique Dallazuanna
Try this also: cbind(dataTest, `colnames-`(cbind(new.data[1:nrow(dataTest)]), name)) On Fri, Jun 25, 2010 at 2:47 AM, Ralf B ralf.bie...@gmail.com wrote: Hi all, I have this (non-working) script: dataTest - data.frame(col1=c(1,2,3)) new.data - c(1,2) name - test n.row - dim(dataTest)[1]

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
-Original Message- From: Liviu Andronic [mailto:landronim...@gmail.com] Sent: Friday, June 25, 2010 7:15 AM To: Muenchen, Robert A (Bob) Cc: r-help@r-project.org Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... On Sun, Jun 20, 2010 at 2:31 PM, Muenchen, Robert A (Bob)

Re: [R] i want create script

2010-06-25 Thread Joris Meys
Please read the posting guide : http://www.R-project.org/posting-guide.html Your question is very vague. One could assume you're completely new to R and want the commands to read a csv file (see ?read.csv), and to write away a table (eg ?write.table to write your predicted data in a text

Re: [R] create group markers in original data frame ie. countinued... ? to calculate sth for groups defined between points in one variable (string), /separating/ spliting variable into groups by i.e.

2010-06-25 Thread Eugeniusz Kaluza
Dear useRs, at the beginning, Joris Meys, thank you for explaining how to obtain calculation result possible for groups between string marks in one variable in data frame, like in this example below (between START and STOP), wchich I would like to complete at the end by asking about... how

Re: [R] Optimizing given two vectors of data (confusedSoul)

2010-06-25 Thread Prof. John C Nash
I am trying to estimate an Arrhenius-exponential model in R. I have one vector of data containing failure times, and another containing corresponding temperatures. I am trying to optimize a maximum likelihood function given BOTH these vectors. However, the optim command takes only one such

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Frank E Harrell Jr
The central limit theorem doesn't help. It just addresses type I error, not power. Frank On 06/25/2010 04:29 AM, Joris Meys wrote: As a remark on your histogram : use less breaks! This histogram tells you nothing. An interesting function is ?density , eg : x-rnorm(250) hist(x,freq=F)

Re: [R] (no subject)

2010-06-25 Thread Allan Engelhardt
Maybe something like: y - readLines(foo) z - strsplit(y, ,) cols - sort(unique(unlist(z))) # Assuming this is what you want for column names m - matrix(0, nrow=length(z), ncol=length(cols), dimnames=list(as.character(1:length(z)), cols)) for (i in 1:length(z)) { m[i, z[[i]]] - 1 }

[R] gsub with regular expression

2010-06-25 Thread Sebastian Kruk
If I have a text with 7 words per line and I would like to put first and second word joined in a vector and the rest of words one per column in a matrix how can I do it? First 2 lines of my text file: 2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido 2010/02/01 02:35:31 palabra 111.111.222

Re: [R] gsub with regular expression

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 10:48 AM, Sebastian Kruk residuo.so...@gmail.com wrote: If I have a text with 7 words per line and I would like to put first and second word joined in a vector and the rest of words one per column in a matrix how can I do it? First 2 lines of my text file: 2008/12/31

Re: [R] gsub with regular expression

2010-06-25 Thread Allan Engelhardt
help(strsplit) is your friend, for example: t - c(2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido, 2010/02/01 02:35:31 palabra 111.111.222 abejorro Rodeo Vaca) m - do.call(rbind, strsplit(t, [[:space:]]+)) # Matrix of all the data v - paste(m[, 1], m[, 2]) # The vector m -

[R] Fortune?

2010-06-25 Thread Bert Gunter
On average, any data manipulation that can be described in a sentence or two of English can be programmed in one line in R. If you find yourself writing a long 'for' loop to do something that sounds simple, take a step back and research if an existing combination of functions can easily handle

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Joris Meys
2010/6/25 Frank E Harrell Jr f.harr...@vanderbilt.edu: The central limit theorem doesn't help. It just addresses type I error, not power. Frank I don't think I stated otherwise. I am aware of the fact that the wilcoxon has an Asymptotic Relative Efficiency greater than 1 compared to the

[R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread bruno Piguet
Hi all, I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series. Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough for my current needs. The only problem is that it is quite slow on real use

Re: [R] Fortune?

2010-06-25 Thread Liviu Andronic
On Fri, Jun 25, 2010 at 4:17 PM, Bert Gunter gunter.ber...@gene.com wrote: On average, any data manipulation that can be described in a sentence or two of English can be programmed in one line in R. If you find yourself writing a long 'for' loop to do something that sounds simple, take a step

Re: [R] gsub with regular expression

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 11:11 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Jun 25, 2010 at 10:48 AM, Sebastian Kruk residuo.so...@gmail.com wrote: If I have a text with 7 words per line and I would like to put first and second word joined in a vector and the rest of words one

Re: [R] Simple qqplot question

2010-06-25 Thread Bert Gunter
To add to/modify what Joris (and I) previously said: 1. qqplots are not cumulative distribution plots. Hence, as Joris said, the S-shape indicates short tails/bimodality compared to the normal. Why you continue to insist on carrying out normality tests that with so many points obviously will

Re: [R] Fortune?

2010-06-25 Thread Achim Zeileis
Bert, thanks for the pointer, added to the devel version of fortunes on R-Forge. thx, Z On Fri, 25 Jun 2010, Bert Gunter wrote: On average, any data manipulation that can be described in a sentence or two of English can be programmed in one line in R. If you find yourself writing a long

Re: [R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread Charles C. Berry
On Fri, 25 Jun 2010, bruno Piguet wrote: Hi all, I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series. Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough for my current needs. The only

Re: [R] best way to plot a evolution in time

2010-06-25 Thread Tal Galili
Hi Nana, The question is not fully clear to me. Are you looking to plot the (let's call it) family tree of the genes ? (if so, then using plot(hclust(gene.dist)) Might be a direction for you) Tal Contact Details:--- Contact

[R] 3D generalization of correlogram?

2010-06-25 Thread Dieter Menne
We have 3-Dimensional MRI density recordings of tumor tissue and would like to have a measure of patchiness, reflecting cluster size in the tissue. For 2-D slices, correlogram from MASS works well. Does someone know of a packages that provides a 3-D generalization of this measure? Or any

Re: [R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 11:34 AM, bruno Piguet bruno.pig...@gmail.com wrote: Hi all,   I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series.   Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough

Re: [R] (no subject)

2010-06-25 Thread Berend Hasselman
You posted the exact same question several days ago (June 17) under a different name. You got two perfectly good and adequate answers. /Berend -- View this message in context: http://r.789695.n4.nabble.com/no-subject-tp2268375p2268685.html Sent from the R help mailing list archive at

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Frank E Harrell Jr
You still are stating the effect of the central limit theorem incorrectly. Please see my previous note. Frank On 06/25/2010 10:27 AM, Joris Meys wrote: 2010/6/25 Frank E Harrell Jrf.harr...@vanderbilt.edu: The central limit theorem doesn't help. It just addresses type I error, not power.

Re: [R] Handouts / Reports or just simply printing text to PDF?

2010-06-25 Thread Tal Galili
Hi Ralf, ?pdf and ?png are good places to start. There is also R2wd: http://cran.r-project.org/web/packages/R2wd/index.html For exporting R output to word. I wrote a short tutorial session for it here:

Re: [R] ggplot2: deterministic position_jitter geom_line with position_jitter

2010-06-25 Thread Hadley Wickham
I'm having the same problem as Stephan (see below), but what I'm trying to jitter is not a numeric vector, but a factor. How do I proceed? (Naively jittering a factor makes it numeric, no longer factor, so I don't get the custom ordering which conveniently comes with using a factor. I'm not

[R] variograms and kriging

2010-06-25 Thread Steve_Friedman
Hello Trying to develop variograms and kriged surfaces from a point file. Here is what I've done so far. library(gstat) # also loads library(sp) library(lattice) soilpts$x - soilpts$UTM_X soilpts$y - soilpts$UTM_Y soil.dat - subset(soilpts, select=c(x, y, Area, BulkDensity, LOI, TP, TN,

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Kjetil Halvorsen
There is a freely downloadable and very relevant ( readable) book at https://ccrma.stanford.edu/~dattorro/mybook.html Convex Optimization and Euclidean Distance geometry, and it indeed names EDMA as a form of multidimensional scaling (or maybe in the oposite way). You should have a look at the

Re: [R] variograms and kriging

2010-06-25 Thread Steve_Friedman
Please disregard. I've posted to the wrong site. Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread stefan.d...@gmail.com
Thanks! That was exactly what I was looking for. Best, Stefan On Fri, Jun 25, 2010 at 12:37 PM, Kevin E. Thorpe kevin.tho...@utoronto.ca wrote: Kevin E. Thorpe wrote: stefan.d...@gmail.com wrote: Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I

[R] Forcing scalar multiplication.

2010-06-25 Thread rkevinburton
I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the eigenvalue. 'R' returns the eigenvalues as a vector (e - eigen(A);

[R] Forcing scalar multiplication.

2010-06-25 Thread rkevinburton
I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the eigenvalue. 'R' returns the eigenvalues as a vector (e - eigen(A);

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Daniel Malter
Atte, I would not wonder if you got lost and confused by the certainly interesting methodological discussion that has been going on in this thread. Since the helpers do not seem to converge/agree, I propose to you to use a different nonparametric approach: The bootstrap. The important thing

[R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
Hi all, I'm trying to print a number of wireframe plots (generated using the lattice package), and I want them to appear in a two-by two matrix along with some other (standard) plots. In other words I am trying to create a subplot or tiled plot that works for wireframes. I've tried the

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Greg Snow
Let me see if I understand. You actually have the data for the whole population (the entire piece) but you have some pre-defined sections that you want to see if they differ from the population, or more meaningfully they are different from a randomly selected set of measures. Is that correct?

Re: [R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Greg Snow
The layout function is base graphics, wireframe from lattice is grid based and they don't play well together without extra effort. The simplest option will probably be to look at the help page for print.trellis, specifically the split and more arguments. Then look at the examples to see if

[R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Yi
Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Thomas Lumley
On Thu, 24 Jun 2010, Atte Tenkanen wrote: On Jun 23, 2010, at 9:58 PM, Atte Tenkanen wrote: Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said: The Wilcoxon signed rank test does

Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Henrique Dallazuanna
Try this: test[rowSums(mapply('%in%', test[c('x', 'y')], list(c('germany','england','brazil' 0,] On Fri, Jun 25, 2010 at 4:00 PM, Yi liuyi.fe...@gmail.com wrote: Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan')

Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Erik Iverson
x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to keep the rows where these three countries #are

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
I had taken the opposite tack with Google Trends by subtracting keywords like: SAS -shoes -airlines -sonar... but never got as good results as that beautiful X code for search. When you see the end-of-semester panic bumps in traffic, you know you're nailing it! I see that there's a car, the R

[R] lattice legend

2010-06-25 Thread sethandmelva
The solution Felix suggested worked: It was indeed helpful to include the line par.setttings=list(superpose.symbol=sup.sym) while using.auto key with a customized symbol list in lattice. Thanks Felix! Seth [[alternative HTML version deleted]]

[R] Modelling Crystal Growth

2010-06-25 Thread mplar1
Dear all, I would like to hear from anyone who has experience using R to simulate and visualise the formation and growth of crystals. Thank you. mpl -- View this message in context: http://r.789695.n4.nabble.com/Modelling-Crystal-Growth-tp2268746p2268746.html Sent from the R help mailing

Re: [R] Forcing scalar multiplication.

2010-06-25 Thread Kjetil Halvorsen
?sweep On Fri, Jun 25, 2010 at 2:43 PM, rkevinbur...@charter.net wrote: I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Muenchen, Robert A (Bob) Sent: Friday, June 25, 2010 3:08 PM To: Joris Meys; Dario Solari Cc: r-help@r-project.org Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... I had taken

Re: [R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
Always nice to answer my own question 3 minutes later. The missing() function does what I want. Still, why DOES this exists() statement fail? Do functions auto create the variables once they are called, regardless of whether or not they are assigned? --j On Fri, Jun 25, 2010 at 1:05 PM,

[R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
I'm a bit confused about how exists() work within a function -- I want to test for unassigned variables, but I'm doing tests in the main environment to figure out the function, so the variables DO exist in the parent environment of a function call. Why does: myfunction -

[R] Export Results

2010-06-25 Thread Pedro Mota Veiga
Hi R users, How can I automatically export results and graphs to a file? Thanks in advance Pedro Mota Veiga -- View this message in context: http://r.789695.n4.nabble.com/Export-Results-tp2268622p2268622.html Sent from the R help mailing list archive at Nabble.com.

[R] Lattice plotting question

2010-06-25 Thread David Warren
Hi all, I'm working on some plots using lattice (R 2.10.1), and have entered the polish phase. I've produced a satisfactory pair of xyplots ( http://imgur.com/EyXGi.png), but would like to align the y-axes of the top and bottom plots. I assume that I need to adjust axis padding or

[R] Diebold Mariano

2010-06-25 Thread Brajkovic J.
Hello, I am trying to calculate Diebold Mariano test statistic (DM) using dm.test module. I also try to do the same thing with STATA and I get vastly different results (4.5 vs 25). Does someone have experience with this module? I tried to calculate the DM statistic manually. If by “d” I

Re: [R] Export Results

2010-06-25 Thread Henrique Dallazuanna
See ?Sweave On Fri, Jun 25, 2010 at 12:58 PM, Pedro Mota Veiga motave...@net.sapo.ptwrote: Hi R users, How can I automatically export results and graphs to a file? Thanks in advance Pedro Mota Veiga -- View this message in context:

Re: [R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
Thanks, that was the pointer I needed. I'd tried the split parameter but didn't realize that it doesn't work well within wireframe() itself, rather, I had to call print.trellis() directly using the trellis object that wireframe() returns if one assigns it to something. After that, it was

[R] fatal error: unable to restore saved data

2010-06-25 Thread Albert Lee, Ph.D.
I just installed the R 2.11.1 version on my computer and I encountered a fatal error: Unable to restore saved data in .RData and kick me out of R right away. I still can run 2.10.2. There is no package called rattle I checked various posts regarding this error. I still can't get it to work.

Re: [R] fatal error: unable to restore saved data

2010-06-25 Thread Phil Spector
Albert - The message refers to a file specifically called .RData. Files with subscripts of .rdata are not related. You can see your current working directory by typing getwd() at the R prompt. I'm not sure where rattle enters into the picture.

[R] Average 2 Columns when possible, or return available value

2010-06-25 Thread emorway
Forum, Using the following data: DF-read.table(textConnection(A B 22.60 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 102.00 NA 19.20 NA 19.20 NA NA NA NA NA NA NA 11.80 NA 7.62 NA NA NA NA NA NA NA NA NA NA NA 75.00 NA NA NA 18.30 18.2 NA NA NA NA 8.44 NA 18.00 NA NA

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Phil Spector
Eric - What you're describing is taking the mean of each row while ignoring missing values: apply(DF,1,mean,na.rm=TRUE) [1] 22.60NaNNaNNaNNaNNaNNaNNaN 102.00 19.20 [11] 19.20NaNNaNNaN 11.80 7.62NaNNaNNaNNaN [21]NaN 75.00

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
Hello Eric, I am not sure how your need to use list() will fit in with this, but for your sample data, this will do the trick. matrix(rowMeans(DF, na.rm=TRUE), ncol=1) HTH, Josh On Fri, Jun 25, 2010 at 4:08 PM, emorway emor...@engr.colostate.edu wrote: Forum, Using the following data:

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
btw, if you just wanted your exact code to work: t(as.matrix(aggregate(t(as.matrix(DF)),list(rep(1:1,each=2)),mean, na.rm=TRUE)[,-1])) You will get NaNs rather than NAs where you are missing from both rows, but that should not be a real issue. snip -- Joshua Wiley Ph.D. Student, Health

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Joris Meys
Thanks for the link, very interesting book. Yet, I couldn't find the part about EDMA. It would have surprised me anyway, as the input of multidimensional scaling is one matrix with euclidean distances between your observations, whereas in EDMA the data consist of a number of distance matrices.

Re: [R] Lattice plotting question

2010-06-25 Thread Felix Andrews
ylim = extendrange(c(0,100)) ? On 26 June 2010 01:42, David Warren davideugenewar...@gmail.com wrote: Hi all,     I'm working on some plots using lattice (R 2.10.1), and have entered the polish phase.  I've produced a satisfactory pair of xyplots ( http://imgur.com/EyXGi.png), but would like

[R] use a data frame whose name is stored as a string variable?

2010-06-25 Thread Seth
Hi, Let's say I have a data frame (called example) with numeric values stored (columns V1 and V2). I also have a string variable storing this name x1-example Is there a way to use the variable x so that R knows that I want the specified action to occur on the data frame? For example, summary

[R] Label Values in levelplot

2010-06-25 Thread Ben Wilkinson
I am trying to add labels equal to the value in a levelplot. I believe that panel may be the way to go but cannot understand the examples. In the following example: X,Y,Z A,M,100 A,M,200 B,N,150 B,N,225 I would like to label each of the rectangles 100,200,150 and 225 and colour according to the

Re: [R] use a data frame whose name is stored as a string variable?

2010-06-25 Thread Joshua Wiley
On Fri, Jun 25, 2010 at 5:10 PM, Seth sjmy...@syr.edu wrote: Hi, Let's say I have a data frame (called example) with numeric values stored (columns V1 and V2).  I also have a string variable storing this name x1-example Is there a way to use the variable x so that R knows that I want the

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joris Meys
Just want to add that if you want to clean out the NA rows in a matrix or data frame, take a look at ?complete.cases. Can be handy to use with big datasets. I got curious, so I just ran the codes given here on a big dataset, before and after removing NA rows. I have to be honest, this is surely an

[R] All a column to a data frame with a specific condition

2010-06-25 Thread Yi
Hi, folks, Please first look at the codes: plan_a=c('apple','orange','apple','apple','pear','bread') plan_b=c('bread','bread','orange','bread','bread','yogurt') value=1:6 data=data.frame(plan_a,plan_b,value) library(plyr) library(reshape) mm=melt(data, id=c('plan_a','plan_b'))

[R] predict newdata question

2010-06-25 Thread Felipe Carrillo
Hi: I am using a subset of the below dataset to predict PRED_SUIT for the whole dataset but I am having trouble with 'newdata'. The model was created with 153 records and want to predict for 208 records. wolf2 - structure(list(gridcell = c(367L, 444L, 533L, 587L, 598L, 609L, 620L, 629L, 641L,

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
On Fri, Jun 25, 2010 at 5:24 PM, Joris Meys jorism...@gmail.com wrote: Just want to add that if you want to clean out the NA rows in a matrix or data frame, take a look at ?complete.cases. Can be handy to use with big datasets. I got curious, so I just ran the codes given here on a big

  1   2   >