Re: [R] NA and Character(0) in List Element

2013-01-29 Thread Jeff Newmiller
lapply always yields one output for every input. Try using a for loop and only copying the element once you know you want it. You will need an output index counter that is separate from the for loop index, incremented only when you copy an element.

Re: [R] NA and Character(0) in List Element

2013-01-29 Thread Gerrit Eichner
Hi, Benjamin, have you tried for your list with NA-components to use is.na() as follows (where x is assumed to be your list)? x[ !is.na(x)] Hth -- Gerrit On Tue, 29 Jan 2013, Benjamin Ward (ENV) wrote: Hi, This is probably a small query but one I'm struggling with: I have a list in

Re: [R] Equivalent of box() in grid graphics

2013-01-29 Thread Patrick Connolly
On Mon, 28-Jan-2013 at 12:21PM +1300, Paul Murrell wrote: | Hi | | On 17/01/13 13:19, p_conno...@slingshot.co.nz wrote: | Paul Murell's article What's in a Name in The R Journal Vol 4/2 | gives an interesting example of editing a stacked barplot of the barley | data. Using the method described

Re: [R] Can I define a object array in R?

2013-01-29 Thread Sarah Goslee
In R, lists are used for that. See ?list or any intro to R for details. Sarah On Tuesday, January 29, 2013, cuiyan wrote: Here is my problem, 100 decision trees were built(similar to random forest) and I want to replace some of them by new trees. How can I define a tree array including 100

[R] svy equivalent of pairwise.t.test

2013-01-29 Thread Virgile Capo-Chichi
Dear all, I am looking for an equivalent of the pairwise.t.test() function using a complex survey design. Any suggestions on this or how to account for weights using the pairwise.t.test itself? Thanks, V [[alternative HTML version deleted]] __

[R] remove margin between plot and axis

2013-01-29 Thread e-letter
Readers, Am trying to plot a graph with type 'h' and want to remove the white space between the plot lines and the x axis. The help section 'par' suggests that the option 'mai' controls this feature, but the syntax plot(...mai=c(0,1,1)) is ineffective Any advice please? -- r2151

Re: [R] R plot like candlestick

2013-01-29 Thread Eik Vettorazzi
Hi Denis, there is no if, only how in R ;) how about this: rmail2-read.table(textConnection(item, min, int_1, int_2, max a, 2.5, 3, 4, 5.5 b, 2, 3.5, 4, 4.5 c, 3.5, 4, 4.5, 5),header=T,sep=,) with(rmail2,symbols(item, (int_1+ int_2)/2, boxplots=cbind(.25, int_2-int_1,

Re: [R] R plot like candlestick

2013-01-29 Thread Denis Francisci
Wonderful! Thank you Eik! I thought there was a specific package or plot to get my purpose, but your idea solves perfectly my problem. Maybe I could try to write a simple R function using your suggest, just to make fast my work. If I can get a result, I'll announce it in this list. Thank you very

Re: [R] remove margin between plot and axis

2013-01-29 Thread Pascal Oettli
Hi, Please provide a reproducible example. Regards, Pascal Le 29/01/2013 19:40, e-letter a écrit : Readers, Am trying to plot a graph with type 'h' and want to remove the white space between the plot lines and the x axis. The help section 'par' suggests that the option 'mai' controls this

[R] Bioconductor flowcytometry

2013-01-29 Thread Pieter Coussement
Hi, This is a quiet a specific question, but i really need help. I'm using the flowCore package coming from BioConductor. No i would like to do a transformation, a log tranformation. Although i think i put everything like it should, i get this error: Error in log(x, logbase) : Non-numeric

[R] problem wih plotrix:cluster.overplot

2013-01-29 Thread Jean Véronis
Hello, I am trying to use cluster.overplot from package plotrix and I get an error message when I add the away parameter: require(plotrix) distance - read.table(distance.txt) cmd - cmdscale(distance) cp - cluster.overplot(cmd, away=2) Error in if (sum(overplots) 1) { : missing value where

[R] Number of pieces in segmented package

2013-01-29 Thread Petar Milin
Hello ALL, I just started to use segmented package for some piecewise linear fitting problem. However, author noted: The package is not concerned with estimation of the number of the breakpoints. Although the BIC has been suggested, in general nonstatistical issues related to the understanding

[R] ccf (cross correlation function) problems

2013-01-29 Thread Larissa Modica
Hello everybody, I am sorry if my questions are too simple or not easily understandable. I’m not a native English speaker and this is my first analysis using this function. I have a problem with a cross correlation function and I would like to understand how I have to perform it in R. I have

Re: [R] Can I define a object array in R?

2013-01-29 Thread Suzen, Mehmet
Hello Sarah, You may want to use a package instead of trying to implement those data structures. For example: http://www.bioconductor.org/packages/release/bioc/html/graph.html Best, -m On 29 January 2013 11:22, Sarah Goslee sarah.gos...@gmail.com wrote: In R, lists are used for that. See ?list

Re: [R] converting XML document to table or dataframe

2013-01-29 Thread David Winsemius
On Jan 28, 2013, at 9:00 PM, Anika Masters wrote: I am a relatively new user to R, and I am trying to learn more about converting data in an XML document into 2-dimensional format such as a table or array. I might eventually wish to export this data into a relational database such as SQL,

[R] checking the significance of the effects of altitude on endemic species richness

2013-01-29 Thread spyros
Hi all, I run a glm analysis of the effects of altitude to the proportion of endemic plant species of Crete and the results are: Call: glm(formula = pCRENDSR ~ Alt, family = binomial, data = dat) Deviance Residuals: Min 1Q Median 3QMax -0.078121 -0.022688

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mary
Hi, I've understand how to do a permutation matrix but how I can utilize it? I would like to have a sample of 5 unit with rotation parameters! The same with 10 unit or 20 unit... Thanks -- View this message in context:

Re: [R] Pivot

2013-01-29 Thread Rui Barradas
Hello, Try the following. dat - read.table(text = X Z x1102 x2102 x2102 x277 x323 , header = TRUE) xt - xtabs( ~ X + Z, data = dat) # This creates an object of classes xtabs, table. # If you want a matrix you can do it with cn -

Re: [R] Can I define a object array in R?

2013-01-29 Thread Rui Barradas
Hello, You can store any kind of objects in a list. More or less like the following. tlist - vector(list, 100) n - 10 tlist[[n]] - C5.0(...) Hope this helps, Rui Barradas Em 29-01-2013 07:01, cuiyan escreveu: Here is my problem, 100 decision trees were built(similar to random forest)

Re: [R] remove margin between plot and axis

2013-01-29 Thread e-letter
On 29/01/2013, Pascal Oettli kri...@ymail.com wrote: Hi, Please provide a reproducible example. test-seq(10:50) plot(test,type='h',mai=c(0,1,1)) Tried plot(test,type='h',yaxs='i') but this has the non-wanted effect of removing white space from between the highest peak and the upper (top)

Re: [R] remove margin between plot and axis

2013-01-29 Thread Ivan Calandra
Not sure wat you're trying to do... Can you explain more what you expect your plot to look like? What about plot(..., frame=FALSE)? Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06

Re: [R] remove margin between plot and axis

2013-01-29 Thread Duncan Murdoch
On 13-01-29 7:51 AM, e-letter wrote: On 29/01/2013, Pascal Oettli kri...@ymail.com wrote: Hi, Please provide a reproducible example. test-seq(10:50) That's probably not doing what you think it does because you used a colon instead of a comma. plot(test,type='h',mai=c(0,1,1)) The

[R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Michael Friendly
I'm trying to write a formula method for canonical correlation analysis, that could be called similarly to lm() for a multivariate response: cancor(cbind(y1,y2,y3) ~ x1+x2+x3+x4, data=, ...) or perhaps more naturally, cancor(cbind(y1,y2,y3) ~ cbind(x1,x2,x3,x4), data=, ...) I've adapted the

Re: [R] Query on package to use for investment quotes

2013-01-29 Thread Keith Weintraub
Bruce, Have you looked at the Edgar database here: http://www.sec.gov/edgar.shtml You should be able to get daily mutual fund quotes. KW -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] converting XML document to table or dataframe

2013-01-29 Thread Anika Masters
If I want to add names utilizing the information within the file, is there a good way to do so? e.g.transactionAmounts_transactionShares_value might be one name I'd like the data to have. mylist$nonDerivativeTable[[1]][5] On Tue, Jan 29, 2013 at 3:42 AM, David Winsemius

[R] starting values in glm(..., family = binomial(link = log))

2013-01-29 Thread Fischer, Felix
Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when I set start = coef(logistic_model) within the function

Re: [R] R on AIX 6.1

2013-01-29 Thread Bibhabari Chakraborty
From: Bibhabari Chakraborty Sent: Tuesday, January 29, 2013 6:32 PM To: 'r-help@r-project.org.' Cc: Veerendra Prasad Pillalamarri Subject: R on AIX 6.1 Hi Team, I am trying to install R on AIX 6.1 . I tried with ./configure -with-readline=no Getting the following error checking how to get

[R] A question about R

2013-01-29 Thread Chia-Chieh Lin
Hi, I was wondering whether R works on Windows 8? Many thanks. Chia-Chieh Lin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Pivot

2013-01-29 Thread arun
HI, You could try: dat1-read.table(text= X Z x1    102 x2    102 x2    102 x2    77 x3    23 ,sep=,header=T,stringsAsFactors=F)  res1-tapply(dat1[,1],list(dat1[,1],dat1[,2]),length) res1[apply(res1,2,function(x) is.na(x))]-0  

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Michael Friendly
To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) { if (colnames(x)[1] == (Intercept)) { x - x[,-1] attr(x, assign) - attr(x, assign)[-1] } x

Re: [R] converting XML document to table or dataframe

2013-01-29 Thread David Winsemius
On Jan 29, 2013, at 9:03 AM, Anika Masters wrote: If I want to add names utilizing the information within the file, is there a good way to do so? e.g.transactionAmounts_transactionShares_value might be one name I'd like the data to have. mylist$nonDerivativeTable[[1]][5] mylist -

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Kevin E. Thorpe
For lm() the intercept can be removed by adding a - 1 to the RHS of the formula. Does that not work in your case? Kevin On 01/29/2013 09:14 AM, Michael Friendly wrote: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept,

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Ken Knoblauch
Michael Friendly friendly at yorku.ca writes: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) { if (colnames(x)[1] == (Intercept)) { x - x[,-1] attr(x,

Re: [R] Why are the number of coefficients varying? [mgcv][gam]

2013-01-29 Thread Simon Wood
Andrew, I think that the weird edfs may result from an unhandled case in the side constraint calculation. In particular the term s(BCAR.imp,bs=cr,k=length(BCAR.knots),by=as.factor(pot.trial)) is confounded with te(soc.imp,BCAR.imp,k=c(4,4)) but there was an issue with picking this up

Re: [R] remove margin between plot and axis

2013-01-29 Thread John Kane
Something like plot(test,type='h',yaxs='i', ylim = c(0, 60)) ? You would need to figure out what the right values for ylim are. John Kane Kingston ON Canada -Original Message- From: inp...@gmail.com Sent: Tue, 29 Jan 2013 14:51:32 +0200 To: kri...@ymail.com Subject: Re: [R]

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread John Fox
Hi Michael, How about, x - x[, colnames(x) != (Intercept)] I hope this helps, John -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Friendly Sent: Tuesday, January 29, 2013 8:45 AM To: R-help Subject: [R] how to

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Duncan Murdoch
On 29/01/2013 9:14 AM, Michael Friendly wrote: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) { if (colnames(x)[1] == (Intercept)) { x - x[,-1] attr(x,

Re: [R] I succeed to get result dataset.

2013-01-29 Thread arun
HI, temp-read.table(text=  ID    CTIME   ACTIVE_KWH REACTIVE_KWH 1  HM001 201212121301 1201.9 1115.5 2  HM001 201212121302 1202.2 1115.8 3  HM001 201212121303 1202.8 1115.8 4  HM001 201212121304 NA 1116.1 5  HM001 201212121305 1203.9 1116.7 6  HM001 201212121306 NA 1116.7 7  HM001

Re: [R] centering matrix

2013-01-29 Thread Rui Barradas
Hello, The question is a bit confusing. If you nedd to compute B = X'X, all you have to do is B - t(X) %*% X If you want to compute the other formula, the following avoids loops. n - nrow(d) B - -d^2/2 - rowSums(d^2)/n - colSums(d^2)/n + sum(d^2)/n^2 Hope this helps, Rui Barradas Em

Re: [R] A question about R

2013-01-29 Thread Rui Barradas
Hello, Though I don't have Windows 8 installed yet, this question was already asked to R-Help and the answer was yes, it does. Hope this helps, Rui Barradas Em 29-01-2013 13:57, Chia-Chieh Lin escreveu: Hi, I was wondering whether R works on Windows 8? Many thanks. Chia-Chieh Lin

Re: [R] R plot like candlestick

2013-01-29 Thread John Kane
I have not had a change to look at the code but this appears to use ggplot2 to do something like what you want. It may be of some use http://www.perdomocore.com/2012/using-ggplot-to-make-candlestick-charts-alpha/ . The google search terms, ggplot2 candlestick, showed this and a couple of

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Michael Friendly
On 1/29/2013 9:25 AM, Duncan Murdoch wrote: On 29/01/2013 9:14 AM, Michael Friendly wrote: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) { if (colnames(x)[1] == (Intercept)) { x -

Re: [R] starting values in glm(..., family = binomial(link = log))

2013-01-29 Thread Ben Bolker
Fischer, Felix Felix.Fischer at charite.de writes: Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when

Re: [R] Change rows and columns

2013-01-29 Thread Mat
thx, that worked perfekt, but is there any way to convert my Number 1 row # 123 up as column description? -- View this message in context: http://r.789695.n4.nabble.com/Change-rows-and-columns-tp4656965p4656969.html Sent from the R help mailing list archive at

[R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-29 Thread Douglas M. Hultstrand
Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file using the package ncdf.I am able to get the lat, lon and parameter I need and can plot using fill.contour.Ultimately, I am trying to create a .asc file to reafd into GIS.I am

[R] Change rows and columns

2013-01-29 Thread Mat
Hello together, how can i change rows and columns in R? I have a data.frame like this one: 1st round | 2nd round 1 1:2 2:2 2 2:3 1:0 3 0:0 1:1 and now i want to change for further processing my rows and columns.

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Duncan Murdoch
On 29/01/2013 10:21 AM, Michael Friendly wrote: On 1/29/2013 9:25 AM, Duncan Murdoch wrote: On 29/01/2013 9:14 AM, Michael Friendly wrote: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) {

[R] identify non-recursive models

2013-01-29 Thread Dustin Fife
Hi, I'm working on a project that will generate RAM matrices at random. What I want to do is to be able to automatically identify if the model is non-recursive. For example, the following RAM matrix has a non-recursive loop (going from A to B to C to A): n.recursive - data.frame(matrix(c(A, B,

Re: [R] identify non-recursive models

2013-01-29 Thread Duncan Murdoch
On 29/01/2013 11:12 AM, Dustin Fife wrote: Hi, I'm working on a project that will generate RAM matrices at random. What I want to do is to be able to automatically identify if the model is non-recursive. For example, the following RAM matrix has a non-recursive loop (going from A to B to C to

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Michael Friendly
On 1/29/2013 10:11 AM, John Fox wrote: Hi Michael, OK -- I see -- you need to do more than fix up the model matrix. How about this? formula - update(formula, . ~ . - 1) cl - match.call() cl$formula - formula mf - match.call(expand.dots = FALSE) mf$formula - formula

Re: [R] identify non-recursive models

2013-01-29 Thread Dustin Fife
Thanks for the response. That doesn't seem to do it. It's able to identify if one edge connects back into itself, but isn't able to identify whether an edge eventually connects back into itself (after passing through multiple variables). For example, the following should fail, because the path

[R] gigFit problems

2013-01-29 Thread Raymond Rogers
Hi, I am having some problems with gigFit and would like confirmation on other platforms; mine is Mint; basically Debian. Although I got a good fit for the density function with the GIG equation in another curve fitting program, I would really like to use R's tools for confidence intervals and

Re: [R] identify non-recursive models

2013-01-29 Thread William Dunlap
is.dag()? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dustin Fife Sent: Tuesday, January 29, 2013 8:52 AM To: Duncan Murdoch Cc: r-help Subject: Re: [R] identify

Re: [R] identify non-recursive models

2013-01-29 Thread Dustin Fife
That looks like exactly what I need. I tested it on my PC and it ran, but my mac couldn't find the function is.dag. Any ideas? On Tue, Jan 29, 2013 at 11:03 AM, William Dunlap wdun...@tibco.com wrote: is.dag()? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original

[R] Setting -sys.setenv()- permanently in Linux using RStudio

2013-01-29 Thread Clive Nicholas
sessionInfo()R version 2.15.2 (2012-10-26) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 [4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C [10]

Re: [R] identify non-recursive models

2013-01-29 Thread William Dunlap
Is package:igraph loaded in your R session on the mac? Is it up to date? (I would doubt that is.dag would be a recently written function.) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com From: Dustin Fife [mailto:fife.dus...@gmail.com] Sent: Tuesday, January 29, 2013 9:16 AM To: William

Re: [R] identify non-recursive models

2013-01-29 Thread Dustin Fife
I did have it loaded with the newest version of igraph, but apparently it requires the newest version of R. I now have R-2.15.2 loaded and it works! Thanks for all the help! Dustin On Tue, Jan 29, 2013 at 11:21 AM, William Dunlap wdun...@tibco.com wrote: Is package:igraph loaded in your R

[R] weibull pp

2013-01-29 Thread eliza botto
Dear R-user, I have two separate independent events. More precisely, i have data of discharged patients from two separate hospitals on each day of a certain year. For each hospital i calculated the non-exceedance probability by using weibull plot position which should be marginal probability

Re: [R] NA and Character(0) in List Element

2013-01-29 Thread arun
Hi, May be this helps: x- list(1:5,NA,20:25,5) names(x)-1:4  fun1-function(lst){  lst[lapply(lapply(lst,Filter,f=Negate(is.na)),length)!=0]} fun1(x) #$`1` #[1] 1 2 3 4 5 # #$`3` #[1] 20 21 22 23 24 25 # #$`4` #[1] 5 #or x[lapply(lapply(x,na.omit),length)!=0] A.K. - Original Message

[R] Sweave files generating miktex errors

2013-01-29 Thread Troy S
Dear useRs-- I have been using Sweave with miktex for years, but on a new install on Windows XP, miktex seems to be hung up on single quotes. See example below. Digging through stackexchange, I found using \usepackage[noae]{Sweave} in the tex file solved the problem. My questions are: --Why

Re: [R] Sweave files generating miktex errors

2013-01-29 Thread Duncan Murdoch
On 29/01/2013 1:37 PM, Troy S wrote: Dear useRs-- I have been using Sweave with miktex for years, but on a new install on Windows XP, miktex seems to be hung up on single quotes. See example below. Digging through stackexchange, I found using \usepackage[noae]{Sweave} in the tex file solved

[R] Package parallel left orphan processes, how to clean-up?

2013-01-29 Thread Bin Ye
Hi, I've using package DEXSeq that implements functions with nCores for speed-up. The functions work fine, but I found out that the children processes were not terminated, they still hold memory, and new command will start up new children processes. So if I don't manually kill those orphan

[R] R-help archives --- are they up-to-date?

2013-01-29 Thread Rolf Turner
I just saw a message from David Winsemius, responding to an inquiry from Carol White: On Jan 28, 2013, at 9:06 PM, carol white wrote: Should I understand that this message was received? It's always possible to check the Archives for this question. This prompted me to ask about a problem

[R] export figure by pdf command

2013-01-29 Thread hp wan
Dear R mailing listers, After plotting, I wanna save it as file in pdf format using pdf(name.pdf) command. It failed, but I can do it by GUI operation (file-save as-pdf). e.g. x11() hist(x, breaks = 50, probability = FALSE) pdf(hist.pdf) [[alternative HTML version deleted]]

Re: [R] export figure by pdf command

2013-01-29 Thread Rolf Turner
I was going to attempt to answer your question, but I refuse to respond to anyone who writes wanna when they mean want to. The use of wanna is unacceptable in written English unless you are *trying* to be funny, and I don't think you are. cheers, Rolf Turner On 01/30/2013 09:48

Re: [R] export figure by pdf command

2013-01-29 Thread hp wan
I am sorry for that. I am not quite good at manage English. I will correct it next time. Wait for your answer. Thanks in advance. Best regards, 2013/1/30 Rolf Turner rolf.tur...@xtra.co.nz I was going to attempt to answer your question, but I refuse to respond to anyone who writes wanna

Re: [R] export figure by pdf command

2013-01-29 Thread hp wan
Can you implement it using my provided example? I read the user guide about dev.copy2pdf but I still failed. Thanks 2013/1/30 ilai ke...@math.montana.edu ?dev.copy2pdf On Tue, Jan 29, 2013 at 1:48 PM, hp wan huaping@gmail.com wrote: Dear R mailing listers, After plotting, I wanna

Re: [R] export figure by pdf command

2013-01-29 Thread andrija djurovic
set.seed(2211) x - rnorm(100) #get your working directory getwd() #save it as pdf pdf(hist.pdf) hist(x) dev.off() On Tue, Jan 29, 2013 at 10:22 PM, hp wan huaping@gmail.com wrote: Can you implement it using my provided example? I read the user guide about dev.copy2pdf but I still

Re: [R] R-help archives --- are they up-to-date?

2013-01-29 Thread Sarah Goslee
The searchable archives may lag, and apparently do. The main list archive is here: https://stat.ethz.ch/pipermail/r-help/ and is complete. That's the one to check if you wish to know whether something made it to the list. If you go to the r-help listinfo link in the mailing list footer, you are

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mlell08
On 29.01.2013 13:10, mary wrote: Hi, I've understand how to do a permutation matrix but how I can utilize it? I would like to have a sample of 5 unit with rotation parameters! The same with 10 unit or 20 unit... You could rewrite your tab function that is accepts a list with named entries

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mlell08
# This assumes you have a parameter list which looks like this: # l: list(n = c(5, 10, 20), # a = c(0.1, 0.2, 0.3), # E = c(5,10), # L = c(0.01, 0.025, 1)) etc... # # # indVec:c(n= 1, a=1, E=2, L=1) # The function selects the approproate sub-list by the name

Re: [R] Sweave files generating miktex errors

2013-01-29 Thread Troy S
Duncan, Copying all 3 sty files to my working directory solved the problem. I'm still curious why this was necessary in my new install. Duncan, many thanks! Troy On Tue, Jan 29, 2013 at 10:58 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 29/01/2013 1:37 PM, Troy S wrote: Dear

Re: [R] ccf (cross correlation function) problems

2013-01-29 Thread Rolf Turner
Your question and your English are just fine! If I were you, I would not mess around with the ccf() function but would attack the question directly using the cor.test() function, with sub-vectors of your x vector. Personally I find the notion of lag in acf() and ccf() highly confusing and I

Re: [R] R-help archives --- are they up-to-date?

2013-01-29 Thread Rolf Turner
On 01/30/2013 10:28 AM, Sarah Goslee wrote: The searchable archives may lag, and apparently do. The main list archive is here: https://stat.ethz.ch/pipermail/r-help/ and is complete. That's the one to check if you wish to know whether something made it to the list. If you go to the r-help

Re: [R] Sweave files generating miktex errors

2013-01-29 Thread Duncan Murdoch
On 13-01-29 4:55 PM, Troy S wrote: Duncan, Copying all 3 sty files to my working directory solved the problem. I'm still curious why this was necessary in my new install. Duncan, many thanks! You do realize that you have now done a Very Bad Thing, I hope. Duncan Murdoch Troy On Tue, Jan

[R] points rejected as lying outside the specified window

2013-01-29 Thread Abby Rudolph
Hello, I am using the following code to create ppp files from csv data and map shape files, but I am getting some errors which I have been unable to fix by searching them online: library(spatstat) library(maps) library(maptools) NYC2-readShapePoly(nybb.shp) # this is a map of the NYC

[R] cannot print neighbor list object

2013-01-29 Thread Gary Dong
Hi, R users, I am estimating a spatial lag model using the spdep package. Before running the model, I was creating K nearest neighbours for spatial weights. My observations are points. Let me use the coords in Columbus dataset as an example, and I consider 5 nearest neighbors. library(spdep)

Re: [R] centering matrix

2013-01-29 Thread Rui Barradas
Hello, Please keep the discussion on the R-Help list, there's no reason not to. As for your question, can you be more specific? Also, take a look at function ?scale. Rui Barradas Em 29-01-2013 23:31, Eleonora Schiano escreveu: i have to do multidimensional scaling. Can you help me?

[R] width of terminal resize to current dimensions on linux Gnome terminal

2013-01-29 Thread ivo welch
I just looked at the sample initialization script in the R docs. it suggests the first two lines of cols - Sys.getenv(COLUMNS) if(nzchar(cols)) options(width = as.integer(cols)) print(cols) I run R 2.15.2 on a linux Gnome terminal 3.6.0 now. alas, this snippet always prints (I replaced

Re: [R] I think you misunderstood my explantation.

2013-01-29 Thread arun
Hi, Sorry, I didn't check your codes previously. I hope this works for you (especially the 0). Using the first dataset temp: temp$ACTIVE_KWH[!is.na(temp$ACTIVE_KWH)][c(FALSE,diff(temp$ACTIVE_KWH[!is.na(temp$ACTIVE_KWH)]) 0)]-NA

[R] Warning: Spatial weights matrix not row standardized

2013-01-29 Thread Gary Dong
Hi, R users, I am doing Lagrange Multiplier Test Statistics for Spatial Autocorrelation with spdep and got this warning message: Spatial weights matrix not row standardized. It is a warning, not an error. I am wondering if this is a problem. Thanks! Gary [[alternative HTML version

Re: [R] points rejected as lying outside the specified window

2013-01-29 Thread Rolf Turner
This is a question about the spatstat package and as such would have been more appropriately directed to the R-sig-Geo list. (1) Your code seems unnecessarily complicated; I haven't followed it through in detail however. (2) You did not get an error, you got a warning. This warning means what

Re: [R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-29 Thread Pascal Oettli
Hello, I don't understand why you need to use R first, as GRASS and ArcGIS are able to read NetCDF files. Regards, Pascal Le 30/01/2013 00:37, Douglas M. Hultstrand a écrit : Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file

[R] Creating dummy variables in r

2013-01-29 Thread Joseph Norman Thomson
Hello, Semi-new r user here and still learning the ropes. I am creating dummy variables for a dataset on stock prices in r. One dummy variable is called prev1 and is: prev1 - ifelse(ret1 = .5, 1, 0) where ret1 is the previous day's return. The variable prev1 is created fine and works in my

Re: [R] Creating dummy variables in r

2013-01-29 Thread Bert Gunter
You almost never need dummy variables in R. R creates them automatically from factors given model and possibly contrasts specification. ?contrasts ## for some technical details. If you have not read An Introduction to R do so now. Pay particular attention to the chapter on modeling and

Re: [R] Sweave files generating miktex errors

2013-01-29 Thread Troy S
Ok, yes I realize it. So let me try to fix it: I removed the sty files, and set TEXINPUTS to 'C:\R\R-2.15.2\share\texmf\tex\latex I am back where I started: the tex file will not process. Please let me know what I should do to fix the issue. Troy On Tue, Jan 29, 2013 at 2:20 PM, Duncan Murdoch

[R] Finding predicted probabilities and their confidence intervals for a logit model

2013-01-29 Thread Abraham Mathew
I want to construct a logit model, plot the probability curve with the confidence intervals, and then I want to print out a data frame with the predictor, response value, predicted value, the low ci predicted value, and the high ci predicted value. So it should look something like: value low_ci

[R] R CMD check: Error in get(ptime, pos = CheckExEnv) ...

2013-01-29 Thread Johannes Graumann
Hi, Does anyboody have insight into what this error terminating R CMD check on an in-house package may imply? ### cat(Time elapsed: , proc.time() - get(ptime, pos = 'CheckExEnv'),\n) Error in get(ptime, pos = CheckExEnv) : unused argument(s) (pos = CheckExEnv) Calls: cat - cat.default -

Re: [R] R CMD check: Error in get(ptime, pos = CheckExEnv) ...

2013-01-29 Thread Prof Brian Ripley
On 30/01/2013 06:02, Johannes Graumann wrote: Hi, Does anyboody have insight into what this error terminating R CMD check on an in-house package may imply? You have re-defined cat(), so I guess you re-defined get() too. ### cat(Time elapsed: , proc.time() - get(ptime, pos =

Re: [R] R CMD check: Error in get(ptime, pos = CheckExEnv) ...

2013-01-29 Thread Johannes Graumann
Prof Brian Ripley wrote: On 30/01/2013 06:02, Johannes Graumann wrote: Hi, Does anyboody have insight into what this error terminating R CMD check on an in-house package may imply? You have re-defined cat(), so I guess you re-defined get() too. Aha! cat not, but one of my functions