[R] unique combinations

2011-12-21 Thread Antje Niederlein
Hi there, I have a vector and would like to create a data frame, which contains all unique combination of two elements, regardless of order. myVec - c(1,2,3) what expand.grid does: 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3 what I would like to have 1,1 1,2 1,3 2,2 2,3 3,3 Can anybody help?

[R] gmp: Error in solve.bigz(B) : System is singular

2011-12-21 Thread Bertrand Haas
With a matrix such as C I do not have any problem: library(gmp) C V1 V2 V3 V4 V5 V6 V7 [1,] 1 0 0 0 1 0 0 [2,] 0 1 0 0 0 1 0 [3,] 0 0 1 0 0 0 1 [4,] 0 0 0 1 0 0 0 [5,] 0 0 0 0 1 0 0 [6,] 0 0 0 0 0 1 0 [7,] 0 0 0 0 0 0 1 solve.bigz(C)

Re: [R] contingency table

2011-12-21 Thread Rolf Turner
Do you actually know what contingency table means? The tables in your example make no sense at all as contingency tables *especially if obs means observed and exp means expected. You can, however, extra the tables in the manner which you seem to desire, as follows: Let your data object be

[R] Estimating a latent class multinomial logit regression with flexmix

2011-12-21 Thread adanmartinez
I am trying to estimate a latent class multinomial logit regression with flexmix. I am not sure if I should do it as follows: m4-flexmix(cbind(y,1-y)~x1+x2|id,model=FLXMRglm(family=binomial),data=NPreg,k=2) , where id links each row with the corresponding respondent. Each respondent has 4

Re: [R] Help Transforming sums into observations

2011-12-21 Thread kbrownk
Thanks for the heads up. I don't have a #. My data is as you suggest. I tried to generalize my example because I'm open to reformatting for the solution to my problem. Thanks, kbrownk On Dec 20, 6:14 pm, Sarah Goslee sarah.gos...@gmail.com wrote: bindata - 1:5 nobs - c(2, 3, 1, 4, 3)

Re: [R] column permutation of sparse matrix

2011-12-21 Thread cberry
Douglas Bates ba...@stat.wisc.edu writes: On Tue, Dec 20, 2011 at 8:20 AM, Jean V Adams jvad...@usgs.gov wrote: Hi Jean, khai wrote on 12/19/2011 11:26:55 PM: Hi, I'm very new to working with sparse matrices and would like to know how I can column permute a sparse matrix. Here is a

Re: [R] Help Transforming sums into observations

2011-12-21 Thread kbrownk
I ended up just using a vba macro for Excel. Hopefully I can start transitioning to R for some of these tasks soon. Thanks, kbrownk On Dec 20, 6:14 pm, Sarah Goslee sarah.gos...@gmail.com wrote: bindata - 1:5 nobs - c(2, 3, 1, 4, 3) rep(bindata, times=nobs)  [1] 1 1 2 2 2 3 4 4 4 4 5 5 5

Re: [R] any DCCA function in R?

2011-12-21 Thread Javier Murillo
Dear Jari Oksanen, Thank you very much for your reply and your information. I was looking for this analysis in R, but I was not able to find it and it was a bit strange to me. It must be a great task to implement DCCA with the decorana code in vegan. I will explore other kind of analysis and if

[R] Predicting a linear model for all combinations

2011-12-21 Thread Abraham Mathew
Lets say I have a linear model and I want to find the average expented value of the dependent variable. So let's assume that I'm studying the price I pay for coffee. Price = B0 + B1(weather) + B2(gender) + ... What I'm trying to find is the predicted price for every possible combination of

[R] Reg : Using RJDBC to read UTF-8 characterrs

2011-12-21 Thread Raji
Hi All, We are using the following dataset which contains UTF-8 characters and is stored in a MySQL database. When we use RODBC and read the data, the characters are read correctly.But when we read using RJDBC ,the characters are read like カタカナ1 Can you please let me

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Tal Galili
combind ?predict and: expand.grid(weather=1:2,gender=c(male,female)) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |

[R] Search a string inside a data.frame

2011-12-21 Thread Alaios
Dear all, I have a string and I want to search for its existance inside a data.frame (or in a column of the data.frame). One way is for me to do this manually: Make a for loop for the number of elements and compare one by one element. Is there though any more improved way to do that? B.R

Re: [R] Search a string inside a data.frame

2011-12-21 Thread Petr PIKAL
Hi Dear all, I have a string and I want to search for its existance inside a data.frame (or in a column of the data.frame). One way is for me to do this manually: Make a for loop for the number of elements and compare one by one element. Is there though any more improved way to do

Re: [R] unique combinations

2011-12-21 Thread peter dalgaard
On Dec 21, 2011, at 08:59 , Antje Niederlein wrote: Hi there, I have a vector and would like to create a data frame, which contains all unique combination of two elements, regardless of order. myVec - c(1,2,3) what expand.grid does: 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Tal Galili
Hi Abraham, Isn't this what you wanted: data.frame(all.x, y.hat.new) p.s: it might be safer to use: myData mod1 = lm(sold ~ age + gender, data = myData) Contact Details:--- Contact me: tal.gal...@gmail.com |

Re: [R] unique combinations

2011-12-21 Thread Jeff Newmiller
You could read the help for expand.grid very carefully for the answer to this question. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Tal Galili
Hi Abraham, Please let us take a step back - what is your end goal from this analysis? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il

[R] Creating and assigning variable names in loop

2011-12-21 Thread aajit75
Hello List I am trying to create and assign variable names in loop, but not able to get expected variable names. Here is the sample code n = 10 set.seed(1) x1 = rnorm(n,0) x2 = rnorm(n,0) samp_data - data.frame(x1,x2) for( i in 1:3) { label - paste(score, i, sep=_) assign(label,

[R] vif function using lm object

2011-12-21 Thread arunkumar1111
Hi, can anyone please explain why the vif should have more than 2 terms. *vif.lm(lmobj) : model contains fewer than 2 terms* why it is throwng error if it is one variable. - Thanks in Advance Arun -- View this message in context:

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Abraham Mathew
I looked into what you suggested and got the following results. y.hat.new 1234567 89 10 1144.675 1190.714 1236.753 1157.829 1210.445 1203.868 1128.232 1282.792 1246.619 1154.540 11 12 13 14

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Abraham Mathew
Yes and no. Thanks for that code, it was really useful, though not exactly what i was getting at. So I'm predicting sold on a number of independent variables.I'm trying to find an estimated sold price for each combination of the variables. So what is the expected sold price for each possible

[R] Estimate of smooth.spline

2011-12-21 Thread ali_protocol
Hi everyone, I have: s= smooth.spline (cbind(1,2,3,4,3,3),cbind (4,2,4,6,5,6)) how may I obtain s hat (s^)? Thanks a lot. -- View this message in context: http://r.789695.n4.nabble.com/Estimate-of-smooth-spline-tp4221253p4221253.html Sent from the R help mailing list archive at Nabble.com.

[R] creating a closed loop for a list

2011-12-21 Thread djrwicks
Given the following, how to I get x[i+1] to not return an NA result when it gets to the end of list x by looping back to the start of the list i.e should return: 0 0 2 2 2 2? x-c(2,0,0,2,2,2) i-1:length(x) x[i] [1] 2 0 0 2 2 2 x[i+1] [1] 0 0 2 2 2 NA can i be described using a loop

Re: [R] Search a string inside a data.frame

2011-12-21 Thread Uwe Ligges
On 21.12.2011 09:49, Alaios wrote: Dear all, I have a string and I want to search for its existance inside a data.frame (or in a column of the data.frame). One way is for me to do this manually: Make a for loop for the number of elements and compare one by one element. Is there though any

Re: [R] Looping over files

2011-12-21 Thread Uwe Ligges
See FAQ How can I save the result of each iteration in a loop into a separate file? you will certainly find the the principle given therein can be applied the other way round or reading as well. Uwe Ligges On 21.12.2011 02:32, Debs Majumdar wrote: Hi, I have a list of files in one of my

Re: [R] Creating and assigning variable names in loop

2011-12-21 Thread andrija djurovic
Hi. You assign two times different values to variable label. Try this and i hope you will notice a mistake: i=1 label - paste(score, i, sep=_) label assign(label, x1+(x2*i) ) label Instead of this you can do something like: rm(list=ls()) n = 10 set.seed(1) x1 = rnorm(n,0) x2 = rnorm(n,0)

Re: [R] creating a closed loop for a list

2011-12-21 Thread jim holtman
Is this what you want? You will have to adjust the indices appropriately: x-c(2,0,0,2,2,2) i - seq_along(x) x[i] [1] 2 0 0 2 2 2 # to loop around, change how you index x[(i - 1) %% length(x) + 1] [1] 2 0 0 2 2 2 i - i + 1 x[(i - 1) %% length(x) + 1] [1] 0 0 2 2 2 2 i - i + 1 x[(i - 1)

[R] R Source Code Request Office For National Statistics UK

2011-12-21 Thread David Samuel
To R Support Team, ONS would like a restricted number of its IT staff to view the source code for the latest version of your software, to check it against our source code security guidelines.The source code will be securely stored with access limited. ONS is quite happy to agree that we would

Re: [R] Predicting a linear model for all combinations

2011-12-21 Thread Abraham Mathew
All right, so my dependent variable is sold price, it is theoretically a continuous variable, though most of the values are between 0 and 25 Sold Price = B0 + B1(age) + B2(gender) + B3(marital) + B4(educ) + B5(cars) + B6(license) + B7(credit) + B8(type) + B9(home) + B10(id) age is a numeric

Re: [R] kernlab's ksvm method freeze

2011-12-21 Thread Heiko Strathmann
Hi Wuming, it has been a while. I was not able to fix this problem these day. Also I could not get in contact with the developer, so I switched to SHOGUN, which has an interface for R. With the SHOGUN interface to libsvm, everything worked fine. Also, its a cool package and worth that you check

Re: [R] R Source Code Request Office For National Statistics UK

2011-12-21 Thread David Winsemius
There are no restrictions needed. Any of your staff can view the (open) source code just as any other member of the human race with access to to an Interenet connection may do so. The released version: http://cran.r-project.org/src/base/R-2/R-2.14.0.tar.gz The development version:

Re: [R] Event handling in R

2011-12-21 Thread Henrik Bengtsson
Hi. On Wed, Dec 21, 2011 at 4:20 AM, beetonn nicholas.bee...@utas.edu.au wrote: Thanks, Henrik! That's given me some food for thought, and evalWithTimeout certainly seems to be a nicer way of doing this than setTimeLimit. I should probably explain a little more clearly: I want to stop

Re: [R] R Source Code Request Office For National Statistics UK

2011-12-21 Thread Marc Schwartz
On Dec 21, 2011, at 7:06 AM, David Samuel wrote: To R Support Team, ONS would like a restricted number of its IT staff to view the source code for the latest version of your software, to check it against our source code security guidelines.The source code will be securely stored with

Re: [R] unique combinations

2011-12-21 Thread Keith Jewell
OK, someone point it out to me; my wife tells me I can't see what's in front of me :-} I read ?expand.grid carefully, went to ?combn and ?choose but still couldn't see an easy way to get what the OP asked for. The neatest I can get (which isn't very neat!) is: myVec - c(1,2,3) eg -

[R] Gps fraction of degrees function

2011-12-21 Thread Alaios
Dear all,   I have the following written example coords - 51°30'48.58\N as.integer(strsplit(coords, °)[[1]][1]) [1] 51 as.integer(strsplit(strsplit(coords, °)[[1]][2], ')[[1]][1]) [1] 30 as.numeric(strsplit(strsplit(strsplit(coords, °)[[1]][2], ')[[1]][2], \)[[1]][1]) [1] 48.58

[R] Statistical tests and measures for cone-like distributions?

2011-12-21 Thread Matthew Gwynne
Hi, Are there any special statistical tests, or functions in R I could use to measure cone-like distributions? I have several data-sets, which I've been plotting parts of as 2D plots, where I get a cone-like distribution of the data points. That is, the data appears to be bounded by two

Re: [R] R Source Code Request Office For National Statistics UK

2011-12-21 Thread Uwe Ligges
On 21.12.2011 14:25, David Winsemius wrote: There are no restrictions needed. Any of your staff can view the (open) source code just as any other member of the human race I do not think the GPL excludes other species ... with access to to an Interenet connection may do so. Oh, you may

Re: [R] Estimate of smooth.spline

2011-12-21 Thread Jean V Adams
ali_protocol wrote on 12/21/2011 05:39:19 AM: Hi everyone, I have: s= smooth.spline (cbind(1,2,3,4,3,3),cbind (4,2,4,6,5,6)) how may I obtain s hat (s^)? Thanks a lot. Read the help file on the smooth.spline() function, ?smooth.spline The section titled Value tells you what the

Re: [R] unique combinations

2011-12-21 Thread Uwe Ligges
On 21.12.2011 14:39, Keith Jewell wrote: OK, someone point it out to me; my wife tells me I can't see what's in front of me :-} I read ?expand.grid carefully, went to ?combn and ?choose but still couldn't see an easy way to get what the OP asked for. The neatest I can get (which isn't very

Re: [R] unique combinations

2011-12-21 Thread Keith Jewell
Thanks Uwe, I was happy that my 2 lines gave what the OP asked for, albeit in a different order. My puzzlement arose from Jeff Newmillers comment: You could read the help for expand.grid very carefully for the answer to this question. ... which I reas as saying that ?expand.grid would lead to

[R] Automating Plot and Model Generation

2011-12-21 Thread Rich Shepard
I need to generate 6 x-y scatter plots (lattice xyplot) for each of 11 data frames. I'm sure the tedium of doing these one at a time can be avoided by writing a script that uses nested for loops or the apply() function. My Web search has not provided me with a tutorial on R programming that

Re: [R] Automating Plot and Model Generation

2011-12-21 Thread Bert Gunter
On Wed, Dec 21, 2011 at 6:57 AM, Rich Shepard rshep...@appl-ecosys.com wrote:  I need to generate 6 x-y scatter plots (lattice xyplot) for each of 11 data frames. I'm sure the tedium of doing these one at a time can be avoided by writing a script that uses nested for loops or the apply()

[R] Fw:

2011-12-21 Thread Kristi Shoemaker
http://zenproje.com/bestsite.php?pid=85ygo=52qat=448nj=23 __ 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 provide commented, minimal,

Re: [R] Automating Plot and Model Generation

2011-12-21 Thread Rich Shepard
On Wed, 21 Dec 2011, Bert Gunter wrote: Well, you may have to invest in a book or two to get what you want. Bert, I've more than a dozen books I've bought and read over the past few months, but haven't found what I need in them. (May be there and I missed it.) You can start with R's own

Re: [R] Reg : Using RJDBC to read UTF-8 characterrs

2011-12-21 Thread Hasan Diwan
Mr Sankaran, It may be your character set that's wrong or check your MySQL configuration. On Dec 21, 2011 12:31 AM, Raji raji.sanka...@gmail.com wrote: Hi All, We are using the following dataset which contains UTF-8 characters and is stored in a MySQL database. When we use RODBC and read

[R] How to Fit a Set of Lines Parametrized by a Number

2011-12-21 Thread Lorenzo Isella
Dear All, It is not very difficult, in R, to perform a linear fit y=Ax+B on a single set of data. However, imagine that you have several datasets labelled by a number (real or integer does not matter) K. For each individual dataset, it would make sense to resort to a linear fit, but now A and B

[R] regular expressions in R

2011-12-21 Thread Alaios
Dear all I would like to ask from dir function in R (?dir) to give me only the files that end with .txt or .doc. The dir functions supports the use of patterns (is not that regular expressions) for doing that.   print(dir(i,full.names=TRUE,pattern=.)) Could you please help me compose such

Re: [R] Gps fraction of degrees function

2011-12-21 Thread Clint Bowman
The following (untested) should get you close: deg-as.integer(strsplit(coords, ?)[[1]][1]) min-as.integer(strsplit(strsplit(coords, ?)[[1]][2], ')[[1]][1]) sec-as.numeric(strsplit(strsplit(strsplit(coords, ?)[[1]][2], ')[[1]][2], \)[[1]][1]) nswe-strsplit(strsplit(strsplit(coords, ?)[[1]][2],

Re: [R] regular expressions in R

2011-12-21 Thread Sarah Goslee
From the help for dir: File naming conventions are platform dependent. The pattern matching works with the case of file names as returned by the OS On my linux system, this works: dir(pattern=*.txt) [1] a.txt b.txt dir(pattern=*.doc) [1] c.doc dir(pattern=*.doc|*.txt) [1] a.txt

Re: [R] regular expressions in R

2011-12-21 Thread R. Michael Weylandt
Do you wish to include .docx files as well or just .doc? Michael On Wed, Dec 21, 2011 at 10:04 AM, Alaios ala...@yahoo.com wrote: Dear all I would like to ask from dir function in R (?dir) to give me only the files that end with .txt or .doc. The dir functions supports the use of patterns

Re: [R] regular expressions in R

2011-12-21 Thread jim holtman
To be correct for the regular expression, it should be: dir(pattern = \\.(txt|doc)$) The form dir(pattern=*.txt) will match 'txt' appearing anywhere in the name; this looks like the argument you would have used to Sys.glob which is a UNIX style file name match and not a regular expression. .

[R] aggregate function

2011-12-21 Thread Mary Kindall
Hi I have a data frame with values in following format. param case1 1 a 2 b 2 c 2 d 3 e 4 f how to use aggregate so that it I only one row for each 'param' value. the output for the above input should be

Re: [R] aggregate function

2011-12-21 Thread jim holtman
Here is an example using 'data.table' x - read.table(text = param case1 + 1 a + 2 b + 2 c + 2 d + 3 e + 4 f, header = TRUE, as.is = TRUE) require(data.table) x - data.table(x) x[ + , list( case1 =

Re: [R] aggregate function

2011-12-21 Thread David Winsemius
On Dec 21, 2011, at 11:31 AM, jim holtman wrote: Here is an example using 'data.table' x - read.table(text = param case1 + 1 a + 2 b + 2 c + 2 d + 3 e + 4 f, header = TRUE, as.is = TRUE) And the

Re: [R] constrOptim and further arguments

2011-12-21 Thread Michael Griffiths
Dear List, I have the code below, where I am using the constrained optimisation package, 'constrOptim.nl' to find the values of two values, b0 and b1. I have no problems when I enter further variable information DIRECTLY into the functions, fn, and heq. In this instance I require fn to have

Re: [R] Gps fraction of degrees function

2011-12-21 Thread Clint Bowman
I see my pre-coffee fingering hit an incorrect key in the final line--E is positive, W is negative. -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360)

Re: [R] aggregate function

2011-12-21 Thread jim holtman
You were using the wrong syntax; it should be: x[ , list(case1 = paste(case1, collapse = ',')) , by = param ] Notice that you do not use the x$ on the names within the data.table statement. On Wed, Dec 21, 2011 at 12:22 PM, Mary Kindall mary.kind...@gmail.com wrote: Hi Jim

[R] Problem of using wdTable() within R2wd package

2011-12-21 Thread 卓蓝
Hi All, I am trying to use the wdTable() function within R2wd package to send a dataframe to MS-word. However, there is a problem with the tables that are generated by R. For some reason the header row of the table also contains all the data. You can see it by dragging the bottom border of

[R] Gower

2011-12-21 Thread Adésio Ferreira
Alguém sabe onde encontro os comandos para utilizar em daisy() no pacote cluster o método de Gower para dados moleculares codominantes, quantitativos e multicategóricos conjuntamente? Agradeço. OBS.: confirmar por favor o recebimento da mensagem. Adésio

[R] Stacked area plot for time series

2011-12-21 Thread UncleFish
I wish to make a stacked area chart of a time series with three variables. The observations are very irregular, covering 500 years, with a few historical observations in the range 1500-1850, and then more regular observations since 1880 or so. If I plot this in Excell it truncates the time

[R] When exactly do I need R_alloc when using the .Call() interface?

2011-12-21 Thread michael.zombok
Hi, I am trying to implement an algorithm in C which will be called via the .Call() interface. While reading the 'Writing R Extension' manual, I stumbled upon the R_alloc() function for allocating storage for C objects. The manual says it should be used to allocate storage if an C object is

[R] test to compare two different models

2011-12-21 Thread Ville Iiskola
Hi I am doing mlogit and forward selection at the moment. I have categorical and continuous variables. Categorical variables are each coded with more than two dummies. There is a problem when you add categorical variables into the model you can't tell from the significance of the individual

Re: [R] How to include a few selected AR terms

2011-12-21 Thread testrider
First of all, the order specified is the maximum required order so in your case the logical arima call would be: arima(zt,order=c(2,0,1)) This still includes the AR(1) term, which can be excluded using the fixed command. Assuming you have 4 parameters (AR1 AR2 MA1 Intercept) this is the solution:

[R] Non-negativity constraints for logistic regression

2011-12-21 Thread tw
Dear R users, I am currently attempting to fit logistic regression models in R, where the slopes should be restricted to positive values. Although I am aware of the package nnls (which does the trick for linear regression models), I did not find any solution for logistic regression. If there is

[R] Using wdTable() within R2wd package‏

2011-12-21 Thread Joann Zhuo
Hi All, I am trying to use the wdTable() function within R2wd package to send a dataframe to MS-word. However, there is a problem with the tables that are generated by R. For some reason the header row of the table also contains all the data. You can see it by dragging the bottom border of the

Re: [R] aggregate function

2011-12-21 Thread Mary Kindall
Hi Jim Thanks for reply but this is not working. I think I am missing something over here. 1 x - cbind(c(1,2,2,2,3,4), c('a','b', 'c','d','e','f')) 1 colnames(x) = c('param', 'case1') 1 x = as.data.frame(x) 1 x param case1 1 1 a 2 2 b 3 2 c 4 2 d 5 3 e 6

Re: [R] When exactly do I need R_alloc when using the .Call() interface?

2011-12-21 Thread Prof Brian Ripley
First, the posting guide asked for questions about compiled code to be asked on R-devel. So I will be brief. You use R_alloc or Calloc in place of malloc/calloc. Use R_alloc where code might be interrupted. There are many examples in R's own packages and the recommended packages. On

Re: [R] Help with code

2011-12-21 Thread 1Rnwb
I do not know how to use dput, i am attaching the txt file for the data http://r.789695.n4.nabble.com/file/n4222616/foo.txt foo.txt c1-read.dlim('foo.txt') c2-c1 any_comp-NULL for( i in 1:dim(c1)[1]) { num_comp-0 for (j in 1:dim(c1)[2]) if (c1[i,j]==2) num_comp=num_comp+1 #Y=2

[R] Non-negativity constraint for logistic regression

2011-12-21 Thread Thomas
Dear R users, I am currently attempting to fit logistic regression models in R, where the slopes should be restricted to positive values. Although I am aware of the package nnls (which does the trick for linear regression models), I did not find any solution for logistic regression. If there is

[R] MA terms in arima

2011-12-21 Thread testrider
With the arima function I found some nice results, however now i have trouble interpreting them for use outside R. I am currently struggeling with the MA terms, here is a short example: ser=c(1, 14, 3, 9)#Example series mod=arima(ser,c(0,0,1)) #From {stats} library mod #Series: ser

Re: [R] Non-negativity constraints for logistic regression

2011-12-21 Thread Prof Brian Ripley
On 21/12/2011 18:26, t...@netstorm.be wrote: Dear R users, I am currently attempting to fit logistic regression models in R, where the slopes should be restricted to positive values. Although I am aware I guess non-negative, as in the subject line, so there actually is a solution. of the

Re: [R] Help with code

2011-12-21 Thread William Dunlap
To make it so others can produce your dataset on their own computers (so they can easily reproduce the problem you are having) do, in R, dump(c1, file=stdout()) and copy the text output by that that into your message. E.g., suppose I made a data.frame with junk -

Re: [R] Statistical tests and measures for cone-like distributions?

2011-12-21 Thread Albyn Jones
Have you tried plotting log(y) vs log(x)? albyn On Wed, Dec 21, 2011 at 02:18:56PM +, Matthew Gwynne wrote: Hi, Are there any special statistical tests, or functions in R I could use to measure cone-like distributions? I have several data-sets, which I've been plotting parts of as 2D

[R] matrix multivariate bootstrap: order of results in $t component

2011-12-21 Thread Michael Friendly
[This question is hopefully straight-forward, but difficult to provide reproducible code.] I'm doing a multivariate bootstrap, using boot::boot(), where the output of the basic computation is a k x p matrix of coefficients, representing a tuning constant x variable, as shown in the $t0

Re: [R] Automating Plot and Model Generation

2011-12-21 Thread Rich Shepard
On Wed, 21 Dec 2011, Bert Gunter wrote: You can start with R's own An Introduction to R, but if that won't do, ... I should have looked more carefully at what I have available here. The R-lang.pdf will take me a long way; perhaps all the way to writing what I need. Thanks, Bert, Rich

Re: [R] How to Fit a Set of Lines Parametrized by a Number

2011-12-21 Thread Greg Snow
This looks like a hierarchical Bayes type problem. There are a few packages that do Bayes estimation or link to external tools (like openbugs) to do this. You would just set up each of the relationships like you define below, y is a function of a(k), b(k), x and e where e comes from a normal

Re: [R] matrix multivariate bootstrap: order of results in $t component

2011-12-21 Thread John Fox
Hi Michael, There may be a cleverer way to do this without a loop, but I think that the following does what you want: t - matrix(1:(800*18), 800, 18, byrow=TRUE) # for a reproducible example head(t) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]123456

Re: [R] aggregate function

2011-12-21 Thread peter dalgaard
On Dec 21, 2011, at 18:22 , Mary Kindall wrote: Hi Jim Thanks for reply but this is not working. I think I am missing something over here. Yes, the data.table() bit. It's not going to work with data frames. 1 x - cbind(c(1,2,2,2,3,4), c('a','b', 'c','d','e','f')) 1 colnames(x) =

[R] qqnorm huge datasets

2011-12-21 Thread Sam Steingold
Hi, When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart from sampling the data). Thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000 http://mideasttruth.com

Re: [R] qqnorm huge datasets

2011-12-21 Thread Marc Schwartz
On Dec 21, 2011, at 4:10 PM, Sam Steingold wrote: Hi, When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart from sampling the data). Thanks. Depending upon what your end product needs to be, generate a png file

Re: [R] Using wdTable() within R2wd package‏

2011-12-21 Thread Tal Galili
Hi Joann, I am not sure if it will help, but there is a post I wrote some time ago: http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/ Please give it a look and see if that might help you figure out the problem. Best, Tal Contact

Re: [R] Statistical tests and measures for cone-like distributions?

2011-12-21 Thread Ben Bolker
Matthew Gwynne mathew.gwynne at gmail.com writes: Hi, Are there any special statistical tests, or functions in R I could use to measure cone-like distributions? I have several data-sets, which I've been plotting parts of as 2D plots, where I get a cone-like distribution of the data

Re: [R] qqnorm huge datasets

2011-12-21 Thread peter dalgaard
On Dec 21, 2011, at 23:10 , Sam Steingold wrote: Hi, When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart from sampling the data). Sample intelligently? Things like qq - seq(-4,4,,10001)

[R] Is there a way force hiding of all messages when calling library()?

2011-12-21 Thread Saiwing Yeung
For example, if I call library(spam), I would get messages like this Package 'spam' is loaded. Spam version 0.27-0 (2011-08-17). Type demo( spam) for some demos, help( Spam) for an overview of this package. Help for individual functions is optained by adding the suffix '.spam' to the function

Re: [R] Is there a way force hiding of all messages when calling library()?

2011-12-21 Thread Hadley Wickham
You should be able to suppress them with suppressPackageStartupMessages() but not all packages produce startup messages in the approved manner. Hadley On Wed, Dec 21, 2011 at 5:36 PM, Saiwing Yeung saiw...@berkeley.edu wrote: For example, if I call library(spam), I would get messages like this

Re: [R] Is there a way force hiding of all messages when calling library()?

2011-12-21 Thread Saiwing Yeung
suppressPackageStartupMessages(library(spam)) takes care of that, thanks!! On Dec 21, 2011, at 3:39 PM, Hadley Wickham wrote: You should be able to suppress them with suppressPackageStartupMessages() but not all packages produce startup messages in the approved manner. Hadley On Wed,

Re: [R] qqnorm huge datasets

2011-12-21 Thread R. Michael Weylandt
I'd second Peter's suggestion, but if you need every data point for whatever reason, you might also try passing the pch = . option to qqnorm. On a test with 1e7 data points, it more than halved the resulting file size and with that many points, there's no loss in clarity with the different marker.

[R] RGtk2: How to overlay a gtkDrawingArea with a button or any other widget?

2011-12-21 Thread Mark Heckmann
I try to overlay a plot inside a gtkDrawingArea with a button (or any other widget). I tried to put both into a gtkFixed container. But this does not work, no printing occurs. Does someone know a solution? What I tried: w - gtkWindow() w$setSizeRequest(400,400) fx - gtkFixed() da -

[R] RHTMLForms / Scrape data from website that needs a parameter in-putted

2011-12-21 Thread Jai Vaughan
Hi, I'm trying to get a list of addresses from http://tatts.com/racing/outletsearch based on a list of postcodes (zip codes) and states. For example, I'm looking for State = 'Northern Territory' and Postcode = '0800'. The list I'm working off is about 500 long so I was hoping to find a way to

[R] C

2011-12-21 Thread Peter Erskine
Sent from my iPod __ 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 provide commented, minimal, self-contained, reproducible code.

[R] Odp: Creating and assigning variable names in loop

2011-12-21 Thread Petr PIKAL
Hi You probably want this cycle for some reason but if you know how many labels you want you just can label - paste(score, 1:3, sep=_) label [1] score_1 score_2 score_3 Then instead of assigning names in a cycle you can label-c(names(samp_data), label) for( i in 1:3) { samp_data -

Re: [R] Help with code

2011-12-21 Thread Petr PIKAL
Hi I do not know how to use dput, i am attaching the txt file for the data dput(any.object) puts a structure of this object to console. You can copy it to your email and anybody can copy it back to R. Or you can transfer the structure to file see ?dput, ?dget