Re: [R] Function to lump factors together?

2011-10-18 Thread peter dalgaard
On Oct 18, 2011, at 05:36 , David Winsemius wrote: On Oct 17, 2011, at 9:45 PM, David Wolfskill wrote: Sorry about the odd terminology, but I suspect that my intent might be completely missed had I used aggregate or classify (each of which appears to have some rather special meanings in

[R] problem with quantmod package

2011-10-18 Thread ATANU
i am using quantmod package.it get stock quotes from google finanace. but unfortunately i am not able to get the quotations of some stocks(e.g. NSE:TCS,NSE:SAIL ) through the getSymbol command of this package although they are available in the google finance website. anyone please help me. thanks

[R] Help text in plot

2011-10-18 Thread filippo gheri
Hi all, I have a basic plot MC_P1.DEM.1-qplot(x=Group, y=P1.DEM.UN.WPP.FER.TOT_var, data=GroupMeans_gr_DEM, geom=bar, stat=identity, fill=Group)+ myScale_fill()+getLabs(MC_P1.DEM.1) I would like to add a y-lab horizontally ON TOP OF y-axis...and I didn't understand how it works (with

[R] problem with project command in rgdal

2011-10-18 Thread kalee
Hi I'm trying to analyse some data and need to set the geographic coordinate system before I can do the analysis. I've been trying to use the project command in rgdal but keep getting an error message saying: Error in project(locationsMatrix, PROJECTION.OUT) : latitude or longitude exceeded

[R] Extracting equation from R code

2011-10-18 Thread tpet
Dear R-helpers, I am trying to extract two equations from an R code, but I am not being able to do it. The code is this: function (x, fullin, fullout, crossover, infz = 0.953, outfz = 0.047, details = FALSE) { if (fullin fullout || crossover fullout || fullin crossover)

[R] Function in nested loop

2011-10-18 Thread Eekhout, I.
Hi all, I would like to run a function with several nested conditions, which are completely factorial. The input data (x1) has two different sample sizes, so: x1 - dat1 x1 - dat2 Then a can have 3 different values: a - 0.15 a - 0.35 a - 0.50 Then b can have 2 different values: b - data.matrix

[R] How do I test the difference of skewness parameter between two arbitrary distributions?

2011-10-18 Thread Miles Yang
Hi R-users, I have a question about testing the difference of skewness parameter between two arbitrary distributions. I collect samples in an experiment. It is a one-independent variable (i.e., goal condition) with two levels (high goal or low goal). Now I got two distributions and I would like

Re: [R] Best practices for handling very small numbers?

2011-10-18 Thread Seref Arikan
Hi Dan, I've tried the log likelihood, but it reaches zero again, if I work with say 1000 samples. I need an approach that would scale to quite large sample sizes. Surely I can't be the first one to encounter this problem, and I'm sure I'm missing an option that is embarrassingly obvious. Regards

Re: [R] special language character in a pie chart

2011-10-18 Thread milena
Hi It as 12 hours since I have posted the question, could you let me know if it had been approved? On Mon, Oct 17, 2011 at 11:43 PM, milena milena.s...@gmail.com wrote: Dear List Members, I am working on a below piece of code: Initially have created pie charts with Enlish labels to present

[R] avoid s3 methods

2011-10-18 Thread Nicola Sturaro Sommacal
Hello everybody. My issue arise when I build a package with my functions. This package is for personal purposes only and it will not submitted to CRAN. Anyway, this may be an opportunity for myself to clear the S3 methods concept. I read the R manual and some books about R programming but they

Re: [R] problem with project command in rgdal

2011-10-18 Thread Michael Sumner
Hello, this question is more suitable for the R-Sig-Geo mailing list, so you could consider posting there in future. Read the information for that list here: https://stat.ethz.ch/mailman/listinfo/r-sig-geo Comments below. On Tue, Oct 18, 2011 at 3:11 PM, kalee kathryn.l...@students.mq.edu.au

[R] problem in exceuting PLS

2011-10-18 Thread arunkumar1111
Hi I'm performing a PLS This is my data present in a file Year Y X2 X3 X4 X5 X6 1960 27.8 397.5 42.2 50.7 78.3 65.8 1960 29.9 413.3 38.1 52 79.2 66.9 1961 29.8 439.2 40.3 54 79.2 67.8 1961 30.8 459.7 39.5 55.3 79.2 69.6 1962 31.2 492.9 37.3 54.7 77.4 68.7 My R-code Data -

Re: [R] problem in exceuting PLS

2011-10-18 Thread Uwe Ligges
On 18.10.2011 11:03, arunkumar wrote: Hi I'm performing a PLS This is my data present in a file Year Y X2 X3 X4 X5 X6 1960 27.8 397.5 42.2 50.7 78.3 65.8 1960 29.9 413.3 38.1 52 79.2 66.9 1961 29.8 439.2 40.3 54 79.2 67.8 1961 30.8 459.7 39.5 55.3 79.2 69.6 1962 31.2 492.9 37.3 54.7

Re: [R] cut data into sevral group and assign calculated values individually

2011-10-18 Thread Uwe Ligges
On 17.10.2011 20:53, Li, Yan wrote: Hi All, I have some data from which I set four points to be breaks. Based on these points, I cut the dataset into four groups and assign a number to it: =331.04 assign 0 331.04=476.07 assign data-331.04/(476.07-331.04) 476.07=608.66 assign 1

Re: [R] Independent component analysis with only one source of data

2011-10-18 Thread Uwe Ligges
On 17.10.2011 21:59, Noah Silverman wrote: Hi, Looking at the fastICA library. I want to test separating out different sounds from a recorded wav file. But, I only have a SINGLE stream of data (one channel wav.) It appears as if the fastICA won't let me separate more sounds than I have

Re: [R] Help text in plot

2011-10-18 Thread Uwe Ligges
On 18.10.2011 09:12, filippo gheri wrote: Hi all, I have a basic plot MC_P1.DEM.1-qplot(x=Group, y=P1.DEM.UN.WPP.FER.TOT_var, data=GroupMeans_gr_DEM, geom=bar, stat=identity, fill=Group)+ myScale_fill()+getLabs(MC_P1.DEM.1) I would like to add a y-lab horizontally ON TOP OF

Re: [R] avoid s3 methods

2011-10-18 Thread Uwe Ligges
On 18.10.2011 10:37, Nicola Sturaro Sommacal wrote: Hello everybody. My issue arise when I build a package with my functions. This package is for personal purposes only and it will not submitted to CRAN. Anyway, this may be an opportunity for myself to clear the S3 methods concept. I read

Re: [R] Best practices for handling very small numbers?

2011-10-18 Thread Duncan Murdoch
On 11-10-18 4:30 AM, Seref Arikan wrote: Hi Dan, I've tried the log likelihood, but it reaches zero again, if I work with say 1000 samples. I need an approach that would scale to quite large sample sizes. Surely I can't be the first one to encounter this problem, and I'm sure I'm missing an

Re: [R] special language character in a pie chart

2011-10-18 Thread Prof Brian Ripley
Please see the posting guide, and supply the information you were asked for (and read the relevant manuals). What OS? What locale? What graphics device? No extra support is needed: R handles Czech characters perfectly well in a Czech locale (or any UTF-8 locale provided you have the correct

Re: [R] avoid s3 methods

2011-10-18 Thread Nicola Sturaro Sommacal
Thank you very much for your reply. You confirm what I suppose. Can you give me a reference of that you wrote? I need it for a report. Thanks again. PS: sorry Uwe for the previous reply, not to the list. 2011/10/18 Uwe Ligges lig...@statistik.tu-dortmund.de On 18.10.2011 10:37, Nicola

Re: [R] avoid s3 methods

2011-10-18 Thread Uwe Ligges
On 18.10.2011 12:23, Nicola Sturaro Sommacal wrote: Thank you very much for your reply. You confirm what I suppose. Can you give me a reference of that you wrote? I need it for a report. Thanks again. PS: sorry Uwe for the previous reply, not to the list. ... where I replied it is in

Re: [R] avoid s3 methods

2011-10-18 Thread Nicola Sturaro Sommacal
Thank you again. Nicola 2011/10/18 Uwe Ligges lig...@statistik.tu-dortmund.de On 18.10.2011 12:23, Nicola Sturaro Sommacal wrote: Thank you very much for your reply. You confirm what I suppose. Can you give me a reference of that you wrote? I need it for a report. Thanks again.

[R] contrasts in MANOVA

2011-10-18 Thread Ondřej Mikula
Dear r-helpers, I have a query regarding use of contrasts in MANOVA. summary(manova(model)) gives me only result of test for overall difference. Would you be so kind and give me a hint how to get the same test statistics (e.g.Pillai's) and P values for the predefined contrasts? Best regards Ondrej

[R] Code behind the Function

2011-10-18 Thread Vikram Bahure
Hi, I am a new user in R. I wanted to study the code for some R commands. For example, as I was studying PCA analysis there is a command in R, as princomp. Normally if we type the command we get the code behind the function, but I am not able to get for this one. * princomp function (x, ...)

[R] control the conversion of factor to numeric

2011-10-18 Thread Martin Batholdy
Dear R-list, I currently have to convert a data.frame with several factor-variables to a numeric matrix. Now the problem is, that the order of the factor-labels don't match the order I would like to use. for example, let's assume I have this factor-variable in my data-frame: x -

Re: [R] Code behind the Function

2011-10-18 Thread Duncan Murdoch
On 11-10-18 7:34 AM, Vikram Bahure wrote: Hi, I am a new user in R. I wanted to study the code for some R commands. For example, as I was studying PCA analysis there is a command in R, as princomp. Normally if we type the command we get the code behind the function, but I am not able to get

[R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
I have a data set like this in one .txt file (cols separated by !): APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!!

Re: [R] over-estimation Negative Binomial models

2011-10-18 Thread Ben Bolker
D_Tomas tomasmeca at hotmail.com writes: I have fitted a Negative Binomial model (glm.nb) and a Poisson model (glm family=poisson) to some count data. Both have the same explanatory variables dataset When I call sum(fitted(model.poisson)) for my GLM-Poisson model, I obtain exactly the

Re: [R] Extracting results from a function output

2011-10-18 Thread Terry Therneau
Let me rephrase your question: How do I get the results that are printed by print(survfit()) Answer: read the help file ?print.survfit __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Let's do it in two parts: first create all the separate files (which if this what you are after, we can stop here). You can change the value on readLines to read in as many lines as you want; I set it to 2 just for testing. x - textConnection(APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1!

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thanks Jim, I tried to convert this solution into my situation (.txt file as an input); zz - file(myfile.txt, r) fileNo - 1 # used for file name buffer - NULL repeat{ input - read.csv(zz, as.is=T, nrows=100, sep='!', row.names=NULL, na.strings=) if (length(input) == 0) break # done

Re: [R] Foreach (doMC)

2011-10-18 Thread Jannis
Rui, I suggest you read the following tutorial to give you an introduction to foreach: http://cran.r-project.org/web/packages/doMC/vignettes/gettingstartedMC.pdf Regarding your question I could would suspect that you can not assign values to some variable inside foreach and use them outside

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Use 'readLines' instead of 'read.table'. We want to read in the text file and convert it into separate text files, each of which can then be read in using 'read.table'. My solution assumes that you have used readLines. Trying to do this with data frames gets messy. Keep it simple and do it in

Re: [R] problem with quantmod package

2011-10-18 Thread R. Michael Weylandt
I believe it's because they are not made available for download as a csv file. Compare: https://www.google.com/finance/historical?q=NSE:TCS with https://www.google.com/finance/historical?q=NASDAQ:AAPL You'll see that for AAPL, there is an option to export prices on the right hand side: that's

Re: [R] contrasts in MANOVA

2011-10-18 Thread John Fox
Dear Ondrej, You might use the linearHypothesis() function in the car package. Best, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox

Re: [R] Function in nested loop

2011-10-18 Thread R. Michael Weylandt
Without knowing the calculation you want to run, I can't give you any more direction than this, but it sounds like you need to take a step back and rethink your problem in terms of vectorization. If you can do so, outer() might be able to help as well as direct vectorwise calculation. If it's

Re: [R] Best practices for handling very small numbers?

2011-10-18 Thread Ben Bolker
Duncan Murdoch murdoch.duncan at gmail.com writes: On 11-10-18 4:30 AM, Seref Arikan wrote: Hi Dan, I've tried the log likelihood, but it reaches zero again, if I work with say 1000 samples. I need an approach that would scale to quite large sample sizes. Surely I can't be the first

[R] getting p-value and standard error in PLS

2011-10-18 Thread arunkumar1111
Hi How to get p-value and the standard error in PLS I have used the following function to calculate PLS fit1 - mvr(formula=Y~X1+X2+X3+X4, data=Dataset, comp=4) Please help me -- View this message in context:

[R] nuisance variables

2011-10-18 Thread Alexander Lebedev
*Dear experts,* Please excuse me for disturbing... Right now I am struggling with GLM a bit... Would you be so kind to provide me a solution on using nuisance variables. The problem is that I have data on Depression (volumetric measurements of different brain regions) and I want to include age,

Re: [R] GLM and Neg. Binomial models

2011-10-18 Thread D_Tomas
Dear Ben, First of all, many thanks for your reply. I am highly appreciative of that. I am still unsure about some issues The dispersion parameter is that which is estimated by sum(residuals(fit,type=pearson)^2)/fit$df.res. This is what a quasipoisson model estimates. This corresponds

Re: [R] nuisance variables

2011-10-18 Thread Alexander Lebedev
Sorry, I didn't notice a mistake... Sepal.Length is a dependent variable and Sepal.Width is an independent one... --- Regards Alex 2011/10/18 Alexander Lebedev alexander.vl.lebe...@gmail.com *Dear experts,* Please excuse me for disturbing... Right now I am struggling with GLM a bit... Would

Re: [R] over-estimation Negative Binomial models

2011-10-18 Thread D_Tomas
Ben, this is a continuation of the query i posted on: http://r.789695.n4.nabble.com/GLM-and-Neg-Binomial-models-td3902173.html I cannot give you a direct example (big dataset) of what i did aside from what i have written: fitpoisson - glm((RESPONSE) ~ A + B + offset(log(LENGTH)) +

[R] structural equation modelling with binary response

2011-10-18 Thread Mario Beolco
Dear R users, Apologies for the total beginner's question. I was wondering whether you could tell me if there is a structural equation modelling function that can handle binary data i.e. in similar manner to the GLM function with a binomial family. Best wishes, Mario

Re: [R] calculating ratios from all combinations

2011-10-18 Thread 1Rnwb
Thanks Micheal, that's what I wanted, I did not quite catch which variable is unused. Another part is I have my variable values in log scale so it generates '0's' instead of '1', how do i get rid of those cols. Thanks for you patience Sharad -- View this message in context:

Re: [R] control the conversion of factor to numeric

2011-10-18 Thread R. Michael Weylandt
Add levels= to your factor() call. E.g., x1 - factor(rep(1:4, 5), labels=c(slightly disagree, disagree, agree, slightly agree), levels = c(2,1,4,3)) as.numeric(x1) [1] 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 Michael On Tue, Oct 18, 2011 at 7:35 AM, Martin Batholdy batho...@googlemail.com

[R] Repeat a loop until...

2011-10-18 Thread Bonnett, Laura
Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thanks Jim for your help. I tried this code using readLines and it works but not in way I wanted. It seems that this code is trying to separate all records from a text file so that I'm getting over 14 000 000 text files. My intention is to get only 15 text files all expect one containing 1 000 000

Re: [R] control the conversion of factor to numeric

2011-10-18 Thread Martin Batholdy
Ok, I think that would work – thanks! However, in my case I read a data.frame via read.table(). So some of the columns get transformed to factors automatically – I don't generate the factor-variables as in the example, so I can't control how the levels are ordered (or can I?). On 18.10.2011,

Re: [R] control the conversion of factor to numeric

2011-10-18 Thread David Winsemius
On Oct 18, 2011, at 7:35 AM, Martin Batholdy wrote: Dear R-list, I currently have to convert a data.frame with several factor- variables to a numeric matrix. Now the problem is, that the order of the factor-labels don't match the order I would like to use. for example, let's assume

Re: [R] cut data into sevral group and assign calculated values individually

2011-10-18 Thread Li, Yan
Thanks for your reply. Let me make an example then: m- c(150, 400, 500,750,800, NA) How can I use cut to generate the m_group as c(0,0.4755,1, 0.2275,0,0): Breaks 331.04 476.07 608.66 791.5 NA m_group0 x 1

Re: [R] calculating ratios from all combinations

2011-10-18 Thread R. Michael Weylandt
In your code you had a loop over the variable col, but it was never used. Anyways, just modify the line: n - n[-length(n)] # Throwout unwanted columns to also throw out values with 0's. Perhaps: idxZeros - apply(d, 1, function(x) any( abs(x-0) 1e-08)) # Identify rows with zeros n -

[R] About an integral univariate problem

2011-10-18 Thread Freddy Hernandez Barajas
Hello all R users I want to calculate this univariate integral: exp(-x)*sum(y^x) respect to x from 0 to 3 where y is a vector y=(2,3,5). In fact, the original y vector has a large number of elements but I propose with 3 elements. I know that I can resolve this problem doing fun - function(x)

Re: [R] control the conversion of factor to numeric

2011-10-18 Thread Philipp Pagel
On Tue, Oct 18, 2011 at 03:40:27PM +0200, Martin Batholdy wrote: Ok, I think that would work – thanks! However, in my case I read a data.frame via read.table(). So some of the columns get transformed to factors automatically – I don't generate the factor-variables as in the example, so I

Re: [R] control the conversion of factor to numeric

2011-10-18 Thread R. Michael Weylandt
Use the stringsAsFactors = FALSE argument for read.table() so the strings will remain factors and then you can convert them directly yourself. Michael On Tue, Oct 18, 2011 at 9:40 AM, Martin Batholdy batho...@googlemail.com wrote: Ok, I think that would work – thanks! However, in my case I

[R] filled.contour with few data points

2011-10-18 Thread knut-o
Hi I'm using filled.contour in R with matrix 19x19. Therefore the plot isn't very smooth Are there any functions in R to make it smooth? I can't have more observations because it takes to long. Thanks, Knut -- View this message in context:

Re: [R] About an integral univariate problem

2011-10-18 Thread R. Michael Weylandt
How about adding an additional argument to fun? R fun - function(x, y) exp(-x)*sum(y^x) R y - c(2,3,5) R integrate(fun, 0, 3, y) [1] 346.853 with absolute error 3.9e-12 Michael On Tue, Oct 18, 2011 at 10:01 AM, Freddy Hernandez Barajas fhern...@gmail.com wrote: Hello all R users I want to

Re: [R] problem with quantmod package

2011-10-18 Thread G See
I'm not sure how to easily get that data from google (see Michael's message), but it's available from yahoo. getSymbols('TCS.NS', src='yahoo') I've found that historical stock data from Yahoo is typically cleaner and more reliable than from Google. The other main difference is that Yahoo

[R] how to invoke vba by r?

2011-10-18 Thread Wensui Liu
dear listers, right now, we are trying to use r to implement sas dde function, e.g. interact with excel. however, we can't find a way to call vba from r? any insight is appreciated. [[alternative HTML version deleted]] __

[R] heatmap

2011-10-18 Thread threshold
Dear R users, need help with my heatmap. I will really approciate some help. Given the matrix: head(x) A B C D time [1,] 0 8 0 01 [2,] 0 160 0 02 [3,] 0 175 0 03 [4,] 0 253 0 04 [5,] 79 212 0 05 [6,] 6 105 0 06 and call: ## Heatmap

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
I thought that you wanted a separate file for each of the breaks GG!KK!KK!. If you want to read in some large number of lines and then break them so that they have that many lines, you can do the same thing, except scanning from the back for a break. So if your input file has 14M breaks in it,

[R] Broken link on daba.lv

2011-10-18 Thread Emily
Hello , I was taking a look at your website and I noticed that one of the links you suggest in http://www.daba.lv/Adreses/RS_GPS.shtml isn't working properly. The link in question is this one: http://instruct1.cit.cornell.edu/~agl1/Hexagone.html. You'll find a similar resource published

Re: [R] calculating ratios from all combinations

2011-10-18 Thread 1Rnwb
thanks for the help and pointer. I am modifying it like this x=which(n[,1]==n[,2]) n=n[-x,] to get rid of combinations which will generate '0' or ratio of 1. Thanks once again. sharad -- View this message in context:

[R] rls() fails on function calling spline()

2011-10-18 Thread Hengstberger Florian
Hello everybody I want to use rls() on a multi-dimensional function, where parts of it are modeled using a spline. I tried to condense my problem into the following code example, which tries to fit the y-values of a spline interpolation:

Re: [R] About an integral univariate problem

2011-10-18 Thread R. Michael Weylandt
Your original code was not directly vectorizible (and I should have noted that): this should work: fnc - function(x, y) { z - outer(y, x, FUN = ^) exp(-x) * colSums(z) } y - c(2,3,5) integrate(fnc, 0, 3, y) This should work and sorry for the initial confusion. Michael On Tue, Oct 18,

[R] how to use VARselect with missing values - beginner's question

2011-10-18 Thread Iara Faria
Dear R helpers,   I have a ts object, dadosvar, and want to run a VAR. These are my data:   dadosvar[1:15,] dl    rp    igpm   ereal crescpib jurosreal  [1,] 32.31    NA 39.07  419.59   NA   7025.95  [2,] 32.00    NA 40.78  596.57   NA  13401.25  [3,] 32.70    NA 45.71 

[R] contact person for UseR 2012, please?

2011-10-18 Thread Erin Hodgess
Dear R People: Do you know who the contact person is for UseR 2012, please? I'm trying to get together some numbers for funding (sorry for the tackiness). Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown

Re: [R] contact person for UseR 2012, please?

2011-10-18 Thread David Winsemius
On Oct 18, 2011, at 12:25 PM, Erin Hodgess wrote: Dear R People: Do you know who the contact person is for UseR 2012, please? I'm trying to get together some numbers for funding (sorry for the Funny, it was the first hit on a Google search with term useR2012

Re: [R] contact person for UseR 2012, please?

2011-10-18 Thread Matt Shotwell
The contact person is: Stephania McNeal-Goddard email: stephania.mcneal-godd...@vanderbilt.edu phone: (615)322-2768 Vanderbilt University School of Medicine Department of Biostatistics S-2323 Medical Center North Nashville, TN 37232-2158 On Tue, 2011-10-18 at 12:41 -0400, David Winsemius wrote:

Re: [R] how to invoke vba by r?

2011-10-18 Thread Richard M. Heiberger
Please look at the RExcel project rcom.univie.ac.at followup should probably be on that mailing list. Rich On Tue, Oct 18, 2011 at 10:32 AM, Wensui Liu liuwen...@gmail.com wrote: dear listers, right now, we are trying to use r to implement sas dde function, e.g. interact with excel.

[R] p value in R - beginners question

2011-10-18 Thread niki
Dear all, i have done some regression analyses but i do not understand the p value. These are the results t-value p value geno.1 -0.229 0.978 -0.234 8.15e-01 geno.50.647 1.146 0.565 5.73e-01 stress:geno.5-1.337 1.022 -1.307

[R] Per sites contributions from a correlation test

2011-10-18 Thread Francisco Flandes
Hello, I have two numeric vectors in R and used cor.test function with them. Is it possible in R to know how much contributed a particular row of the vectors to the total correlation value and significance? Of course I just could take out that row from the vectors and run the test again to see

[R] Detect and replace omitted data

2011-10-18 Thread Jonny Armstrong
I am analyzing the spatial distribution of fish in a stream. The stream is divided into equally sized units, and the number of fish in each unit is counted. My problem is that my dataset is missing rows where the count in a unit equals zero. I need to create zero data for the missing units. For

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thank you Jim for your kind reply. My intention was to split one 14M file into less than 15 text files, each of them having ~1M lines. The idea was to make sure that one sequence GG!KK!KK! --sequence start APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1!

Re: [R] Detect and replace omitted data

2011-10-18 Thread Sarah Goslee
Hi Jonny, On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong jonny5armstr...@gmail.com wrote: I am analyzing the spatial distribution of fish in a stream. The stream is divided into equally sized units, and the number of fish in each unit is counted. My problem is that my dataset is missing rows

Re: [R] Detect and replace omitted data

2011-10-18 Thread Trevor Davies
Here is one option: a- data.frame(day=c(rep(4,8),rep(6,8)),unit= c((1:8),seq(2,16,2)),value=round(runif(16,1,34),0)) #approx your data b- data.frame(day=c(rep(4,16),rep(6,16)),unit= 1:16) #fake df b1-merge (a,b, by=c('day','unit'),all.y=T) b1$value[is.na(b1$value)]-0

Re: [R] Detect and replace omitted data

2011-10-18 Thread David Winsemius
On Oct 18, 2011, at 2:24 PM, Sarah Goslee wrote: Hi Jonny, On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong jonny5armstr...@gmail.com wrote: I am analyzing the spatial distribution of fish in a stream. The stream is divided into equally sized units, and the number of fish in each unit is

Re: [R] p value in R - beginners question

2011-10-18 Thread B77S
This is just scientific notation, so 8.15e-01 is the same as: 8.15*10^-1 [1] 0.815 niki wrote: Dear all, i have done some regression analyses but i do not understand the p value. These are the results t-value p value geno.1

Re: [R] Detect and replace omitted data

2011-10-18 Thread Dennis Murphy
Prompted by David's xtabs() suggestion, one way to do what I think the OP wants is to * define day and unit as factors whose levels comprise the full range of desired values; * use xtabs(); * return the result as a data frame. Something like x - data.frame( day = factor(rep(c(4, 6), each = 8),

[R] Non-linear maximization function in R

2011-10-18 Thread aazaff
Hello, # Full disclosure. I am not sure if my problem is a bug(s) in the code, or a fundamental misunderstanding on my part about what I am trying to do with these statistics. I am not familiar with maximum likelihood tests. # I currently have two vectors Aequipecten-c(0, 0, 1, 0, 0, 0, 0, 0,

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Then read in a million lines, scan back for the break, write out the data, delete from the buffer, then read the next million lines into the buffer. On Tuesday, October 18, 2011, johannes rara johannesr...@gmail.com wrote: Thank you Jim for your kind reply. My intention was to split one 14M

Re: [R] Detect and replace omitted data

2011-10-18 Thread Jonny Armstrong
Thanks you for the quick and helpful replies. Problem solved. Jonny On Tue, Oct 18, 2011 at 11:33 AM, David Winsemius dwinsem...@comcast.netwrote: On Oct 18, 2011, at 2:24 PM, Sarah Goslee wrote: Hi Jonny, On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong jonny5armstr...@gmail.com wrote:

[R] reading a dense file of binary number

2011-10-18 Thread Brian Tsai
hi all, i have a file of the following format that i want to read into a matrix: 010101001110101 10101001010 01001010010 ... it has no headers or row names. I tried to use read.table(), but it doesn't allow me to specify nothing as the column separator (specifying sep='' means

Re: [R] reading a dense file of binary number

2011-10-18 Thread R. Michael Weylandt
Would readLines() work? Michael On Tue, Oct 18, 2011 at 3:09 PM, Brian Tsai btsa...@gmail.com wrote: hi all, i have a file of the following format that i want to read into a matrix: 010101001110101 10101001010 01001010010 ... it has no headers or row names. I tried to use

Re: [R] reading a dense file of binary number

2011-10-18 Thread Jorge I Velez
Hi Brian, Take a look at ?scan x - scan(file.choose(), what = 'list') Read 3 items x [1] 010101001110101 10101001010 01001010010 as.matrix(x) [,1] [1,] 010101001110101 [2,] 10101001010 [3,] 01001010010 HTH, Jorge On Tue, Oct 18, 2011 at 3:09 PM, Brian Tsai wrote: hi

Re: [R] Detect and replace omitted data

2011-10-18 Thread David Winsemius
On Oct 18, 2011, at 2:53 PM, Dennis Murphy wrote: Prompted by David's xtabs() suggestion, one way to do what I think the OP wants is to * define day and unit as factors whose levels comprise the full range of desired values; * use xtabs(); * return the result as a data frame. Something like x

Re: [R] reading a dense file of binary number

2011-10-18 Thread David L Carlson
Or do you want each number separated? data - textConnection(010101001110101 + 10101001010 + 01001010010 + ) result - as.matrix(read.fwf(data, rep(1, 15))) result V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 [1,] 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 [2,] 1 0

[R] getting basic descriptive stats off multiple imputation data

2011-10-18 Thread Michael Parent
Hi, all, I'm running multiple imputation to handle missing data and I'm running into a problem. I can generate the MI data sets in both amelia and the mi package (they look fine), but I can't figure out how to get pooled results. The examples from the mi package, zelig, etc., all seem to go

[R] Bucketing Data

2011-10-18 Thread Ben Wilkinson
I am looking for a way to bucket data in 2 dimensions using a weighting that will linearly allocate based on the proximity of the reference value. I'm sure the functionality probably already exists but couldn't find an example: Example Data Yrs,strike,value 0.75,105,100 1.25,102.5,200 Time

Re: [R] contact person for UseR 2012, please?

2011-10-18 Thread Peter Alspach
Tena koe Erin http://biostat.mc.vanderbilt.edu/wiki/Main/UseR-2012 has the contact person on the front page ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Erin Hodgess Sent: Wednesday, 19 October 2011

Re: [R] getting basic descriptive stats off multiple imputation data

2011-10-18 Thread Weidong Gu
Mike, You can retrieve each of imputed data sets and use Rubin's rule for combined analysis. I am not sure how to do combined analysis of cov, but mean and SE would be estimiable. For mi package to get individual copies of imputed data ?mi.completed HTH Weidong Gu On Tue, Oct 18, 2011 at

Re: [R] getting basic descriptive stats off multiple imputation data

2011-10-18 Thread Michael Parent
Hi, Thanks! So, you're saying I should output the descriptives from the individual data files, and manually do the stats to get the combined estimates (or, I can use the files in mplus or spss to run it in those programs)? Is there no automated process in any of the mi or mi-related packages

[R] translating a character string

2011-10-18 Thread Erin Hodgess
Dear R People: Suppose I have the following character string: f1 [1] (1/30)*(20-x) My goal is to end up with y - (1/30)*(20-x) How would I do this, please? I've been experimenting with eval, but no good so far. As usual, I have the feeling that this is something really simple, but I can't

Re: [R] translating a character string

2011-10-18 Thread Rolf Turner
On 19/10/11 13:57, Erin Hodgess wrote: Dear R People: Suppose I have the following character string: f1 [1] (1/30)*(20-x) My goal is to end up with y- (1/30)*(20-x) How would I do this, please? I've been experimenting with eval, but no good so far. As usual, I have the feeling that this

[R] Monte Carlo Random Walk

2011-10-18 Thread jerome
Hello all, I am quite new to R, with the goal of using it for a project in my business course. I am attempt to run a Monte Carlo simulation of futures prices based on a random walk whereby the given volatility (I will use historical volatility in this case, say 12%) is Levy-distributed , equally

[R] r-Help web site access problem

2011-10-18 Thread Cem Girit
Hello, I cannot access the r-help website although after registration I am getting all the posts sent to the side. Each time I click on the Visit Subscriber List on the https://stat.ethz.ch/mailman/listinfo/r-help site, I get R-help roster authentication failed. error. Any

Re: [R] problem with project command in rgdal

2011-10-18 Thread kalee
Hi Mike Thanks for your comments. I had the code trying to project() the lat, long so all fixed now. Thanks for your help and pointing out the R-sig-Geo mailing list which I'll use in the future should I have other questions. Thanks Kate -- View this message in context:

[R] Ordering of stack in ggplot (package ggplot2)

2011-10-18 Thread swonder03
I'm trying to reproduce the 3rd graph on the page of this site: http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However, the data below produces a ggplot with the stacks sorted in alphabetical order from the bottom up. I'd like the stacks to be in the order Europe, Asia, Americas,

[R] R classification

2011-10-18 Thread Comp. Eng. Mohammed Al-Ghareeb
hello, i am so glad to write you. i am dealing now with writing my M.Sc in Applied Statistics thesis, titled Data Mining Classifiers and Predictive Models Validation and Evaluation. I am planning to compare several DM classifiers like NN, kNN, SVM, Dtree, and Naïve Bayes according to their

[R] hypothetical prediction after polr

2011-10-18 Thread Xu Jun
Dear R-Help listers, I am trying to estimate an proportional odds logistic regression model (or ordered logistic regression) and then make predictions by supplying a hypothetical x vector. However, somehow this does not work. I guess I must have missed something here. I first used the polr

Re: [R] r-Help web site access problem

2011-10-18 Thread David Winsemius
On Oct 18, 2011, at 6:27 PM, Cem Girit wrote: Hello, I cannot access the r-help website although after registration I am getting all the posts sent to the side. Each time I click on the Visit Subscriber List on the https://stat.ethz.ch/mailman/listinfo/r-help site, I get

  1   2   >