Re: [R] ascii or regex code for alt-enter for Excel

2010-10-20 Thread William Dunlap
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap Sent: Wednesday, October 20, 2010 10:47 AM To: Duncan Murdoch; Mark Kimpel Cc: r-help@r-project.org Subject: Re: [R] ascii or regex code for alt-enter for Excel I think Excel wants a \n

[R] Spatstat: tessellation problems.

2010-10-20 Thread Neba Funwi-Gabga
Hello R Users, I am trying to do a quadrat count defined by covariate properties in spatstat. I have read my elevation raster into R (from ascii) and converted to class im for use in spatstat. Now I have point data of class ppp which window is the same extent as the elevation image. I can

Re: [R] ascii or regex code for alt-enter for Excel

2010-10-20 Thread Gabor Grothendieck
On Wed, Oct 20, 2010 at 1:04 PM, Mark Kimpel mwkim...@gmail.com wrote: I need to write a table that can be opened in Excel or OpenOffice such that there are newlines embedded within cells. After much Googling and futzing, I can't figure out how to do this. The way to do this within Excel is

[R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Sadz A
Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation is to use absolute numbers then use the 'sign' function in R to change the answer back to the correct

[R] removing rows from a matrix using condition within groups

2010-10-20 Thread swam
I am needing some help in removing certain rows in a data.matrix and then do some calculation. So Iam need to removing certain values above a threshold or value from another vector. For eg.. in the below data matrix X there are 6 groups (A, B, C, D, E ,F) X rowsgroups values 1 A

[R] Plot creates a straigth line

2010-10-20 Thread 1Rnwb
Hello all, I am using 'plot' to create standard curves for elisa data. when I use 'plot' with type='b' i get the points connected with lines and one straigth line from the lowest datapoint to the highest data point. how can i avoid/remove it from the figure. i am using R2.9.1, below is the

Re: [R] S: appropriate significance tests

2010-10-20 Thread Greg Snow
It is not completely clear what question you are trying to answer or what you are trying to accomplish. But here are some additional questions that may help: What tests would you use if you could use the original data? What assumptions are you willing to make about the data and/or statistics?

Re: [R] Function execution on package load?

2010-10-20 Thread Greg Snow
?.First.lib -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Johannes Graumann Sent: Wednesday, October 20,

Re: [R] removing rows from a matrix using condition within groups

2010-10-20 Thread Henrique Dallazuanna
Try this: subset(merge(X, Y, by.x = 'groups', by.y = 1, all = TRUE), values V2, -V2) On Wed, Oct 20, 2010 at 1:37 PM, swam sundars...@yahoo.com wrote: I am needing some help in removing certain rows in a data.matrix and then do some calculation. So Iam need to removing certain values

Re: [R] calculate power of test

2010-10-20 Thread Greg Snow
I generally use simulation to calculate power: library(MASS) out1 - replicate(1, {tmp - mvrnorm(100, mu=c(0,0), Sigma=matrix( c(1,.2,.2,1), 2 ) ); cor.test( tmp[,1], tmp[,2] )$p.value } ) mean( out1 = 0.05 ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] Plot creates a straigth line

2010-10-20 Thread jim holtman
'plot' is doing exactly what you are asking it to do. Take a close look at your data: cyto_std_concod [1,] 11.371777 10.00 [2,] 9.786814 8.00 [3,] 8.201852 6.00 [4,] 6.616889 4.00 [5,] 5.031927 2.00 [6,] 3.446964 1.00 [7,] 11.371777 10.50

[R] grep

2010-10-20 Thread 1Rnwb
Hi I have a script which is designed to gather data from individual columns from a file, which is an output from an instrument. the file has multiple sections and each a section has data under each column (vars), I am using the name of the column as a variable to gather the column ID using

Re: [R] Plot creates a straigth line

2010-10-20 Thread Robert Baer
od-c(10, 8, 6,4,2,1, 10.5,7.8,6.4,3.8,2.1,0.95) cyto_conc=2650 # Highest cytokine concentration user defined cyto_std_conc -c(cyto_conc) for (i in 1:5) { cyto_conc = cyto_conc /3 cyto_std_conc -c(cyto_std_conc ,cyto_conc) } cyto_std_conc-log2(rep(cyto_std_conc,2))

Re: [R] S: appropriate significance tests

2010-10-20 Thread soeren . vogel
Thanks Greg for the additional remarks. Basically I have two questions, let me try to specify them as follows: (1) Height and intelligence may correlate at, say, X, but speed and finger length may correlate at Y. Despite any sense of such a statement, is X significantly larger than Y? How can

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 11:47 AM, Sadz A wrote: Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation is to use absolute numbers then use the 'sign'

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Ben Bolker
Sadz A sadz_a1000 at yahoo.co.uk writes: This works fine untill D=0 because then 'sign' does not give 0 a +ve sign it takes it as 0 and multiplies decimal by 0 to give 0. example D-0 decimal-D+(M/60)+(S/3600) decimal.degs-sign(D)*decimal decimal.degs 0 decimal.degs -

Re: [R] lme with log-normal distribution of parameters

2010-10-20 Thread Ben Bolker
Hoai Thu Thai hoai-thu.thai at inserm.fr writes: Dear R-users, Do you know if we can use the function lme in R for log-normal distribution of parameters as used in Nonmem ? theta=theta0*exp(eta) In our model, the parameters follow the log-normal distribution so it's not reasonable

Re: [R] need for speed on grid.rect

2010-10-20 Thread Paul Murrell
Hi I think the problem is that the Windows graphics device is not great at semitransparent colours. For example, your code runs acceptably fast on my Linux system. If your goal is just a colour gradient, then you could avoid using semitransparency by calculating the colours yourself, for

[R] question about masked object

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can’t function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind regards,

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 3:19 PM, David Winsemius wrote: On Oct 20, 2010, at 11:47 AM, Sadz A wrote: Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation

[R] bootstrapping nonlinear mixed effects models

2010-10-20 Thread Juliet Ndukum
In order to bootstrap nonlinear regression, the following code works. library(nlme) data(Soybean) fm1.nls - nls(weight ~ SSlogis(Time, a, b, c), data=Soybean) summary(fm1.nls) bstat - function(A, indices) { mboot - nls(weight ~ SSlogis(Time, a, b, c), data=Soybean[indices, ])

Re: [R] question about masked object

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 3:42 PM, Yunting Sun wrote: Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can’t function correctly. Is it possible to damask? I detach one of the library but the masking

Re: [R] need for speed on grid.rect

2010-10-20 Thread Mikkel Grum
Hi Paul Thanks ever so much for this. This should help tremendously. My only reason for using semi-transparent colours was not knowing how to use colorRampPalette. I'm really just looking at white-to-somecolour gradients. My examples weren't meant to be written one on top of the other. Unlike

Re: [R] Multivariate GARCH

2010-10-20 Thread Owe Jessen
Am 20.10.2010 16:51, schrieb Giuseppe Grillo: HI! I'm student of university and i need an example (an application) of Multivariate GARCH model for replicate it in my thesis. It's better with model CCC e DCC. Best Regards Giuseppe for answer: bepperozz...@hotmail.com [[alternative

[R] question about masked object

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can't function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind

[R] question about masking

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can't function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Brian Diggs
On 10/20/2010 12:25 PM, Ben Bolker wrote: Sadz Asadz_a1000at yahoo.co.uk writes: This works fine untill D=0 because then 'sign' does not give 0 a +ve sign it takes it as 0 and multiplies decimal by 0 to give 0. example D-0 decimal-D+(M/60)+(S/3600) decimal.degs-sign(D)*decimal decimal.degs

Re: [R] need for speed on grid.rect

2010-10-20 Thread Paul Murrell
Hi On 21/10/2010 9:11 a.m., Mikkel Grum wrote: Hi Paul Thanks ever so much for this. This should help tremendously. My only reason for using semi-transparent colours was not knowing how to use colorRampPalette. I'm really just looking at white-to-somecolour gradients. My examples weren't

Re: [R] question about masking

2010-10-20 Thread Paul
On 20/10/10 20:31, Yunting Sun wrote: Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can't function correctly. Is it possible to damask? I detach one of the library but the masking problem is still

[R] rounding up (always)

2010-10-20 Thread Dimitri Liakhovitski
Hello! I am trying to round the number always up - i.e., whatever the positive number is, I would like it to round it to the closest 10 that is higher than this number, the closest 100 that is higher than this number, etc. For example: x-3241.388 signif(x,1) rounds to the closest thousand,

Re: [R] rounding up (always)

2010-10-20 Thread Duncan Murdoch
On 20/10/2010 5:16 PM, Dimitri Liakhovitski wrote: Hello! I am trying to round the number always up - i.e., whatever the positive number is, I would like it to round it to the closest 10 that is higher than this number, the closest 100 that is higher than this number, etc. For example:

Re: [R] rounding up (always)

2010-10-20 Thread Clint Bowman
x-runif(10,1,10) # generate 10 numbers as.integer(log(x,10)+1) -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600

Re: [R] rounding up (always)

2010-10-20 Thread Ted Harding
On 20-Oct-10 21:27:46, Duncan Murdoch wrote: On 20/10/2010 5:16 PM, Dimitri Liakhovitski wrote: Hello! I am trying to round the number always up - i.e., whatever the positive number is, I would like it to round it to the closest 10 that is higher than this number, the closest 100 that is

[R] how to connect to a remote PostgreSQL database from R on mac osx

2010-10-20 Thread Simone Gabbriellini
Hello List, I would like to connect to a postgreSQL database on a remote server and I am wondering what is the best package to do that. I have just installed RpgSQL, RPostgreSQL, Rdbi and RODBC. The handiest to me is RPostgreSQL but I don't see how to connect to a remote server with it. For

[R] Biplot: plot group name instead of row number

2010-10-20 Thread Alejo C.S.
Dear list, I'm trying to make a biplot, but instead of plotting the row number for each observation, plot a group factor. Example: prcomp(iris[,1:4]) - PCA biplot(PCA) #this makes a nice biplot but with row names Instead of row numbers I want to plot iris[,5], which is a factor. I can do

[R] efficient test for missing values (NAs)

2010-10-20 Thread Ali Tofigh
What is the best way to detect whether or not a (potentially large) matrix contains missing values (NAs) or not? I use if (sum(is.na(x)) 0) {...} are there more efficient ways? /Ali __ R-help@r-project.org mailing list

Re: [R] efficient test for missing values (NAs)

2010-10-20 Thread Phil Spector
Ali - If all you care about is if there are any missing values (not how many or where they are), I think it would be a bit faster to use if(any(is.na(x))){...} - Phil Spector Statistical Computing Facility

Re: [R] efficient test for missing values (NAs)

2010-10-20 Thread Jim Holtman
?complete.cases Sent from my iPhone On Oct 20, 2010, at 18:53, Ali Tofigh alix.tof...@gmail.com wrote: What is the best way to detect whether or not a (potentially large) matrix contains missing values (NAs) or not? I use if (sum(is.na(x)) 0) {...} are there more efficient ways? /Ali

[R] loading workspace- getting annoying

2010-10-20 Thread sachinthaka . abeywardana
I stupidly decided to save my last workspace (a large dataset) and every time I open R it loads it back in. Can I stop this? Also how do you clear variables. Thanks, Sachin --- Please consider the environment before printing this email --- Allianz - General Insurance Company of the Year 2009+

[R] histograms resulting from call to soil.texture

2010-10-20 Thread emorway
Hello, Using the dataset below I produce a soil.texture plot (R code for this included at the end). One will notice I have plotted the points based on whether or not they are in a region called 'upstream' or 'downstream'. I'm curious if there is a way to somehow extract counts of the number of

Re: [R] ascii or regex code for alt-enter for Excel

2010-10-20 Thread Mark Kimpel
Thanks to all for your helpful replies. In my initial email I did mistakenly write \n when I had correctly been using \n in my code. The key for me seem to be using the approach Bill suggested, i.e., writing to a binary file. If I simply do write.csv(d, d.text.csv, row.names = FALSE, col.names =

Re: [R] loading workspace- getting annoying

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 7:05 PM, sachinthaka.abeyward...@allianz.com.au wrote: I stupidly decided to save my last workspace (a large dataset) and every time I open R it loads it back in. Can I stop this? Also how do you clear variables. Thanks, Sachin --- Please consider the environment

Re: [R] is there a way to update both packages if they occur in 2 libraries?

2010-10-20 Thread Chris Howden
Thanks for the explanation Brian, I used the summary(packageStatus()) to have a look at what was available and in each library. And then deleted all libraries that came with R2.12.0 from my personal library. And everything now works. Chris Howden Founding Partner Tricky Solutions Tricky

[R] Lasso Logistic Regression - Query

2010-10-20 Thread Lars Bishop
Hi, Is it possible to include class factor inputs in a Logistic Regression model with the glmnet package? It only seems to allow for numeric inputs. Looks like the Penalized package does this? Any other package you would recommend for this purpose? Thanks in advance for any help. Lars.

Re: [R] loading workspace- getting annoying

2010-10-20 Thread Ted Harding
On 20-Oct-10 23:37:44, David Winsemius wrote: On Oct 20, 2010, at 7:05 PM, sachinthaka.abeyward...@allianz.com.au wrote: I stupidly decided to save my last workspace (a large dataset) and every time I open R it loads it back in. Can I stop this? Also how do you clear variables. Thanks,

[R] autoregressive functions

2010-10-20 Thread A Sdf
Hi all, I am sorry for bothering the list, but I hope one of its members can help me. Currently I am doing a spectral analysis with the help of R. The spectral density I have calculated as follows: (The vector q contain some testing numbers.) q -

[R] help identifying clusters

2010-10-20 Thread jonas garcia
Dear list: I have a dataset of geographical data that looks like this example data: dat- data.frame( lon = c(rnorm(1000, mean=-10), rnorm(1000, mean=10), rnorm(1000, mean=5)), lat = c(rnorm(1000, mean=40), rnorm(1000, mean=30), rnorm(1000, mean=0))) plot(dat$lon, dat$lat) My positions are

Re: [R] efficient test for missing values (NAs)

2010-10-20 Thread Ali Tofigh
A small test indicates that the following may be the fastest method (although all are pretty fast) has.na - !all(complete.cases(x)) Thanks Jim and Phil for your suggestions. /Ali On Wed, Oct 20, 2010 at 19:03, Jim Holtman jholt...@gmail.com wrote: ?complete.cases Sent from my iPhone On Oct

Re: [R] rounding up (always)

2010-10-20 Thread Dimitri Liakhovitski
Thank you for your help, everyone. Actually, I am building a lot of graphs (in a loop) but the values on the y axes from graph to graph could range from [-5; 5] to [-10,000; 10,000]. So, I am trying to create ylim ranging from ymin to ymax such that they look appropriate for the range. For

Re: [R] how to connect to a remote PostgreSQL database from R on mac osx

2010-10-20 Thread Prasenjit Kapat
On Wed, Oct 20, 2010 at 6:30 PM, Simone Gabbriellini simone.gabbriell...@gmail.com wrote: Hello List, I would like to connect to a postgreSQL database on a remote server and I am wondering what is the best package to do that. I have just installed RpgSQL, RPostgreSQL, Rdbi and RODBC. I

Re: [R] rounding up (always)

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 8:38 PM, Dimitri Liakhovitski wrote: Thank you for your help, everyone. Actually, I am building a lot of graphs (in a loop) but the values on the y axes from graph to graph could range from [-5; 5] to [-10,000; 10,000]. So, I am trying to create ylim ranging from ymin to

Re: [R] rounding up (always)

2010-10-20 Thread Dimitri Liakhovitski
Thanks a lot, David - I'll try this solution. Dimitri On Wed, Oct 20, 2010 at 9:54 PM, David Winsemius dwinsem...@comcast.net wrote: On Oct 20, 2010, at 8:38 PM, Dimitri Liakhovitski wrote: Thank you for your help, everyone. Actually, I am building a lot of graphs (in a loop) but the values

Re: [R] help identifying clusters

2010-10-20 Thread Nikhil Kaza
Look at clustering task view http://cran.r-project.org/web/views/Cluster.html A simple way to do it is library(cluster) dat$cluster - pam(dat, 3, stand=T)$clustering plot(dat$lon, dat$lat, col=dat$cluster) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina

Re: [R] rounding up (always)

2010-10-20 Thread jim holtman
why don't you just use 'pretty' pretty(c(-1225, 2224)) [1] -1500 -1000 -500 0 500 1000 1500 2000 2500 pretty(c(-4.28, 6.45)) [1] -6 -4 -2 0 2 4 6 8 On Wed, Oct 20, 2010 at 8:38 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Thank you for your help, everyone.

[R] Accuracy/Goodness of fit of nnet

2010-10-20 Thread Raji
Hi R-Helpers , am working on nnet package.Multinom() has an option for finding the goodness of fit by giving the AIC value. Does nnet also gives some value to determine the accuracy. If not, can you guide me with some procedure to figure out the accuracy/goodness of fit of nnet model? Thanks in

[R] Fwd: HOW to use the survivalROC to get optimal cut-off values?

2010-10-20 Thread Qian
-- Forwarded message -- From: Qian qianguangy...@gmail.com Date: 2010/10/21 Subject: HOW to use the survivalROC to get optimal cut-off values? Dear sir, I am a student who want to use the time-dependent survivalROC package.according to the,reference material,it only gives a set of

[R] Help: Using vectorization method for vectors comparision

2010-10-20 Thread bruclee
I am trying to compare two sorted vectors, all elements in both vectors are not duplicated. Ex. a = c[5, 10, 13, 19, 23] b = c[1, 4, 7, 9, 15] For each element in a, i need find the max element in b which is smaller than it, so the short answer will look like [4, 9, 9, 15, 15]. I dont want to use

Re: [R] Help: Using vectorization method for vectors comparision

2010-10-20 Thread Wu Gong
Hi Bruclee, ?rle may help. a - c(5, 10, 13, 19, 23) b - c(1, 4, 7, 9, 15) ab - data.frame(value = c(a,b), type=c(rep(0,length(a)),rep(1,length(b ab - ab[order(ab$value),] ab$v2 - cumsum(ab$type) ab$matched - rep(ab$value[ab$type==1],rle(ab$v2)$lengths) (result -

[R] using softmax in nnet

2010-10-20 Thread Raji
I run my data in nnet factor response (with 0 1 values) and explicitly put softmax=TRUE. I get the following error. nn -

Re: [R] Help: Using vectorization method for vectors comparision

2010-10-20 Thread bruclee
Very Nice! Thanks a lot! Btw, I think match function should also do the work for the last two steps. :) -- View this message in context: http://r.789695.n4.nabble.com/Help-Using-vectorization-method-for-vectors-comparision-tp3004952p3005032.html Sent from the R help mailing list archive at

Re: [R] question on optim() fn.

2010-10-20 Thread sharkoil
Hi Ravi, Thanks a lot for your informations. I think you are right. Without the constraints of the parameters, it's easy to get the NaN Produced warning message. The pdfs I worked on are Burr, Lognormal and Inverse Gaussian distributions. Lognormal distribution is ok, but I always have warning

Re: [R] ascii or regex code for alt-enter for Excel

2010-10-20 Thread Gabor Grothendieck
On Wed, Oct 20, 2010 at 7:11 PM, Mark Kimpel mwkim...@gmail.com wrote: I do wonder what ASCII character is represented in Windows with alt-Enter. Using Excel 2007 on Windows, Alt-Enter is char(10). In an empty sheet enter these three characters into A1: a alt-enter b and then in 3 other

<    1   2