Re: [R] best way to apply a list of functions to a dataset ?

2010-07-21 Thread Dennis Murphy
Hi: On Tue, Jul 20, 2010 at 5:37 PM, Glen Barnett glnbr...@gmail.com wrote: Hi Dennis, Thanks for the reply. Yes, that's easier, but the conversion to a matrix with rbind has converted the output of that final function to a numeric. If you look at the output of lapply(attitude, f),

[R] xtable with ifelse statement

2010-07-21 Thread vivi84
Hi there, I'm very new on R and I hope someone can help me to solve the problem in using the ifelse statement with the xtable function(library xtable). I'm trying to get the printing of the elements of two lists in a sorted way. These two list have in common the their names. I will try to give

Re: [R] Can RMySQL run on Windows using a remote MySQL server?

2010-07-21 Thread asbro
Change of user, was neatgadgets but that seems to not work very well. I managed to get it working by copying the 2 dll files into the R bin folder. So I am up and running now. Thanks for your help. -- View this message in context:

[R] Lattice Panel Print Order

2010-07-21 Thread Mark Ebbert
Hi, I have done a bit of searching and have not found a good answer for my question. Although I have not difficulty ordering the panels, Lattice prints them from bottom to top and left to right for each page. Is it possible to make it print from top to bottom for each page? I've tinkered with

Re: [R] nls with some coefficients fixed

2010-07-21 Thread Keith Jewell
Gabor Grothendieck ggrothendi...@gmail.com wrote in message news:aanlktilszaicycu3lz2f5d_bxq1g8m8f7jsjsbj2l...@mail.gmail.com... On Tue, Jul 20, 2010 at 9:58 AM, nas...@uottawa.ca wrote: For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something

Re: [R] Lattice Panel Print Order

2010-07-21 Thread Deepayan Sarkar
On Wed, Jul 21, 2010 at 12:13 AM, Mark Ebbert mark.ebb...@hci.utah.edu wrote: Hi, I have done a bit of searching and have not found a good answer for my question. Although I have not difficulty ordering the panels, Lattice prints them from bottom to top and left to right for each page. Is

Re: [R] nls with some coefficients fixed

2010-07-21 Thread Keith Jewell
Gabor Grothendieck ggrothendi...@gmail.com wrote in message news:aanlktilszaicycu3lz2f5d_bxq1g8m8f7jsjsbj2l...@mail.gmail.com... On Tue, Jul 20, 2010 at 9:58 AM, nas...@uottawa.ca wrote: For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something

Re: [R] square brackets in expression in plots

2010-07-21 Thread Jannis
Dear Duncan, dear David, thanks for the reply! I knew about Duncans solution, but could not figure out how to combine it that the 'm*s^-1' can be read from a string. Is there a way to tweak Davids suggestion in a way that this is possible? E.g.: a='m*s^-1' b='speed~bgroup([,a, ])'

[R] Odp: If help

2010-07-21 Thread Petr PIKAL
Hi I would make an interaction of those two vectors. interaction(sample(letters[1:2], 20, replace=T),sample(letters[1:2], 20, replace=T)) [1] a.a a.b b.b b.a b.b b.b a.a a.a b.b b.a a.a a.a b.b b.a a.a a.b b.a a.a b.b [20] a.b Levels: a.a b.a a.b b.b You will get factor and you can change

[R] how to unsubscribe

2010-07-21 Thread barbara horta e costa
Hello, I need to unsubcribe this email to the R help mailing list because I need to create an email only for this mailing list. My email account doesn't have that much space anymore and I don't have access to this every day. How can I do that? Thanks a lot -- Bárbara H. Costa Marine Biologist

Re: [R] ACCTGMX to 1223400 in R?

2010-07-21 Thread John1983
Dear all, Thank you for the help. Yes I should have posted in the Bioconductor's forum. Next time I sure will. The chartr function helped and now the code is significantly faster. I have also used the Bstrings as suggested by Martin. Thank you again. -- View this message in context:

[R] KALMAN

2010-07-21 Thread Research
Hello, I am looking for some very simple, step by step, hands on application/examples/notes etc. on setting up a multivariate time series Kalman filter model in R. Any help/pointers much appreciated. Best regards, Costas __ R-help@r-project.org

Re: [R] Limited output

2010-07-21 Thread confusedcius
The details of my problem are as follows: I have an sql that returns 2192 rows in sqlite. In R, I typed the following: library(RSQLite) con - dbConnect(dbDriver(SQLite), dbname = C:\\sqlite\\... .sqlite) dbListTables(con) #[1] tbl_n... tbl_s...# cur - dbSendQuery(con,select ... from

Re: [R] Limited output

2010-07-21 Thread confusedcius
I just found the solution... I used dbGetQuery instead of dbSendQuery. That's a more direct approach and it works. Thanks again for your help. -- View this message in context: http://r.789695.n4.nabble.com/Limited-output-tp2295882p2296822.html Sent from the R help mailing list archive at

[R] Objects within environment

2010-07-21 Thread Megh Dal
Hi all, I have following environments loaded with my current R session: search() [1] .GlobalEnvpackage:stats package:graphics package:grDevices [5] package:utils package:datasets package:methods Autoloads [9] package:base How can I find the objects under a

[R] Obtaining the unmerged cases from one of the two data set

2010-07-21 Thread Mangalani Peter Makananisa
Dear R Gurus, I am having two dummy csv data sets A and B containing 19 and 15 cases/observations respectively. From the two data set 13 cases are intersection. From one of the two (any) data set, How do I then retrieve the unmerged data ? let's take A for example, six cases must appear in our

[R] Brute-force clustering

2010-07-21 Thread syrvn
Hi all, I use heatmap.2 for clustering and as you know you can choose between several distance functions and clustering algorithms. Trying all combinations isn't too bad but I have two further parameters and whenever I change one of these I need do redo all cluster combinations. It probably

Re: [R] Random Forest - Strata

2010-07-21 Thread Tim Howard
Coll, An alternative approach is to do that subsetting yourself before sending it to RF and treat each group as an external validation group, as follows: - extract Site A, build a RF model (Model 1) on sites B and C - validate this model by running a predict on site A using the model, use ROCR

Re: [R] Objects within environment

2010-07-21 Thread Duncan Murdoch
On 21/07/2010 5:57 AM, Megh Dal wrote: Hi all, I have following environments loaded with my current R session: search() [1] .GlobalEnvpackage:stats package:graphics package:grDevices [5] package:utils package:datasets package:methods Autoloads [9] package:base

[R] Chi-square distribution probability density function:

2010-07-21 Thread Knut Krueger
Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula* *http://www.danielsoper.com/statkb/topic11.aspx* *what's the gamma function of this formula in r?* *df=5* *ch2=25.50878* *the following code

Re: [R] Obtaining the unmerged cases from one of the two data set

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 5:33 AM, Mangalani Peter Makananisa wrote: Dear R Gurus, I saw no reason to copy Rob Hyndman. I did not see that this involves any of the packages he maintains. I am having two dummy csv data sets A and B containing 19 and 15 cases/observations respectively. From the

[R] Validation in R for GAMM

2010-07-21 Thread Karen
My GAMM model is to find drivers of species richness in forests is gamm1- gamm(Total Species Richness ~ fROT + s(PH) + s(LOI) + ASP + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + s(Annprec), random=list (fSITE =~1), family = poisson, data = BIOFOR3)

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 6:52 AM, Knut Krueger wrote: Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula* *http://www.danielsoper.com/statkb/topic11.aspx* *what's the gamma function of this

Re: [R] xtable with ifelse statement

2010-07-21 Thread Jannis
What exactly do you want to do? To me it looks more like a problem with the arrangement of your lists as with xtable (or ifelse) (so you are better next time of with a more precise subject line). Please read the posting guide and provide some reproducable code so we can help you (and include

[R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread Tsunhin John Wong
Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. langcons.table - table(lang, cons) langcons.table[cbind(lang,cons)] - freq langcons.table Adj Int Oth Pas Tra C 69 221

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 8:07 AM, Tsunhin John Wong wrote: Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. langcons.table - table(lang, cons) langcons.table[cbind(lang,cons)]

Re: [R] how to unsubscribe

2010-07-21 Thread Jannis
As in nearly every e-mail list, you just need to click on one of the links at the end of each mail (its the first link in this case) and follow the instructions. Jannis --- barbara horta e costa barbarahco...@gmail.com schrieb am Mi, 21.7.2010: Von: barbara horta e costa

Re: [R] Random Forest - Strata

2010-07-21 Thread mxkuhn
If you use the index argument of the trainControl() function in the caret package, the train() function can be used for this type of resampling (and you'll get some decent summaries and visualizations to boot) Max On Jul 21, 2010, at 7:11 AM, Tim Howard tghow...@gw.dec.state.ny.us wrote:

[R] Saving R plots as image in oracle database tables

2010-07-21 Thread vikrant
Dear All, I want to know how to save R plots as image/object in a oracle database?? I am using RODBC package for connecting R to oracle Please explain by giving example.. Thanks in advance Cheers, Vikrant -- View this message in context:

[R] fix()ing an S4 method

2010-07-21 Thread Albert-Jan Roskam
Hi R experts,   The fix() function canbe used to edit normal functions. I would like to know whether it's also possible to use something similar to edit a method of an S4 class. In other words, is there a fix-like function that allows me to edit method definitions without having to go back to

Re: [R] how to unsubscribe

2010-07-21 Thread barbara horta e costa
I already changed my email account. Thanks a lot On 21 July 2010 12:50, Jannis bt_jan...@yahoo.de wrote: As in nearly every e-mail list, you just need to click on one of the links at the end of each mail (its the first link in this case) and follow the instructions. Jannis --- barbara

[R] DIF Analysis starting from a gpcm class object

2010-07-21 Thread Dr. Federico Andreis
Dear useRs, does any of you have suggestions on how to conduct a proper DIF analysis starting from a model of class gpcm (from the wonderful package ltm by prof. Rizopoulos)? difR will handle only dichotomous items, and I have a mix of dicho- and polytomous ones (that's why I chose the partial

[R] Fractional Polynomials - Hazard Ratios and Relative Hazard Plots

2010-07-21 Thread Laura Bonnett
Dear All, I am using Windows and R version 2.9.2 with libraries cmprsk, mfp and Design. I have a dataset with approximately 1700 patients (1 row per patient) and I have 12 outcomes, three of which are continuous. I have performed univariate analyses to see if any factors are associated with a

[R] R Cheat Sheets and Reference Cards

2010-07-21 Thread Tim Church
FYI - There is a new collection of free cheat sheets and reference cards for R on DevCheatSheet - http://devcheatsheet.com/tag/r/ If anyone knows of any other R cheat sheets that are not listed, please use the 'Suggest a Missing Cheat Sheet' link on the site. [[alternative HTML version

[R] Piecewise regression using lme()

2010-07-21 Thread goulvenS
Hi everyone, I'm trying to fit a of piecewise regression model on a time series. The idea is to divide the series into segments and then to apply linear regression models on each segment but in a global way and considering heteroskedasticity between the segments. For example, I build a time

[R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread Igor Blanco
Hi there, I am trying to analyze some data using the lme package. In my case there is a variable called Newmarker that can only take 2 values (number 1 or number 2). I have used the as.factor to remark this fact but an error message appears stating: attempt to set rownames on object with no

Re: [R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread Prof Brian Ripley
?lme (at least the one in package nlme) seems not to mention that the response in 'fixed' must be a numeric variable, but it must (and a factor is not numeric). If you want to use a binary response, you need to use other methods, and it would be better to ask on R-sig-mixed-models making

Re: [R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 9:39 AM, Igor Blanco wrote: Hi there, I am trying to analyze some data using the lme package. In my case there is a variable called Newmarker that can only take 2 values (number 1 or number 2). I have used the as.factor to remark this fact but an error message appears

[R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
Hello! I have a data frame A (below) with a grouping factor (group). I take my DV and create the new, lagged DV by applying the function lag.it (below). It works fine. A - data.frame(year=rep(c(1980:1984),3), group= factor(sort(rep(1:3,5))), DV=c(rnorm(15))) lag.it - function(x) { DV -

[R] How do you calculate DIC from coda files (R2WinBUGS)?

2010-07-21 Thread Patrick McKann
I tried calculating pD as 1/2 variance of the deviance, but I got hugely inflated numbers. Does anybody know how to calculate pD from the coda files output from R2WinBUGS? By the way, 'set DIC' is greyed out for some reason within WinBUGS, so I can't monitor DIC. [[alternative HTML

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-21 Thread Peter Ehlers
Dennis' ddply solution would be my choice. Here is a small variation that makes it easy to modify what list of functions is applied: # ma- melt(attitude) f - function(x,v) summarise(x, mean = mean(v), sd = sd(v), skewness = skewness(v), mean.gt.med = mean.gt.med(v) )

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Ben Bolker
Harlan Harris harlan at harris.name writes: Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet cells went away. I get the following weird error: Error in els[[type + 1]] : subscript out of

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Henrique Dallazuanna
On Wed, Jul 21, 2010 at 11:24 AM, Ben Bolker bbol...@gmail.com wrote: Harlan Harris harlan at harris.name writes: Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet cells went away. I get

[R] Clustering groups

2010-07-21 Thread syrvn
Hi, is there a way in R to identify those cluster methods / distance measures which best reflect predefined cluster groups. Given 10 observations O1...O10. Optimally, these 10 observations cluster as follows: cluster1: O1, O2, O3, O4 cluster2: O5, O6 cluster3: O7, O8, O9, O10. What I want is a

Re: [R] The opposite of lag

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 10:14 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I have a data frame A (below) with a grouping factor (group). I take my DV and create the new, lagged DV by applying the function lag.it (below). It works fine. A -

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-21 Thread Hadley Wickham
ddply(ma, .(variable), summarise, mean = mean(value), sd = sd(value),       skewness = skewness(value), median = median(value),       mean.gt.med = mean.gt.med(value)) In principle, you should be able to do: ddply(ma, .(variable), colwise(each(mean, sd, skewness, median, mean.gt.med))) but

Re: [R] Help with time in R

2010-07-21 Thread Aaditya Nanduri
Ms. Chisholm, If you could tell us how you plan to use the variables, we will have a better understanding of what you are looking for and will be able to help you. Are you looking for the time in seconds? In that case, do as Mr. Holfman says. He just skipped the part about converting the factors

[R] Interactions in GAMMs

2010-07-21 Thread Karen Moore
Hi, I've an issue adding an interaction to a GAMM: My model was of form: gamm1 - gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + s(Annprec) + s(OLDWDLD:DISTWOOD) + (1|fSITE), family = poisson, data =

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Harlan Harris
I unfortunately haven't received any responses about this problem. We (the company I work for) are willing to discuss payment to someone who is willing to quickly contribute a fix to the RGoogleDocs/RCurl toolchain that will restore write access. Please contact me directly if you're interested.

Re: [R] Interactions in GAMMs

2010-07-21 Thread Vito Muggeo (UniPa)
Hi Karen, I think you should decide what you mean for interaction. s(x:y) is meaningless If you want to fit a surface you should use s(x,y). If you want to fit a varying coefficient model (interaction between a linear and a smooth term) you should use the argument by in s(). The help files

[R] lm: order of dropped columns

2010-07-21 Thread Anirban Mukherjee
Hi all, If presented with a singular design matrix, lm drops columns to make the design matrix non-singular. What algorithm is used to select which (and how many) column(s) to drop? Particularly, given a factor, how does lm choose levels of the factor to discard? Thanks for the help. Best,

Re: [R] Interactions in GAMMs

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 11:17 AM, Karen Moore wrote: Hi, I've an issue adding an interaction to a GAMM: My model was of form: # Package? Probably: require(mgcv) gamm1 - gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD)

[R] Default For list.len Argument (list output truncated)

2010-07-21 Thread Soeren . Vogel
Hello How can I set a default for the 'list.len' argument in 'str'? x - as.data.frame(matrix(1:1000, ncol=1000)) str(x) formals(str) - alist(object=, ...=, list.len=1000) args(str); formals(str) str(x) Does not display errors, but does not work either. Thanks for help Sören

Re: [R] The opposite of lag

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 10:50 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jul 21, 2010 at 10:14 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I have a data frame A (below) with a grouping factor (group). I take my DV and create the new, lagged DV by

Re: [R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
Never mind- I figured it out: A library(zoo) z - read.zoo(A, index = 1, split = group, frequency = 1) z - as.zooreg(z) ### result-lag(z, c(-1, 0, 1)) A result Thank you very much! On Wed, Jul 21, 2010 at 12:08 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Thank you, Gabor, but

Re: [R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
Sorry, I don't think it's working. the last 3 columns (on the right) of result contain the original data of each group. But there is no shift at all. I am trying to reach the following result for each group: The first number disappears and at the bottom an NA appears. Is it possible? On Wed, Jul

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Ben Bolker
On Wed, Jul 21, 2010 at 10:38 AM, Henrique Dallazuanna www...@gmail.com wrote: Maybe: packageDescription('RGoogleDocs', fields = 'Author') or rather packageDescription('RgoogleDocs', fields='Maintainer') (usually but not always the same person) thanks Ben

Re: [R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
Basically, if you look at the A lagged below, then you see how in each group the values of A move downwards: and NA is added on top and the last value in each group disappears. I am trying to get the opposite: the first value in each group disappears and NA is added at the bottom. D.

Re: [R] Constrain density to 0 at 0?

2010-07-21 Thread Ravi Varadhan
This is the boundary problem in density estimation. One simple trick is to use the idea of reflection. If your data is (y1, y2, ...,yn), you create a reflected data by appending `n' negative values to your data, call this y*. Estimate the kernel density for this as fhat(y*). Redefine this

Re: [R] Objects within environment

2010-07-21 Thread Duncan Murdoch
On 21/07/2010 12:27 PM, Megh Dal wrote: Hi Duncan, thanks for your clarification. However I do not think I could really understand the envir argument in objects() function. It is saying an alternative argument for name Is the alternative means the alternative of, let say,

Re: [R] The opposite of lag

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 12:18 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Sorry, I don't think it's working. the last 3 columns (on the right) of result contain the original data of each group. But there is no shift at all. I am trying to reach the following result for each

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan Can you send some code so that we can reproduce the problem. That will enable me to fix the problem quicker. D. On 7/21/10 8:26 AM, Harlan Harris wrote: I unfortunately haven't received any responses about this problem. We (the company I work for) are willing to discuss payment

[R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Camster
Dear all I am running in a problem when trying to run R from Windows command line. I am runnning Windows Vista, R-2.10.1. I have a script I would like to run remotely from another program. As it did not work, I thought I would test the script from the Windows command line which highlighted a

Re: [R] [SPAM](Aktien) Re: Chi-square distribution probability density function:

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 12:36 PM, Knut Krueger wrote: David Winsemius schrieb: On Jul 21, 2010, at 6:52 AM, Knut Krueger wrote: Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula*

[R] String processing - is there a better way

2010-07-21 Thread Davis, Brian
I have a two part question Part 1) I am trying to remove characters in a string based on the position of a key character in another string.  I have a solution that works but it requires a for-loop.  A vectorized way of doing this has alluded me.  CleanRead-function(x,y) {   if

Re: [R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Duncan Murdoch
On 21/07/2010 12:55 PM, Camster wrote: Dear all I am running in a problem when trying to run R from Windows command line. I am runnning Windows Vista, R-2.10.1. I have a script I would like to run remotely from another program. As it did not work, I thought I would test the script from the

Re: [R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
I reinstalled zoo and now I can see the years on left (raw names). Before - I could not see them. Thank you! On Wed, Jul 21, 2010 at 12:51 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jul 21, 2010 at 12:18 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Sorry, I

Re: [R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 12:55 PM, Camster c.szmar...@googlemail.com wrote: Dear all I am running in a problem when trying to run R from Windows command line. I am runnning Windows Vista, R-2.10.1. I have a script I would like to run remotely from another program. As it did not work, I

Re: [R] The opposite of lag

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 1:16 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I reinstalled zoo and now I can see the years on left (raw names). Before - I could not see them. Thank you! Note that the result is a zoo object. A zoo object consists of data (which is everything

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 1:18 PM, Knut Krueger wrote: David Winsemius schrieb: And exactly why did you think I offered ?Chisquare I was completely on the wrong way, and tried to find a solution with the formula instead to substitute the formula. So I tried to implement pchisq into the

Re: [R] The opposite of lag

2010-07-21 Thread Dimitri Liakhovitski
Thanks a lot, it's very helpful! On Wed, Jul 21, 2010 at 1:21 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jul 21, 2010 at 1:16 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I reinstalled zoo and now I can see the years on left (raw names). Before - I could

Re: [R] String processing - is there a better way

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 1:02 PM, Davis, Brian brian.da...@uth.tmc.edu wrote: I have a two part question Part 1) I am trying to remove characters in a string based on the position of a key character in another string.  I have a solution that works but it requires a for-loop.  A vectorized

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan If you install the latest version of RCurl from source via install.packages(RCurl, repos = http://www.omegahat.org/R;) and that should solve the problem, assuming I have been reproducing the same problem you mentioned. You haven't mentioned what operating system your are on.

Re: [R] Objects within environment

2010-07-21 Thread Bert Gunter
Can you please explain me in simple english? I think R help file should use more non-technical simple english language so that student like me can understand R in more easier way! -- Megh (and others): Without judging this particular issue, writing good technical documentation -- whether it be

Re: [R] Interactions in GAMMs

2010-07-21 Thread Gavin Simpson
On Wed, 2010-07-21 at 16:17 +0100, Karen Moore wrote: Hi, I've an issue adding an interaction to a GAMM: My model was of form: gamm1 - gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + s(Annprec) +

Re: [R] Problem with invoking R from the command line (Windows Vista) - - SORTED!

2010-07-21 Thread Camster
Thanks for suggestion. It was indeed a path problem. I move R into a directory without spaces and added the directory RHOME\bin in the Path environment variable. All sorted. -- View this message in context:

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Harlan Harris
*Thank you*! Yes, version 1.4-3 of RCurl solves this problem! If you put a tip jar https://www.paypal.com/cgi-bin/webscr?cmd=_donate-intro-outside on OmegaHat, Duncan, I will seriously kick a few bucks your way. Getting my code back running will save me a lot of time and anxiety! Thanks for all

[R] prediction from a logistic mixed effects model

2010-07-21 Thread kdionisio
Hi, Is there any similar command to predict which can be used with a logistic random effects model? I have run a random effects model using lme(), and then use predict.lme() with no problems. However, I would also like to run a logistic random effects model, and then also run a predict command

[R] Converting Between Character and Numeric Objects

2010-07-21 Thread Erin
Hello, I'm trying to convert a vector of string objects to a numeric object by initializing the variables with values. I use the function below to scan through a matrix and create mass action flux relationships: makeMassActionFluxes = function(sMatrix) { #Allocate a matrix with identical

Re: [R] lm: order of dropped columns

2010-07-21 Thread Dennis Murphy
Hi: (1) lm() drops columns in a rank-deficient model matrix X to make X'X nonsingular - this is called a full-rank reparameterization of the linear model. (2) How many columns of X are dropped depends on its rank, which in turn depends on the number of constraints in the model matrix. This is

[R] Get distribution of positive/negative examples for each cluster

2010-07-21 Thread Boya Sun
Dear R experts, I have a labeled data set. Each data is assigned a binary label 0 or 1. Assume that I use some clustering algorithm to group the data by clusters (using some features of the data). Now I want to know how many data are labeled as 0/1 in each cluster. For example, assume that I

[R] Help me with prediction in linear model

2010-07-21 Thread vijaysheegi
Hi R-community, I have the code as follows,i Fitted model as follows lbeer-log(beer_monthly) t-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ entries t2=t^2 beer_fit_parabola=lm(lbeer~t+t2) Below is not working for me. Please help me in preparing the new data set for

[R] lmomRFA package: error bounds/confidence intervals

2010-07-21 Thread Tonja Krueger
Dear List I’m using the ”lmomRFA” package to fit different distributions to my data sample. To calculate the error bounds I used: regsimq(…) and sitequantbounds(…) So my questions are: Are error bounds and confidence intervals the same thing? And: Does regsimq(… boundprob =

Re: [R] sem by variable x

2010-07-21 Thread Daniel Caro
Hi Jarret, Thank you for your answer. I get the following message: Error in cov(a.df[, 2:7], nrow(a.df)) : incompatible dimensions The function seems to run for some countries but then appears to stop when a country has incomplete data (1 var is missing, for example). How to force the function

Re: [R] Lattice Panel Print Order

2010-07-21 Thread Mark Ebbert
For pete's sake! That's just embarrassing. I don't know how I missed that. Thanks for your help Deepayan. I would also like to say thank you for supporting Lattice so well. On Jul 21, 2010, at 2:39 AM, Deepayan Sarkar wrote: On Wed, Jul 21, 2010 at 12:13 AM, Mark Ebbert

Re: [R] Objects within environment

2010-07-21 Thread Megh Dal
Hi Duncan, thanks for your clarification. However I do not think I could really understand the envir argument in objects() function. It is saying an alternative argument for name Is the alternative means the alternative of, let say, package:graphics (which is the name of an

Re: [R] Objects within environment

2010-07-21 Thread Megh Dal
Thanks Duncan, I understood. Your explanation is really great. Thank you so much for your time. --- On Wed, 7/21/10, Duncan Murdoch murdoch.dun...@gmail.com wrote: From: Duncan Murdoch murdoch.dun...@gmail.com Subject: Re: [R] Objects within environment To: Megh Dal megh700...@yahoo.com Cc:

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread Knut Krueger
David Winsemius schrieb: And exactly why did you think I offered ?Chisquare I was completely on the wrong way, and tried to find a solution with the formula instead to substitute the formula. So I tried to implement pchisq into the formula - and of course I got wrong values ... Thank's

[R] .jinit and .jnew

2010-07-21 Thread behrooz
i have a jar under z:/downloads/AA, i use .jinit(classpath=z:/downloads/AA) and then .jnew(Myclass) but .jnew throes an error: Error in .jnew(MyClass) : java.lang.NoClassDefFoundError: MyClass tried .jinit(classpath=z:/downloads/AA/myClass.jar) and got the same error. any idea? --

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread David Scott
Henrique Dallazuanna wrote: On Wed, Jul 21, 2010 at 11:24 AM, Ben Bolker bbol...@gmail.com wrote: Harlan Harris harlan at harris.name writes: Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet

[R] Question about allocMatrix error message

2010-07-21 Thread Moohwan Kim
Dear R family, I faced a technical problem in r coding. #s=t(dev)%*%dev/(nr-1) # dev (100,000 by 2) stands for deviation from the mean #sinv=solve(s) #t2=diag(dev%*%sinv%*%t(dev)) I got an error message at t2 statement: Error in diag(dev %*% si %*% t(dev)) : allocMatrix: too many

Re: [R] calling R from within Java, using jri

2010-07-21 Thread Hawcandy
I've gotten the same problems when running the examples, the programs just exit after creating Rengine. After trying all the possibilities, I found that I set the environment variable R_HOME wrong. After changing it from C:\Program Files\R\R-2.11.1\bin to C:\Program Files\R\R-2.11.1, the programs

[R] xtable

2010-07-21 Thread Silvano
Hi, How do I build a table from a regression model adjusted using xtable? Commands are: modelo1 = lm(Y~X1 + X2) influencia = influence.measures(modelo1) require(xtable) xtable(influencia) but it isn't work. Thanks, -- Silvano Cesar da Costa

Re: [R] Get distribution of positive/negative examples for each cluster

2010-07-21 Thread Phil Spector
Boya- table() is the function that does what you want: cdat = data.frame(membership=rep(1:3,rep(3,3)), + label=as.character(c(0,0,1,0,1,1,1,1,1))) table(cdat) label membership 0 1 1 2 1 2 1 2 3 0 3 From there, you can rearrange it

[R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Hi, folks, Here are the codes: ## y=1:10 x=c(1:9,1) lin=lm(log(y)~x) ### log(y) is following Normal distribution x=5:14 prediction=predict(lin,newdata=x) ##prediction=predict(lin) ### 1. The codes do not work, and give the error message: Error in eval(predvars, data,

Re: [R] Question about allocMatrix error message

2010-07-21 Thread Phil Spector
Moohwan - It appears that you are trying to calculate a 10 by 10 matrix when all you want are the diagonal elements. Here's one approach that might work: s = t(dev)%*%dev/(nr-1) sinv = solve(s) part = sinv%*%t(dev) t2 = dev[,1]*part[1,] + dev[,2]*part[2,]

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Sorry, for the second question. I stated in a wrong way. My aim is the mean and sd of each new observation. # mean=fitted(prediction) ## But I do not know how to get sd for each new observation. Any tips? Thanks Yi On Wed, Jul 21, 2010 at 2:29 PM, Yi liuyi.fe...@gmail.com wrote:

[R] Issues reshaping data

2010-07-21 Thread JGull8502
Hello All, I'm having some trouble reshaping my data from wide to long format. I have tried using both the reshape function and package. Although I haven't worked much with the reshape function, I have found the reshape package useful and intuitive for reshaping data from long to wide format.

Re: [R] Help me with prediction in linear model

2010-07-21 Thread Dennis Murphy
Hi: On Wed, Jul 21, 2010 at 8:46 AM, vijaysheegi vijay.she...@gmail.com wrote: Hi R-community, I have the code as follows,i Fitted model as follows lbeer-log(beer_monthly) t-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ entries This is unnecessary: t2=t^2

[R] Command that is conditional upon file retrieval: is it possible?

2010-07-21 Thread AndrewPage
Hi all, I'm currently working on an R program where I have to access an FTP server to download some of the data I need. However, the people who post up the files I access are at times inconsistent with regards to time posted, if they post at all, etc Here's some of the code I use:

  1   2   >