Re: [R] Wrong output in R.14

2012-10-26 Thread Rolf Turner
FAQ 7.31 cheers, Rolf Turner On 27/10/12 04:31, Elham Khodayari Moez wrote: Dear Sir/Madam, I am a MSc student of Biostatistics. For my thesis, I used R to simulate data. Surprisingly, when I wrote the code below in R14, the output was a vector full of "FALSE"s. Would you please c

[R] Searching up a list of values

2012-10-26 Thread Jeremy Ng
Dear list, Sorry if this is a really simple question to ask, but I have been stuck at this for some time and have no luck so far. I have 2 data files- a file containing IDs which I am interested in (maybe about 20 of them)- lets call this file A, and another file containing all the IDs (which is

[R] [gam] [mgcv] Question in integrating a eiker-white "sandwich" VCV estimator into GAM

2012-10-26 Thread Andrew Crane-Droesch
Dear List, I'm just teaching myself semi-parametric techniques. Apologies in advance for the long post. I've got observational data and a longitudinal, semi-parametric model that I want to fit in GAM (or potentially something equivalent), and I'm not sure how to do it. I'm posting this to as

[R] summation sign

2012-10-26 Thread sffarooqi
Hi all, I have a very quick question on how to use the summation sign in R for the function. Here´s a basic example: the function is sum(i=1 to 5)log(1-xi^2) Id be grateful if someone knows how to do this without writing it out 5 times - I am looking sth along the lines of the following: computeR

Re: [R] Encoding

2012-10-26 Thread Eva Prieto Castro
Hi, I solved the problem as follows: source(file="example.R", encoding="UCS-2") Thanks Eva --- El sáb, 27/10/12, Eva Prieto Castro escribió: De: Eva Prieto Castro Asunto: Encoding Para: r-help@r-project.org Fecha: sábado, 27 de octubre, 2012 07:34 Hi, I work with R on Windows, so I use AN

Re: [R] using match-type function to return correctly ordered data from a dataframe

2012-10-26 Thread Jeff Newmiller
Have you actually read ?"%in%" ? Although a valuable tool, not all answers are most effectively obtained by Googling. Also, your repeated assertions that the answers are not maintained in order are poorly framed. They DO stay in order according to the zipcode database order. That said, your

Re: [R] Openbugs- Array Index

2012-10-26 Thread Jeff Newmiller
You seem to be lost. Try http://mathstat.helsinki.fi/openbugs/community/CommBBS.html --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] Encoding

2012-10-26 Thread Eva Prieto Castro
Hi, I work with R on Windows, so I use ANSI encode; but when I run my projects on a linux or mac pc, It fails, so I change the encoding to unicode (in the same mac pc) and runs ok. The problema is that I need tu make the package in mi pc (windows) and when I save my sources as unicode it fails

Re: [R] Where Can I Find the Function letterTrevor?

2012-10-26 Thread Kirsten Simmons
I think it's related to the labeling and text in the figure, since that's where I'm getting my error message. Not sure why I didn't think to contact the original authors - thanks for the tip, I'll try to track them down. :) Kirsten Sent from iMe, OS1.5 On Oct 26, 2012, at 5:32 PM, Sarah Gosle

Re: [R] Wrong output in R.14

2012-10-26 Thread Duncan Murdoch
On 12-10-26 11:31 AM, Elham Khodayari Moez wrote: Dear Sir/Madam, I am a MSc student of Biostatistics. For my thesis, I used R to simulate data. Surprisingly, when I wrote the code below in R14, the output was a vector full of "FALSE"s. Would you please check and let me know why this happend? S

Re: [R] Plot lmer model with Effects package

2012-10-26 Thread John Fox
Dear Marte, On Thu, 25 Oct 2012 16:11:07 +0200 Marte Lilleeng wrote: > Hi everyone! > I have a simple model that i would like to plot with 95% CIs. > It is like follows: > m1<-lmer(Richness~Grazing+I(Grazing^2)+(1|Plot),family=poisson) > > By using the effects package I get two plots, one for t

Re: [R] Creating a certain set of points with geographic coordinates between two endpoints

2012-10-26 Thread Michael Sumner
The greatCircle function in package geosphere may be what you want, and try the R-Sig-Geo mailing list to target this topic. Cheers, Mike On Saturday, October 27, 2012, Ravichandra MONDRETI wrote: > > > Hi all, > > > > I am a very recent user of R. Mine is probably a basic question. I > would l

Re: [R] Grid Width in polar.plot

2012-10-26 Thread Peter Ehlers
On 2012-10-26 06:48, MartinD wrote: Hello, I am using the polar.plot function from plotrix. Is there a way to change the width of the grid lines? grid.lwd doesn't work Thanks Martin See the recent discussion about changing the line _type_ in radial.plot() where I gave suggestions to chang

Re: [R] Parsing very large xml datafiles with SAX: How to profile functions?

2012-10-26 Thread Duncan Temple Lang
Hi Frederic Perhaps the simplest way to profile the individual functions in your handlers is to write the individual handlers as regular named functions, i.e. assigned to a variable in your work space (or function body) and then two write the handler functions as wrapper functions that call thes

Re: [R] asking about R Code

2012-10-26 Thread Jeff Newmiller
You seem to be quite lost. You should execute one statement at a time, and troubleshoot from there. I suspect that your attempts to get your file in the right place went wrong, or the file is the wrong type of file for that function (regardless of the name you gave it). As for giving you an exp

[R] Openbugs- Array Index

2012-10-26 Thread SuzieK
Hi, I'm working on the codes below however every time I run them when they get to OpenBUGS I keep getting the error message: array index is greater than array upper bound for hab. Any help would be greatly appreciated, Suzie Codes: ungulate <- read.csv(file.choose ()) #ungulate ung

Re: [R] regression analysis in R

2012-10-26 Thread Peter Ehlers
On 2012-10-26 13:00, eliza botto wrote: Dear useRs, i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i

Re: [R] Delete row if two values in a matrix are equal

2012-10-26 Thread arun
Hi, You can try either one of these: dat1<-read.table(text=" Ref_Pos    Ref_Allele    Var_Allele    Var_Freq   1    A  A    100   2    T  G  50   3    G  G   

Re: [R] how to make simulation faster

2012-10-26 Thread stats12
Thank you very much for saving my time. I ran 500 simulations in 20 min using "sapply" function. I'll try "data.table" method for the rest of my simulations to get the results even faster. Thanks a lot again! jholtman wrote > You can get even better improvement using the 'data.table' package: >

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-26 Thread Richard James
That solution works very well. The only issue is that 'rnorm' occasionally generates negative values which aren't logical in this situation. Is there a way to set a lower limit of zero? -- View this message in context: http://r.789695.n4.nabble.com/Optimization-in-R-similar-to-MS-Excel-Sol

[R] Creating a certain set of points with geographic coordinates between two endpoints

2012-10-26 Thread Ravichandra MONDRETI
Hi all, I am a very recent user of R. Mine is probably a basic question. I would like to know how do we create a certain set of points with geographic coordinates, between two endpoints. Please explain me how to do this using R. Which are the packages to be used for doing this. Thanks i

Re: [R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread Paul Bernal
Sorry I forgot to include the R list. Best regards, Paul El 26/10/2012 14:47, "Hervé Pagès" escribió: > Why taking this off-list? Don't you want people on the list to tell you > how they do this on Windows? I don't use Windows sorry, so I can't help > you. One note though is that, as far as CRA

[R] combined output with zelig is not working!?!

2012-10-26 Thread swarna
Hi everyone, I have carried out a multiple imputation in R using Amelia II and have created 5 multiply imputed datasets. The purpose of my research is to fit a Poisson Model to the data to estimate numbers of hospital admissions. Now that I have 5 completed datasets and I have to pool all the 5 d

[R] rollapply() by time, not entries (width)

2012-10-26 Thread Jaguar83
Hi all- Thank you for reading my post. Please bear in mind that I'm very much a newbie with R! My question is this: I'm trying to use rollapply() on an irregular time series so I can't simply use the width parameter (I don't think). Rather than last 5 entries, I'd like to rollapply on last 6 mont

[R] Reading Chinese Language (GB2312) Input

2012-10-26 Thread jgreenb1
I am trying to read a csv file with Chinese language text in it. The file should look like this: userid,jobid,Title,companyid,industryids1 82497,1160,互联网产品经理,12 96429,658,企划经理(商业公司),24 14471,95,产品运营经理,25,6 14471,1708,产品营销高级经理,727,2 14471,1558,产品总监,611,4 14471,1777,产品总监,743,1 14471,1697,产品经理,725,23

[R] using match-type function to return correctly ordered data from a dataframe

2012-10-26 Thread Markus Weisner
I am regularly running into a problem where I can't seem to figure out how maintain correct data order when selecting data out of a dataframe. The below code shows an example of trying to pull data from a dataframe using ordered zip codes. My problem is returning the pulled data in the correct or

[R] Wrong output in R.14

2012-10-26 Thread Elham Khodayari Moez
Dear Sir/Madam, I am a MSc student of Biostatistics. For my thesis, I used R to simulate data. Surprisingly, when I wrote the code below in R14, the output was a vector full of "FALSE"s. Would you please check and let me know why this happend? ti=seq(1,10,by=0.1) ti==2.9 I'm looking forward to re

Re: [R] Delete row if two values in a matrix are equal

2012-10-26 Thread JDINIS
Thanks Rui for all your help and I really appreciate you taking the time to explain everything! -- View this message in context: http://r.789695.n4.nabble.com/Delete-row-if-two-values-in-a-matrix-are-equal-tp4647554p4647565.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Gini with bias correction

2012-10-26 Thread Diego Rojas
Hey there, I was wondering if someone could tell me if there's a package or command that allows me to compute a GINI coefficient using a vector of weights. Also the coefficient should be bias corrected. Diego Rojas [[alternative HTML version deleted]] ___

Re: [R] SPACECAP error "subscript out of bounds"

2012-10-26 Thread jmosley
CENTERS.csv Hello all, I'm trying to run SPACECAP. A couple of days ago I ran it with a centers file with 300 GPS points, now I'm trying to run it with 2250, but I get this error: Error in NN[i, 1:length(od)] <- od : subscript out of bou

Re: [R] Number of decimal places

2012-10-26 Thread Rui Barradas
Hello, There might be another problem with some of the numbers in the example. R uses C's double numeric type and that means that the limit is around 16 decimal digits of precision. One of the numbers has 23, so there will allways be loss of accuracy. a <- 234235423.56 b <-

Re: [R] regression analysis in R

2012-10-26 Thread Rui Barradas
Hello, Using the same example, at the end, add the following lines to have the models ordered by AIC. aic <- lapply(res2, AIC) idx <- order(unlist(aic)) lapply(list1[idx], names) And if there are more than 10 models, if you want the 10 best, best10 <- idx[1:10] lapply(list1[best10], names)

Re: [R] SQL via RODBC

2012-10-26 Thread Jeff Newmiller
That would be very implementation-specific, and ODBC is generic in its own way. No, you must run one query at a time in general, and deal with the results using the procedural language. Keep in mind that you have to pick a back-end database to work with, and for creating the database you may ha

Re: [R] Defining categories

2012-10-26 Thread bibek sharma
Thank you all for your suggestions. It really helped me a lot. Best, Bibek On Thu, Oct 25, 2012 at 4:44 AM, arun wrote: > HI Petr, > > Thanks for sharing the function. True, very efficient than cut. > > dat1$cat<-findInterval(dat1$V1, 1:6, rightmost.closed = T, all.inside = T) >

[R] Problems getting slope and intercept to change when do multiple reps.

2012-10-26 Thread Adel Powell
library(ROCR) n <- 1000 fitglm <- function(iteration,intercept,sigma,tau,beta){ x <- rnorm(n,0,sigma) ystar <- intercept+beta*x z <- rbinom(n,1,plogis(ystar)) xerr <- x + rnorm(n,0,tau) model<-glm(z ~ xerr, family=binomial(logit)) *int*<-coef(model)[1] *slope*<-coef(model)[2] # when a

Re: [R] regression analysis in R

2012-10-26 Thread arun
HI, May be this helps. set.seed(8) mat1<-matrix(sample(150,90,replace=FALSE),ncol=9,nrow=10) dat1<-data.frame(mat1) set.seed(10) B<-sample(150:190,10,replace=FALSE) res1<-lapply(dat1,function(x) lm(B~as.matrix(x))) #or res1<-lapply(dat1,function(x) lm(B~x)) res1Summary<-lapply(res1,summary) #to g

Re: [R] Where Can I Find the Function letterTrevor?

2012-10-26 Thread Sarah Goslee
It's never actually used in the sample code you linked to, so you may not even need it. Your best bet is to try to track down the author of that page; it's not part of any of the normal R packages. Sarah On Fri, Oct 26, 2012 at 5:22 PM, K Simmons wrote: > Hi All, > > I'm trying to create two sid

[R] Where Can I Find the Function letterTrevor?

2012-10-26 Thread K Simmons
Hi All, I'm trying to create two side-by-side contour plots with one legend by modifying the code found here: http://wiki.cbr.washington.edu/qerm/sites/qerm/images/b/bb/Example_4-panel_v1a.R I've been able to set up the other two functions called in the code, but I can't find reference to print.l

Re: [R] Parsing very large xml datafiles with SAX (XML package): What data structure should I favor?

2012-10-26 Thread R. Michael Weylandt
I'd look into the data.table package. Cheers, RMW On Oct 26, 2012, at 6:00 PM, Frederic Fournier wrote: > Hello again, > > I have another question related to parsing a very large xml file with SAX: > what kind of data structure should I favor? Unlike using DOM function that > can return list

Re: [R] Merge matrices with different column names

2012-10-26 Thread arun
Hi, Not sure how you want the results to look like in .csv file. If "L" is the list of matrices, you can also use ?sink() sink("L.csv") L  sink() #L.csv output: $matrix1 var1 var2 var3 [1 ]147 [2 ]258 [3 ]369 $matrix2 var4 var5 var6 [1 ]

Re: [R] backward stepwise model selection

2012-10-26 Thread Ben Bolker
Hui Du dataventures.com> writes: > I know in R there is function named 'step', which does the > stepwise regression and choose the model by AIC. > However, if I want to choose a model per this logic: > > 1. Run a full model (linear regression, f = lm(y ~., data = ZZZ), >for example)

Re: [R] Stata Database & R

2012-10-26 Thread Loukia Spineli
Install the "ares" library first. Then type import.data("the direction you have saved the data","dta"). On Fri, Oct 26, 2012 at 11:10 PM, Lorenzo Isella wrote: > Dear All, > I am given some data to analyze. The data is in the form of a Stata > database (.dta file). > What is the best way to impor

[R] Stata Database & R

2012-10-26 Thread Lorenzo Isella
Dear All, I am given some data to analyze. The data is in the form of a Stata database (.dta file). What is the best way to import it into an R dataframe? Is there any particular caveat I should be aware of? Many thanks Lorenzo __ R-help@r-project.o

Re: [R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread Yihui Xie
I'm wondering if anyone has written a script to automate this job for Windows. I mainly use Ubuntu, so I do not care much since it is easy under Debian/Ubuntu, but I remember the boring process of updating R under Windows: uninstall the current version, go to CRAN, download, install, check a few ch

[R] regression analysis in R

2012-10-26 Thread eliza botto
Dear useRs, i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i would like to know best 10 regression res

Re: [R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread Hervé Pagès
Why taking this off-list? Don't you want people on the list to tell you how they do this on Windows? I don't use Windows sorry, so I can't help you. One note though is that, as far as CRAN packages are concerned, re-installing them on Windows should be relatively fast (as long as you have fast acc

[R] backward stepwise model selection

2012-10-26 Thread Hui Du
Hi All, I know in R there is function named 'step', which does the stepwise regression and choose the model by AIC. However, if I want to choose a model per this logic: 1. Run a full model (linear regression, f = lm(y ~., data = ZZZ), for example) 2. Pick up the variable with bi

Re: [R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread Hervé Pagès
Hi Paul, If your question is whether there is a way for you to replace your current R 2.15.0 with new R 2.15.2 without having to re-install all the packages you installed under R 2.15.0, maybe there is a way to do this (even though it's probably not recommended), and a lot of people on this lis

Re: [R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread Uwe Ligges
On 26.10.2012 15:28, PaulJr wrote: Dear R users, I hope you all are doing great. Is there a way to automatically upgrade my R 2.15.0 to the new R 2.15.2 release instead of having to reinstall the new release? No, you have to install it. Uwe Ligges Any information regarding this would be

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-26 Thread Berend Hasselman
On 26-10-2012, at 12:50, Richard James wrote: > Dear Berend and Thomas, > > thank you for suggesting the lsei function. I found that the tlsce {BCE} > function also works very well: > > library("BCE") > tlsce(A=bmat,B=target) > > The limSolve package has an 'xsample' function for generating un

[R] G-test function in the stats package or on CRAN?

2012-10-26 Thread Hervé Pagès
Hi, The Biostrings package (Bioconductor) contains a function (g.test(), not exported) that does a G-test. It was originally written by Peter Hurd. See: https://stat.ethz.ch/pipermail/r-sig-ecology/2008-July/000275.html Peter Hurd's implementation of g.test() looks very much like the implemen

Re: [R] Creating a correlation matrix from a vector

2012-10-26 Thread Peter Ehlers
On 2012-10-26 08:58, David Winsemius wrote: On Oct 26, 2012, at 6:52 AM, F_Smithers wrote: I'm looking to create a correlation matrix, but I have already obtained the correlations, which are stored in a vector. (Basically, I'm running a simulation which requires a correlation matrix, but I am

Re: [R] how to make simulation faster

2012-10-26 Thread jim holtman
You can get even better improvement using the 'data.table' package: > require(data.table) > system.time({ + dt <- data.table(value = x, z = z) + r3 <- dt[ + , list(sum = sum(value)) + , keyby = z + ] + }) user system elapsed 0.140.000.14

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-26 Thread Berend Hasselman
On 26-10-2012, at 12:50, Richard James wrote: > Dear Berend and Thomas, > > thank you for suggesting the lsei function. I found that the tlsce {BCE} > function also works very well: > > library("BCE") > tlsce(A=bmat,B=target) > > The limSolve package has an 'xsample' function for generating un

Re: [R] how to make simulation faster

2012-10-26 Thread jim holtman
The code you posted was not runnable. 'r' and at least 'Zi' were missing. The 'total time' is the amount of the elapsed time that it was sampling with the given function. The "self time" is how much time was actually spent in that function. >From your data, one of the big hitter is the "factor"

[R] Parsing very large xml datafiles with SAX (XML package): What data structure should I favor?

2012-10-26 Thread Frederic Fournier
Hello again, I have another question related to parsing a very large xml file with SAX: what kind of data structure should I favor? Unlike using DOM function that can return lists of relevant nodes and let me use various versions of 'apply', the SAX parsing returns me one thing at a time. I first

[R] Parsing very large xml datafiles with SAX: How to profile functions?

2012-10-26 Thread Frederic Fournier
Hello everyone, I'm trying to parse a very large XML file using SAX with the XML package (i.e., mainly the xmlEventParsing function). This function takes as an argument a list of other functions (handlers) that will be called to handle particular xml nodes. If when I use Rprof(), all the handler

Re: [R] Package RODBC sqlQueries

2012-10-26 Thread Marc Schwartz
On Oct 26, 2012, at 11:02 AM, Steven Ranney wrote: > All - > > I'm new to SQL and the RODBC package. I've read the documentation > associated with the RODBC package, but I'm still having problems with > my SQL statements; I think my syntax, particularly with respect to my > WHERE statement, is

Re: [R] Number of decimal places

2012-10-26 Thread David Winsemius
Putting back the context: ( We are not looking at this with Nabble.) > When estimating values ​​each determined similarly, and in which get to them > by algebraic operations in some cases, are rounded with 0 decimal places and > in other cases with 2 or 3 decimal places. What is happening? > Than

[R] Package RODBC sqlQueries

2012-10-26 Thread Steven Ranney
All - I'm new to SQL and the RODBC package. I've read the documentation associated with the RODBC package, but I'm still having problems with my SQL statements; I think my syntax, particularly with respect to my WHERE statement, is off but I can't find any documentation as to why. When I run a q

Re: [R] matrix algebra for constructing a special matrix?

2012-10-26 Thread William Dunlap
I think f0 (from your code) and f1 give identical results f0 <- function (m = 3, n = 4) { stopifnot(m>0, n>0) mn <- m * n k <- m + n - 1 X <- matrix(0, mn, k) for (i in 1:n) { wr <- 1:m + (i - 1) * m wc <- rev(1:m + (i - 1)) where <- cbind(wr, wc)

Re: [R] Creating a correlation matrix from a vector

2012-10-26 Thread David Winsemius
On Oct 26, 2012, at 6:52 AM, F_Smithers wrote: > I'm looking to create a correlation matrix, but I have already obtained the > correlations, which are stored in a vector. (Basically, I'm running a > simulation which requires a correlation matrix, but I am simulating the > various correlations.) >

[R] SQL via RODBC

2012-10-26 Thread Dr. Alireza Zolfaghari
Hi list, Is there a way to use sqlQuery function where there is a sql file (ie. sample.sql)? I just want to mention that in my sql file there are some comment lines (starting with --). This means that if I paste all the lines in the sql file, I'll come up with a long string that most part of it is

Re: [R] Delete first row

2012-10-26 Thread David Winsemius
On Oct 26, 2012, at 2:45 AM, Bharat Warule wrote: > Hi, > > I have to delete first row from my csv file but I don’t want to read total > data in to R memory (size is around 10GB). Actually, I want to use LAF > package but which read data without header. ?read.csv There is a 'skip' parameter an

Re: [R] Delete row if two values in a matrix are equal

2012-10-26 Thread Rui Barradas
Hello, First, two notes: 1. 'var' is a really bad name for a variable, it already is an R function. 2. Your matrix seems more like a data.frame. The difference is important because data.frames by default coerce character strings to factors. I have tried to make the code work if this is the case

[R] Delete row if two values in a matrix are equal

2012-10-26 Thread JDINIS
Hi all and thank you for your time. I would like to delete rows from this matrix I call "var" if the character in Ref_Allele is equal to the character in Var_Allele. I have attached a before and after, to help my poor explanation. If someone could provide me with some code, or some guidance I wou

[R] Seasonal smoothing of data with large gaps (mgcv)

2012-10-26 Thread Mark Payne
Hi, I have a set of measurements that are made on a daily basis over many years. I would like to produce a *non-parametric* smooth of these data to estimate the seasonal cycle - to achieve this, I have been using the cyclic cubic splines from the mgcv package. This works superbly in most situation

Re: [R] Why my code does not draw? how to fix it? plz....

2012-10-26 Thread Rui Barradas
Hello, Just run your code and every time there's an error correct it. number <- c(0,1,3,4,5,6,8) rsidp <- function(x){ y <- sample(number,x,replace=TRUE) y # don't need return() } plot(0, xlim=c(0,20), ylim=c(0,20), type="n", xlab="Sample size", ylab="Sample variance") for (i in seq

Re: [R] Number of decimal places

2012-10-26 Thread DMMS
For example > a=12344.567 > a [1] 12344.57 > b=234.567 > b [1] 234.567 > a=234235423.56 > a [1] 1.11e+20 > b=111.898 > b [1] 112 > -- View this message in context: http://r.789695.n4.nabble.com/Number-of-decimal-places-tp4647549p4647552.html Sent from the R he

[R] matrix algebra for constructing a special matrix?

2012-10-26 Thread Camarda, Carlo Giovanni
Dear R-users, would it be a better way to construct the matrix below without using any for-loop or model.matrix? preferably with some matrix algebra? Thanks in advance, Carlo Giovanni Camarda ## dimensions m <- 3 n <- 4 mn <- m*n k <- m+n-1 ## with a for-loop X <- matrix(0, mn, k) for(i in 1:

[R] Number of decimal places

2012-10-26 Thread DMMS
When estimating values ​​each determined similarly, and in which get to them by algebraic operations in some cases, are rounded with 0 decimal places and in other cases with 2 or 3 decimal places. What is happening? Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Numbe

Re: [R] How to draw the graph???

2012-10-26 Thread Rlotus
thank u so much for helping -- View this message in context: http://r.789695.n4.nabble.com/How-to-draw-the-graph-tp4647464p4647557.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Creating a correlation matrix from a vector

2012-10-26 Thread F_Smithers
I'm looking to create a correlation matrix, but I have already obtained the correlations, which are stored in a vector. (Basically, I'm running a simulation which requires a correlation matrix, but I am simulating the various correlations.) My aim is to create a function that can take the vector,

[R] Why my code does not draw? how to fix it? plz....

2012-10-26 Thread Rlotus
number<-c(0,1,3,4,5,6,8) rsidp<-function(x){ i=0 {y<-sample(number,x,replace=TRUE)} return(y) } plot(o, xlim=c(0,20), ylim(0,20), type="n", xlab="Sample size", ylab="Sample variance") for (i in seq(1:20)){ retVal=rsidp(i) var(rsidpVector) points (i, v

Re: [R] how to make simulation faster

2012-10-26 Thread stats12
Thank you. I tried Rprof and looks like aggregate function I am using is one of the functions that takes most of the time. What is the difference between self time and total time? $by.total total.time total.pct self.time self.pct f 925.92 99.98

Re: [R] deconstructing curve into rising and falling limbs

2012-10-26 Thread chuck.01
Thanks Jean, Your 1st solution was one I've tried, w/o great success. The 2nd works a lot better (on real, and more messy, data), especially when I set span to a much smaller number than 1/10. Thank you greatly. -Chuck Jean V Adams wrote > Using the data you provided, a combination of slope

[R] Updating R 2.15.0 to 2.15.2

2012-10-26 Thread PaulJr
Dear R users, I hope you all are doing great. Is there a way to automatically upgrade my R 2.15.0 to the new R 2.15.2 release instead of having to reinstall the new release? Any information regarding this would be greatly appreciated. Best regards, Paul -- View this message in context: htt

Re: [R] how to make simulation faster

2012-10-26 Thread stats12
Hi, Thank you for your reply. I updated my post with the code. Also, about posting from Nabble, since I am a new user I didn't know about that problem. If I post to the mailing list ( r-help@r-project.org), would it get rid of that problem? output1<-vector("numeric",length(1:r)) output2<-vector

Re: [R] help with read.table.ffdf parameters

2012-10-26 Thread Bharat Warule
Thanks MCOM, This is really helpful for me. - Bharat Warule Pune -- View this message in context: http://r.789695.n4.nabble.com/help-with-read-table-ffdf-parameters-tp3223805p4647527.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-26 Thread Richard James
Dear Berend and Thomas, thank you for suggesting the lsei function. I found that the tlsce {BCE} function also works very well: library("BCE") tlsce(A=bmat,B=target) The limSolve package has an 'xsample' function for generating uncertainty values via Monte-Carlo simulation, however it only works

Re: [R] system is computationally singular: reciprocal condition number

2012-10-26 Thread langvince
Adding a small random value (0,0001-0,0009) to all values helped to solve the problem. Thank You everyone, who helped. -- View this message in context: http://r.789695.n4.nabble.com/system-is-computationally-singular-reciprocal-condition-number-tp4647472p4647540.html Sent from the R help mail

[R] asking about R Code

2012-10-26 Thread Ellen Praman
Hi, my name is Ellen. I want to ask you about R Code. I got a code for extracting a pixel value, but I can't compile it..  It is said "Error in is.data.frame(x) : object 'lena' not found" Here is the original full code: library(pixmap) lena <- read.pnm("oldlennablur.pgm") write.table(lena@grey,"m

[R] Delete first row

2012-10-26 Thread Bharat Warule
Hi, I have to delete first row from my csv file but I don’t want to read total data in to R memory (size is around 10GB). Actually, I want to use LAF package but which read data without header. Can anybody help me to resolve this problem? - Bharat Warule Pune -- View this message in con

Re: [R] system is computationally singular: reciprocal condition number

2012-10-26 Thread langvince
Hi Thomas, thanks for the comment. I had a similar idea, so got rid of the rounding (these are laboratory measurement based data, thats why I have rounded to only 2 decimal values, but I also tried with 4 and got the same. I will try to get rid of the many 0s with random noise, hopefully it will

[R] [R-pkgs] colorspace: interactive HCL palette chooser

2012-10-26 Thread Achim Zeileis
Dear useRs, we have just released a new version (1.2-0) of the "colorspace" package: http://CRAN.R-project.org/package=colorspace In addition to the infrastructure for transforming colors between different color spaces (RGB, HSV, HCL, and various others) and support for different types of colo

Re: [R] [r] How to pick colums from a ragged array?

2012-10-26 Thread Stuart Leask
Many thanks! Stuart -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: 26 October 2012 13:54 To: Stuart Leask Cc: R help; Petr PIKAL Subject: Re: [r] How to pick colums from a ragged array? Hi Stuart, I guess, this should do it. fun1H<-function(dat){ res1Head<- data.fr

Re: [R] Merge matrices with different column names

2012-10-26 Thread Charles Determan Jr
Dennis, This works well and is exactly what I wanted for these matrices. Thank you very much, however, when I would try to export the resulting list it just is bound by columns. Now this isn't so bad for 2 matrices but I hope to apply this where there are many matrices and scrolling down a file

[R] Grid Width in polar.plot

2012-10-26 Thread MartinD
Hello, I am using the polar.plot function from plotrix. Is there a way to change the width of the grid lines? grid.lwd doesn't work Thanks Martin -- View this message in context: http://r.789695.n4.nabble.com/Grid-Width-in-polar-plot-tp4647547.html Sent from the R help mailing list arch

Re: [R] Regarding the memory allocation problem

2012-10-26 Thread Milan Bouchet-Valat
Le jeudi 25 octobre 2012 à 15:02 +0530, Purna chander a écrit : > Dear All, > > > My main objective was to compute the distance of 10 vectors from a > set having 900 other vectors. I've a file named "seq_vec" containing > 10 records and 256 columns. > While computing, the memory was not s

Re: [R] Is there any way of weighting individual data points in a logistic regression

2012-10-26 Thread Frank Harrell
The lrm function in the rms package will do this. David Schoeman wrote > Dear all. Apologies if I am asking a stupid question, but I have been > unable to find a solution so far. > > I would like to run a logistic regression in which individual data points > are assigned different weights (relat

Re: [R] connect points in charts

2012-10-26 Thread Jean V Adams
Christof, You could use single linkage clustering to separate the dates into different groups if they are more than 14 days apart. Below is a simple example, where x represents day. x <- sort(sample(1:500, 100)) y <- rnorm(100) cluster <- hclust(dist(x), method="single") group <- cutree(clust

Re: [R] deconstructing curve into rising and falling limbs

2012-10-26 Thread Jean V Adams
Using the data you provided, a combination of slope and height comes close: X <- seq(Y) high <- Y > 0.6 upslope <- c(FALSE, diff(Y) > 0) section <- rep(1, length(Y)) section[upslope==TRUE & high==TRUE] <- 2 section[upslope==FALSE & high==TRUE] <- 3 plot(X, Y, col=section) Or you could base the

Re: [R] [r] How to pick colums from a ragged array?

2012-10-26 Thread arun
Hi Stuart, I guess, this should do it. fun1H<-function(dat){ res1Head<- data.frame(flag=tapply(dat[,2],dat[,1],FUN=function(x) head(duplicated(x)|duplicated(x,fromLast=TRUE),1))) res2Head<-dat[dat[,1]%in%names(res1Head[res1Head$flag==TRUE,])&(duplicated(dat[,1:2])|duplicated(dat[,1:2],fromLast=T

Re: [R] connect points in charts

2012-10-26 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Christof Kluß > Sent: Friday, October 26, 2012 1:42 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] connect points in charts > > Hi > > is there a automatic way that long d

[R] R 2.15.2 is released

2012-10-26 Thread Peter Dalgaard
The build system has rolled up R-2.15.2.tar.gz (codename "Trick or Treat") at 9:00 this morning. This is a maintenance release; see the list below for details. You can get it from http://cran.r-project.org/src/base/R-2/R-2.15.2.tar.gz or wait for it to be mirrored at a CRAN site nearer to you.

Re: [R] error bars

2012-10-26 Thread S Ellison
You have likely failed to install the required package or load the right library for the function you are trying to use. R 2.13 doesn't have an errbar function natively either, so there must have been such a package present in your R 2.13 installation. I have functions by that name in Hmisc an

Re: [R] Interpreting and visualising lme results

2012-10-26 Thread Jim Lemon
On 10/26/2012 04:32 PM, Santini Silvana wrote: Dear R users, I have used the following function (in blue) aiming to find the linear regression between MOE and XLA and nesting my data by Species. I have obtained the following results (in green). model4<-lme(MOE~XLA, random = ~ XLA|Species, metho

[R] connect points in charts

2012-10-26 Thread Christof Kluß
Hi is there a automatic way that long distances between points are not connected. I have something like plot(x,y,type="o",...) atx <- seq(as.Date("2009-04-01"),as.Date("2011-04-01"),"month") axis.Date(1, at=atx,labels=format(atx, "%b\n%Y"), padj=0.5 ) but I do not want lines between points wh

Re: [R] plotting multiple variables in 1 bar graph

2012-10-26 Thread S Ellison
Macy > The data in the sample data frame are already the means of > the 5 samples measured for each time T. Does this mean that I need to > 1) calculate the means and standard deviations separately per > variable per time, > 2) compile those results in a new data frame, then > 3) use the ggplot

[R] How to replace the row number for each product by real product name in as.dendrogram in cluster analysis..HELP!

2012-10-26 Thread Tammy Ma
data1<-data.matrix(newdata) # transforming the factor into different values data.use<-data1[,-c(1,2,3)] # leaving the value matrix data.dist = dist(data.use) data.hclust = hclust(data.dist) #complete linkage is used #if I plot the following one, I have too large data set(rows`=9980), can not

  1   2   >