Re: [R] MATLAB vrs. R

2010-10-11 Thread Peter Dalgaard
On 10/11/2010 07:46 AM, Craig O'Connell wrote: I need to find the area under a trapezoid for a research-related project. I was able to find the area under the trapezoid in MATLAB using the code: function [int] = myquadrature(f,a,b) % user-defined quadrature function % integrate data f

Re: [R] MATLAB vrs. R

2010-10-11 Thread Craig O'Connell
Thank you Peter. That is very much helpful. If you don't mind, I continued running the code to attempt to get my answer and I continue to get inf inf inf... (printed around 100 times). Any assistance with this issue. Here is my code (including your corrections):

Re: [R] MATLAB vrs. R

2010-10-11 Thread Alain Guillet
Hi, The first argument of myquadrature in result shouldn't be val but f I guess. At least it works for me result=myquadrature(f,0,2000) print(result) [1] 3 Regards, Alain On 11-Oct-10 09:37, Craig O'Connell wrote: Thank you Peter. That is very much helpful. If you don't mind, I

[R] mvtnorm and noncentrality parameters

2010-10-11 Thread Paul Sweeting
Hi I'm trying to calculate densities for the multivariate noncentral t distribution. For the avoidance of doubt, and becuase there do seem to be at least two definitions for a noncentral t distribution, This is a noncentral t distribution of the sort described in McNeill Frey and Embrechts

Re: [R] Number of occurences of a character in a string

2010-10-11 Thread Ted Harding
How about: sum(unlist(strsplit(b,NULL))==;) # [1] 5 (More transparent, at least to me ... ). See '?strsplit', and note what is said under Value. Ted. On 11-Oct-10 04:35:43, Michael Sumner wrote: Literally: length( gregexpr(;, b)[[1]]) But more generally, in case b has more than one

[R] Dataset Transformation

2010-10-11 Thread Santosh Srinivas
I need to transpose the following input dataset into an output dataset like below Input Date TICKER Price 11/10/2010 A 0.991642 11/10/2010 B 0.475023 11/10/2010 C 0.218642 11/10/2010 D 0.365135 12/10/2010 A 0.687873 12/10/2010 B 0.47006 12/10/2010 C 0.533542

[R] Split rows depending on time frame

2010-10-11 Thread Bert Jacobs
Hi, I have the following data frame, where col2 is a startdate and col3 an enddate COL1 COL2 COL3 A 4046240482 B 4046240478 The above timeframe of 3 weeks I would like to splits it in weeks like this COL1 COL2 COL3 COL4 A

Re: [R] Split rows depending on time frame

2010-10-11 Thread ONKELINX, Thierry
Dear Bert, Use the plyr package to do the magic library(plyr) dataset - data.frame(COL1 = c(A, B), COL2 = 40462, COL3 = c(40482, 40478)) tmp - ddply(dataset, COL1, function(x){ delta - with(x, 1 + COL3 - COL2) rows - rep(1, delta %/% 7) if(delta %% 7 0){

Re: [R] Split rows depending on time frame

2010-10-11 Thread Gabor Grothendieck
On Mon, Oct 11, 2010 at 5:25 AM, Bert Jacobs bert.jac...@figurestofacts.be wrote: Hi, I have the following data frame, where col2 is a startdate and col3 an enddate COL1      COL2      COL3 A             40462    40482 B             40462    40478 The above timeframe of 3 weeks I

[R] plotting Zipf and Zipf-Mandelbrot curves in R

2010-10-11 Thread Joseph Sorell
Using R, I plotted a log-log plot of the frequencies in the Brown Corpus using plot(sort(file.tfl$f, decreasing=TRUE), xlab=rank, ylab=frequency, log=x,y) However, I would also like to add lines showing the curves for a Zipfian distribution and for Zipf-Mandelbrot. I have seen these in many

[R] clustering with cosine correlation

2010-10-11 Thread l.mohammadikhankahdani
Dear All Do you know how to make a heatmap and use cosine correlation for clustering? This is what my colleague can do in gene-math and I want to do in R but I don't know how to. Thanks a lot Leila __ R-help@r-project.org mailing list

Re: [R] Mapping the coordinates!

2010-10-11 Thread Paul Hiemstra
Hi Mehdi, Take a look at the spatial task view [1] and the r-sig-geo mailing [2] list. cheers, Paul [1] http://cran.r-project.org/web/views/Spatial.html [2] https://stat.ethz.ch/mailman/listinfo/r-sig-geo On 10/10/2010 06:11 AM, Mehdi Zarrei wrote:

[R] Boundary correction for kernel density estimation

2010-10-11 Thread Katja Hebestreit
Dear R-users, I have the following problem: I would like to estimate the density curve for univariate data between 0 and 1. Unfortunately, the density function in the stats package is just capable to cut the curve at a left and a right-most point. This truncation would lead to an

[R] (senza oggetto)

2010-10-11 Thread Barbara . Rogo
I have the y-axe in a grafich that has as extreme limit 0.00 and 1.50. plot gives me the interval 0.0, 0.5,1.0,1.5 but I want: 0.00,0.15,0.30 and so on with 2 decimals. How can I do? Thanks [[alternative HTML version deleted]] __

Re: [R] (senza oggetto)

2010-10-11 Thread Ivan Calandra
Hi, Try this: plot(seq(0,1.5,0.1), yaxt=n) axis(2, at=seq(0.00,1.50, 0.15)) To understand read ?par (especially the yaxt argument in that case, but I guess you need to know more about that) and ?axis HTH, Ivan Le 10/11/2010 14:07, barbara.r...@uniroma1.it a écrit : I have the y-axe in a

[R] conditioning variables in dbRDA

2010-10-11 Thread Nevil Amos
I am using cascaple() in vegan, is it permissible to have more than one conditioning variable thus capscale(DIST~varaible1+variable2+Conditon(varaible3+variable4), data=mydata) many thanks Nevil Amos __ R-help@r-project.org mailing list

Re: [R] (senza oggetto)

2010-10-11 Thread Ted Harding
On 11-Oct-10 12:07:43, barbara.r...@uniroma1.it wrote: I have the y-axe in a grafich that has as extreme limit 0.00 and 1.50. plot gives me the interval 0.0, 0.5,1.0,1.5 but I want: 0.00,0.15,0.30 and so on with 2 decimals. How can I do? Thanks [[alternative HTML version deleted]]

Re: [R] conditioning variables in dbRDA

2010-10-11 Thread Gavin Simpson
On Mon, 2010-10-11 at 23:42 +1100, Nevil Amos wrote: I am using cascaple() in vegan, is it permissible to have more than one conditioning variable thus capscale(DIST~varaible1+variable2+Conditon(varaible3+variable4), data=mydata) Yes. Have you tried it and had problems doing it? Or is this

Re: [R] question related to multiple regression

2010-10-11 Thread Ben Bolker
SNN s.nancy1 at yahoo.com writes: I am conducting an association analysis of genotype and a phenotype such as cholesterol level as an outcome and the genotype as a regressor using multiple linear regression. There are 3 possibilities for the genotype AA, AG, GG. There are 5 people with the AA

Re: [R] conditioning variables in dbRDA

2010-10-11 Thread Jari Oksanen
On 11/10/10 15:42 PM, Nevil Amos nevil.a...@gmail.com wrote: I am using cascaple() in vegan, is it permissible to have more than one conditioning variable thus capscale(DIST~varaible1+variable2+Conditon(varaible3+variable4), data=mydata) Nevil, Yes, it is permissible. Cheers, Jari

Re: [R] Dataset Transformation

2010-10-11 Thread Santosh Srinivas
Repost .. since the previous msg had problems I need to transpose the following input dataset  into an output dataset like below Input DateTICKER Price 11/10/2010 A 0.991642 11/10/2010 B 0.475023 11/10/2010 C

Re: [R] venneuler (java?) color palette 0 - 1

2010-10-11 Thread Karl Brand
Hi Paul, That's pretty much awesome. Thank you very much. And combined with the colorspace package functions- rainbow_hcl() and sequential_hcl() -make color selection easy. One thing i was digging for was a function that yields a color palette *and* the hcl() call needed to produce it. This

Re: [R] Dataset Transformation

2010-10-11 Thread jim holtman
try this: x - read.table(textConnection(DateTICKER Price + 11/10/2010 A 0.991642 + 11/10/2010 B 0.475023 + 11/10/2010 C 0.218642 + 11/10/2010 D 0.365135 + 12/10/2010

Re: [R] Efficiency Question - Nested lapply or nested for loop

2010-10-11 Thread epowell
Thank you both for your advice. I ended up implementing both solutions and testing them on a real dataset of 10,000 rows and 50 inds. The results are very, very interesting. For some context, the original two approaches, nested lapply and nested for loops, performed at 1.501529 and 1.458963

Re: [R] venneuler (java?) color palette 0 - 1

2010-10-11 Thread Achim Zeileis
On Mon, 11 Oct 2010, Karl Brand wrote: Hi Paul, That's pretty much awesome. Thank you very much. And combined with the colorspace package functions- rainbow_hcl() and sequential_hcl() -make color selection easy. One thing i was digging for was a function that yields a color palette *and*

[R] filled.contour: colour key decoupled from main plot?

2010-10-11 Thread Panos Hadjinicolaou
Dear R colleagues, I am trying to plot some geophysical data as a filled contour on a continent map and so far the guidance from the R-help archives has been invaluable. The only bit that still eludes me is the colour key (legend) coming with filled.contour: I prefer to generate my own colour

Re: [R] Dataset Transformation

2010-10-11 Thread Gabor Grothendieck
On Mon, Oct 11, 2010 at 9:35 AM, Santosh Srinivas santosh.srini...@gmail.com wrote: Repost .. since the previous msg had problems I need to transpose the following input dataset  into an output dataset like below Input Date            TICKER          Price 11/10/2010              A        

[R] Trouble accessing cov function from stats library

2010-10-11 Thread Barth B. Riley
Dear all I am trying to use the cov function in the stats library. I have no problem using this function from the console. However, in my R script I received a function not found message. Then I called stats::cov(...) and received an error message that the function was not exported. Then I

[R] help with simple but massive data transformation

2010-10-11 Thread clee
I have data that looks like this: start end value 1 4 2 5 8 1 9 100 I want to transform the data so that it becomes: startend value 1 2 2 2 3 2 4 2 5 1 6

Re: [R] Trouble accessing cov function from stats library

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 10:27 AM, Barth B. Riley wrote: Dear all I am trying to use the cov function in the stats library. I have no problem using this function from the console. However, in my R script I received a function not found message. Then I called stats::cov(...) and received an

[R] How to get Mean rank for Kruskal-Wallis Test

2010-10-11 Thread Lawrence
Hello All, I want Ranks' Table in R as like in SPSS ouput in the given link. http://www.statisticssolutions.com/methods-chapter/statistical-tests/kruskal-wallis-test/ Is the code is already available? Please let me know. Thanks, Lawrence __

[R] OT: snow socket clusters with VirtualBox and VMware player (Linux host, Win guest)

2010-10-11 Thread Ramon Diaz-Uriarte
Dear All, I am trying to create socket clusters (using snow and snowfall) with a Windows OS. I am running Windows inside VirtualBox and VMware player (i.e., Windows is guest) from a Debian Linux host system (I've tried in two different Linux systems, an AMD x86-64 workstation and an Intel i686

Re: [R] help with simple but massive data transformation

2010-10-11 Thread ONKELINX, Thierry
This should be easy with apply() do.call(rbind, apply(dataset, 1, function(x){ list(data.frame(startend = x[1]:x[2], value = x[3]) })) Untested! ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team

Re: [R] help with simple but massive data transformation

2010-10-11 Thread Gabor Grothendieck
On Mon, Oct 11, 2010 at 10:16 AM, clee cheel...@gmail.com wrote: I have data that looks like this: start     end     value 1          4         2 5          8         1 9         10        0 I want to transform the data so that it becomes: startend     value 1               2 2      

Re: [R] help with simple but massive data transformation

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 10:16 AM, clee wrote: I have data that looks like this: start end value 1 4 2 5 8 1 9 100 I want to transform the data so that it becomes: startend value 1 2 2 2 3 2

Re: [R] Heatmap/Color Selection(Key)

2010-10-11 Thread Eik Vettorazzi
Hi Rashid, you may have a look at the colorRampPalette-function, along with the at argument oh heatmap.2 x-matrix(runif(100,-6,6),nrow=10) heatmap.2(x,col=colorRampPalette(c(blue,lightblue,darkgray,darkgray,yellow,red),space=Lab),at=c(-6.01,6.01,51)) # or just using the colors you posted

Re: [R] Heatmap/Color Selection(Key)

2010-10-11 Thread Eik Vettorazzi
sorry, typo: heatmap.2(x,col=colorRampPalette(c(blue,lightblue,darkgray,darkgray,yellow,red),space=Lab),at=c(-6.01,6.01,51)) heatmap.2(x,col=c(blue,lightblue,darkgray,black,darkgray,yellow,red),at=-3:3*2) should be read as

Re: [R] How to get Mean rank for Kruskal-Wallis Test

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 9:43 AM, Lawrence wrote: Hello All, I want Ranks' Table in R as like in SPSS ouput in the given link. http://www.statisticssolutions.com/methods-chapter/statistical-tests/kruskal-wallis-test/ Is the code is already available? Please let me know. Yes. All code is

Re: [R] MATLAB vrs. R

2010-10-11 Thread Craig O'Connell
alain, Perhaps i'm still entering the code wrong. I tried using your result=myquadrature(f,0,2000) print(result) Instead of my: val = myquadrature(f,a,b) result=myquadrature(val,0,2000) print(result) ...and I am still getting an inf inf inf inf inf... Did you change any of the

[R] Nonlinear Regression Parameter Shared Across Multiple Data Sets

2010-10-11 Thread Jared Blashka
I'm working with 3 different data sets and applying this non-linear regression formula to each of them. nls(Y ~ (upper)/(1+10^(X-LOGEC50)), data=std_no_outliers, start=list(upper=max(std_no_outliers$Y),LOGEC50=-8.5)) Previously, all of the regressions were calculated in Prism, but I'd like to be

[R] how can i do anova

2010-10-11 Thread Mauluda Akhtar
Hi, I've a table like the following. I want to do ANOVA. Could you please tell me how can i do it. I want to show whether the elements (3 for each column) of a column are significantly different or not. Just to inform you that i'm a new user of R bp_30048741 bp_30049913 bp_30049953

Re: [R] Hausman test for endogeneity

2010-10-11 Thread Bert Gunter
... and, in fact, simply googling on R Package Hausmann finds two Hausmann test functions in 2 different packages within the first half dozen hits. -- Bert On Sat, Oct 9, 2010 at 11:06 AM, Liviu Andronic landronim...@gmail.com wrote: Hello On Sat, Oct 9, 2010 at 2:37 PM, Holger Steinmetz

Re: [R] how can i do anova

2010-10-11 Thread Andrew Miles
Type ?anova on your R command line for the basic function, and links to related functions. Also, try a google search of something like doing anova in R and you should find multiple tutorials or examples. Andrew Miles On Oct 11, 2010, at 11:33 AM, Mauluda Akhtar wrote: Hi, I've a table

[R] help with Cairo

2010-10-11 Thread Ivan Calandra
Dear users, As an alternative to RSvgDevice::devSVG, I have tried using Cairo and cairoDevice. When opening the svg file from Cairo::CairoSVG() as well as from cairoDevice::Cairo_svg() in Illustrator, I got a warning message (which is damn hard to translate since I don't understand it),

Re: [R] how can i do anova

2010-10-11 Thread Joshua Wiley
Hi Moon, Here is something to get you started. # Read Data into R dat - read.table(textConnection( bp_30048741 bp_30049913 bp_30049953 bp_30049969 bp_30049971 bp_30050044 [1,] 69 46 43 54 54 41 [2,] 68 22 39

Re: [R] Boundary correction for kernel density estimation

2010-10-11 Thread Greg Snow
Look at the logspline package. It uses a different method from what density does, but it can take boundaries into account. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] how can i do anova

2010-10-11 Thread Liviu Andronic
Hello On Mon, Oct 11, 2010 at 5:33 PM, Mauluda Akhtar maulud...@gmail.com wrote:  Hi, I've a table like the following. I want to do ANOVA. Could you please tell me how can i do it. I want to show whether the elements (3 for each column) of a column are significantly different or not. Just

[R] multiple comparison correction

2010-10-11 Thread Jake Kami
dear list, i just found this post in the archive: On 23-Apr-05 Bill.Venables at csiro.au https://stat.ethz.ch/mailman/listinfo/r-help wrote: :* -Original Message-*:* From: r-help-bounces at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-help *:*

[R] Is there a regression surface demo?

2010-10-11 Thread Joshua Wiley
Hi All, Does anyone know of a function to plot a regression surface for two predictors? RSiteSearch()s and findFn()s have not turned up what I was looking for. I was thinking something along the lines of: http://mallit.fr.umn.edu/fr5218/reg_refresh/images/fig9.gif I like the rgl package

[R] Question

2010-10-11 Thread Margaretta 2014
Hello. I would be very grateful if you could help me in using R. I need R commands of pseudo random value and qvazi (quazi) random value. I found commands qnorm and pnorm, but I am not sure that this is the same as I am looking for. Looking forward to hearing from you. Thank you

[R] running own function in Java?

2010-10-11 Thread lord12
How do I run my own unique function in eclipse? -- View this message in context: http://r.789695.n4.nabble.com/running-own-function-in-Java-tp2990420p2990420.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] LDA fuction

2010-10-11 Thread vascomc
Hello, I wonder what analysis i have to use to evaluate which environmental variables most closely related to the grouping that I have. I has 38 streams are grouped based on eight environmental variables, but I wonder how these variables relate to these groups. Example.: PH, dissolved oxygen

[R] grep triggering error on unicode character

2010-10-11 Thread Dennis Fisher
Colleagues, [R 2.11; OS X] I am processing a file on the fly that contains the following text: XXXáá [email clients may display this differently -- the string is three X's followed by two instances of the letter a with an acute accent] I read the file with: X -

[R] dot plot by group

2010-10-11 Thread casperyc
Hi all, I have the folloing data table %% TypeBATCH RESPONSE SHORT A 22 SHORT A 3 SHORT A 16 SHORT A 14 SHORT A 8 SHORT A 27 SHORT A 11 SHORT A 17 SHORT B 12 SHORT B 17 SHORT B 11 SHORT

Re: [R] LDA fuction

2010-10-11 Thread Gavin Simpson
On Mon, 2010-10-11 at 10:18 -0700, vascomc wrote: Hello, I wonder what analysis i have to use to evaluate which environmental variables most closely related to the grouping that I have. I has 38 streams are grouped based on eight environmental variables, but I wonder how these variables

Re: [R] dot plot by group

2010-10-11 Thread Phil Spector
Casper - I think you want dotplot(BATCH~RESPONSE,data=d,subset=Type=='SHORT') or dotplot(BATCH~RESPONSE,data=subset(d,Type=='SHORT')) - Phil Spector Statistical Computing Facility

Re: [R] Is there a regression surface demo?

2010-10-11 Thread G. Jay Kerns
Dear Josh, On Mon, Oct 11, 2010 at 3:15 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: Hi All, Does anyone know of a function to plot a regression surface for two predictors?  RSiteSearch()s and findFn()s have not turned up what I was looking for.  I was thinking something along the lines

Re: [R] dot plot by group

2010-10-11 Thread casperyc
Hi Spector, Yes, that is exactly what I was aiming for. Thanks. Casper -- View this message in context: http://r.789695.n4.nabble.com/dot-plot-by-group-tp2990469p2990495.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] dot plot by group

2010-10-11 Thread casperyc
And now I just wonder why the ' bty='n' ' won't work? I did dotplot(BATCH~RESPONSE,data=d,subset=Type=='SHORT',bty='n') and tried other bty parameters, none is working Casper -- View this message in context: http://r.789695.n4.nabble.com/dot-plot-by-group-tp2990469p2990500.html Sent from

Re: [R] grep triggering error on unicode character

2010-10-11 Thread Duncan Murdoch
On 11/10/2010 3:36 PM, Dennis Fisher wrote: Colleagues, [R 2.11; OS X] I am processing a file on the fly that contains the following text: XXXáá [email clients may display this differently -- the string is three X's followed by two instances of the letter a with an acute accent] I

Re: [R] how can i do anova

2010-10-11 Thread Mauluda Akhtar
Dear Andrew Miles, Thanks a lot. Moon On Mon, Oct 11, 2010 at 9:54 PM, Andrew Miles rstuff.mi...@gmail.comwrote: Type ?anova on your R command line for the basic function, and links to related functions. Also, try a google search of something like doing anova in R and you should find

Re: [R] how can i do anova

2010-10-11 Thread Mauluda Akhtar
Dear Liviu, Thanks a lot. moon On Tue, Oct 12, 2010 at 1:02 AM, Liviu Andronic landronim...@gmail.comwrote: Hello On Mon, Oct 11, 2010 at 5:33 PM, Mauluda Akhtar maulud...@gmail.com wrote: Hi, I've a table like the following. I want to do ANOVA. Could you please tell me how can i do

[R] importing numeric types via sqlQuery

2010-10-11 Thread E C
Hi everyone, I am using the sqlQuery function (in RODBC library) to import data from a database into R. My table (called temp) in the database looks like this: categorynumabc 54469517.307692307692def36428860.230769230769 I used the following R code to pull data into R:data

[R] Spencer 15-point weighted moving average

2010-10-11 Thread Sam Thomas
I am trying to apply Spencer's 15-point weighted moving average filter to the time series shampoo, using the filter command, but I am not sure if I am using the filter correctly: library(fma) sma15 - c(-.009, -.019, -.016, .009, .066, .144, .209, .231, .209,

Re: [R] importing numeric types via sqlQuery

2010-10-11 Thread jim holtman
I would assume that the digitis are not being chopped off. It is just that R will typically print data to 7 significant digits: x - 54469517.307692307692 x [1] 54469517 options(digits=20) x [1] 54469517.3076923 Your data it there and you can set 'options' to show it if you want to. Also

Re: [R] Is there a regression surface demo?

2010-10-11 Thread Ista Zahn
There is also wireframe() in lattice and bplot in rms. -Ista On Mon, Oct 11, 2010 at 3:49 PM, G. Jay Kerns gke...@ysu.edu wrote: Dear Josh, On Mon, Oct 11, 2010 at 3:15 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: Hi All, Does anyone know of a function to plot a regression surface for

Re: [R] dot plot by group

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 3:55 PM, casperyc wrote: And now I just wonder why the ' bty='n' ' won't work? Left open is the answer to the question ... work ... how? Because dotplot is a lattice function? ... and bty is a base graphic parameter? You could try to give par.settings a list that

[R] topicmodels error

2010-10-11 Thread Dario Solari
I try to fit a LDA model to a TermDocumentMatrix with the topicmodels package... but R says: Error in LDA(TDM, k = k, method = Gibbs, control = list(seed = SEED, : x is of class “TermDocumentMatrix”“simple_triplet_matrix” class(TDM) [1] TermDocumentMatrixsimple_triplet_matrix I try to

Re: [R] topicmodels error

2010-10-11 Thread David Winsemius
I don't know the answer, but let me point out that: DocumentTermMatrix %in% class(TDM) should return FALSE since: DocumentTermMatrix != TermDocumentMatrix -- David. On Oct 11, 2010, at 4:45 PM, Dario Solari wrote: I try to fit a LDA model to a TermDocumentMatrix with the topicmodels

Re: [R] importing numeric types via sqlQuery

2010-10-11 Thread E C
Thanks for the quick reply! Hmm, I did not know about the options default. However, after I set options, it seems like it's still not displaying correctly. I've tried an even simpler example table with only 6 digits (much fewer than 20): categorynum\nabc123.456\ndef

Re: [R] topicmodels error

2010-10-11 Thread Dario Solari
Excuse me... when i re-read my e-mail i saw my mistake! I use a TermDocumentMatrix instead of a DocumentTermMatrix... On 11 Ott, 22:45, Dario Solari dario.sol...@gmail.com wrote: I try to fit a LDA model to a TermDocumentMatrix with the topicmodels package... but R says: Error in LDA(TDM, k

Re: [R] Is there a regression surface demo?

2010-10-11 Thread Joshua Wiley
Thanks for everyone's responses. Just to follow up, here is a working version of my original. The code is not pretty, but it functions. Assuming you have the 'rgl' package installed and have sourced this function, here are some examples: RegSurfaceDemo(mpg ~ vs + wt, data = mtcars)

[R] support vector machine for right censored data

2010-10-11 Thread SUBIRANA CACHINERO, ISAAC
Hi, Does anybody know how to fit a support vector machine regression with right censored time-to-event response to select the best subset among several predictor variables? Thanks in advance. __ R-help@r-project.org mailing list

[R] Slow reading multiple tick data files into list of dataframes

2010-10-11 Thread rivercode
Hi, I am trying to find the best way to read 85 tick data files of format: head(nbbo) 1 bid CON 09:30:00.72209:30:00.722 32.71 98 2 ask CON 09:30:00.78209:30:00.810 33.14 300 3 ask CON 09:30:00.80909:30:00.810 33.14 414 4 bid CON 09:30:00.78309:30:00.810 33.06

Re: [R] Slow reading multiple tick data files into list of dataframes

2010-10-11 Thread Gabor Grothendieck
On Mon, Oct 11, 2010 at 5:39 PM, rivercode aqua...@gmail.com wrote: Hi, I am trying to find the best way to read 85 tick data files of format: head(nbbo) 1 bid  CON  09:30:00.722    09:30:00.722  32.71   98 2 ask  CON  09:30:00.782    09:30:00.810  33.14  300 3 ask  CON  09:30:00.809    

Re: [R] Slow reading multiple tick data files into list of dataframes

2010-10-11 Thread Mike Marchywka
Date: Mon, 11 Oct 2010 14:39:54 -0700 From: aqua...@gmail.com To: r-help@r-project.org Subject: [R] Slow reading multiple tick data files into list of dataframes [...] Is there a better/quicker or more R way of doing this ? While there may be an

[R] compare histograms

2010-10-11 Thread solafah bh
Hello How to compare  two statistical histograms? How i can know if these histograms are equivalent or not??   Regards [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Trouble accessing cov function from stats library

2010-10-11 Thread Steve Taylor
Note that R is case sensitive, so cov and Cov are different. From: Barth B. Riley bbri...@chestnut.org To:r-help@r-project.org r-help@r-project.org Date: 12/Oct/2010 3:31a Subject: [R] Trouble accessing cov function from stats library Dear all I am trying to use the cov function in the stats

Re: [R] MATLAB vrs. R

2010-10-11 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Craig O'Connell Sent: Monday, October 11, 2010 8:10 AM To: alain.guil...@uclouvain.be Cc: r-help@r-project.org; pda...@gmail.com Subject: Re: [R] MATLAB vrs. R alain,

[R] Revolutions Blog: September Roundup

2010-10-11 Thread David Smith
I write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of September:

Re: [R] MATLAB vrs. R

2010-10-11 Thread Daniel Nordlund
I apologize for the noise. I didn't clean up the code enough. See below. snip Craig, I haven't seen an answer to this yet, so let me jump in. You seem to have some stuff still leftover from MATLAB. Here is some cleaned up code that produces the result you expect. I don't think the

[R] running R script on linux server

2010-10-11 Thread Lorenzo Cattarino
Hi R-users, I have a problem running my R code on a Linux cluster. What I did was write a .pbs file to instruct the cluster on what to do and how: #!/bin/sh #PBS -m ae #PBS -M uqlca...@uq.edu.au #PBS -A uq-CSER #PBS -N job1_lollo #PBS -l select=1:ncpus=1:NodeType=fast:mem=8GB

[R] (no subject)

2010-10-11 Thread Tim Clark
Dear List, I am trying to plot date vs. time, but am having problems getting my y-axis labels how I want them.  When left on its own R plots time at 6 hour intervals from 03:00 to 23:00.  I am wanting 6 hour intervals from 2:00 to 22:00.  I realize yaxp doesn't work in plot(), so I am trying

[R] expression() problem !

2010-10-11 Thread michel.mas
Hello everyone ... I have a problem when I try to mix expressions using the function expression () with variables coming from my code. Has anyone faced such a problem? -- View this message in context: http://r.789695.n4.nabble.com/expression-problem-tp2990891p2990891.html Sent from the R help

Re: [R] expression() problem !

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 7:27 PM, michel.mas wrote: Hello everyone ... I have a problem when I try to mix expressions using the function expression () with variables coming from my code. Has anyone faced such a problem? Many times: ?bquote # instead of expression -- View this message

Re: [R] (no subject)

2010-10-11 Thread David Winsemius
Two things I see. First is that par needs to be called _before_ the plot (although its effects will persist if you need to keep hacking away) and the second is that yaxp is expecting numeric arguments (which you are offering) but in your case these will need to be the numeric values in

Re: [R] (no subject)

2010-10-11 Thread jim holtman
use 'axis' with 'at=' and 'labels=' to put your own labels on the axis. Have to guess at your data since you did not provide a reproducible example: x - seq(as.POSIXct('2010-10-11 00:00'), as.POSIXct('2010-10-12 00:00'), length = 20) plot(x, x, type = 'o', yaxt = 'n') axis.POSIXct(2, at =

Re: [R] Slow reading multiple tick data files into list of dataframes

2010-10-11 Thread jim holtman
For 100,000 rows, it took about 2 seconds to read it in on my system: system.time(x - read.table('/recv/test.txt', as.is=TRUE)) user system elapsed 1.920.082.08 str(x) 'data.frame': 196588 obs. of 7 variables: $ V1: int 1 2 3 4 1 2 3 1 2 3 ... $ V2: chr bid ask ask bid ...

Re: [R] function using values separated by a comma

2010-10-11 Thread burgundy
Hi Just used this function on my real data - several enormous files (80 rows by 200 columns...) and it worked perfectly! Thanks again for your help, saved me a lot of time! A last quick query, I have several other similar problems to deal with in my data - do you know a useful book or

Re: [R] importing numeric types via sqlQuery

2010-10-11 Thread jim holtman
Must be your datrabase interface: require(sqldf) # don't have MySql, but will use sqlite as example myData - data.frame(cat = c('abc', 'def'), num=c(123.456, 7890.1234)) myData cat num 1 abc 123.456 2 def 7890.123 sqldf('select cat, num from myData') # now make sql request cat

Re: [R] Time OffSet From GMT - Losing it

2010-10-11 Thread rivercode
That is embarrassingthanks for pointing out my mistake. Chris -- View this message in context: http://r.789695.n4.nabble.com/Time-OffSet-From-GMT-Losing-it-tp2968940p2990987.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] MATLAB vrs. R

2010-10-11 Thread Craig O'Connell
Daniel, That's it! Thanks. Your help is very much appreciated. I'm hoping to nail down the code conversion from MATLAB to R, but it seems to be a bit more difficult that I had anticipated. Craig From: djnordl...@frontier.com To: djnordl...@frontier.com; r-help@r-project.org

[R] Create DataSet with MCAR type

2010-10-11 Thread Jumlong Vongprasert
Dear all I want to create dataset with MCAR type from my dataset. I have my dataset with 100 records, and I want to create dataset from this dataset to missing 5 records. How I can do it. THX Jumlong -- Jumlong Vongprasert Institute of Research and Development Ubon Ratchathani Rajabhat

[R] Comparison of two files with multiple arguments

2010-10-11 Thread burgundy
Hello, I have an example file which can be generated using: dat - read.table(tc - textConnection( 'T T,G G T C NA G G A,T A A NA'), sep=) I also have a reference file with the same number of rows, for example: G C A I would like to transform the file to numerical values using the following

Re: [R] Create DataSet with MCAR type

2010-10-11 Thread Michael Bedward
Hello Jumlong, I'm not sure whether by '100 records' you mean a vector of 100 values or a matrix / data.frame of 100 rows. For a vector or matrix X you can do this: X[ sample( length(X), 5 ) ] - NA For a data.frame X you could do this: X[ sample( nrow(X), 5 ), sample( ncol(X), 5) ] - NA Hope

Re: [R] Comparison of two files with multiple arguments

2010-10-11 Thread Michael Bedward
Hello, Here's one way to do it. It assumes dat has character values, not factors. dat2 - matrix(0, nrow(dat), ncol(dat)) dat2[ is.na(dat) ] - NA dat2[ apply(dat, 2, function(x) grepl(,, x)) ] - 2 dat2[ apply(dat, 2, function(x) x != ref) ] - 1 Michael On 12 October 2010 13:24, burgundy

[R] Help with function writing

2010-10-11 Thread Tim Elwell-Sutton
Hello all I have what seems like a simple question but have not been able to find an answer on the forum. I'm trying to define a function which involves regression models and a large number of covariates. I would like the function to accept any number of covariates and, ideally, I would like to

Re: [R] Running R on a server

2010-10-11 Thread jthetzel
Sachin, I apologize if I'm over-simplifying your question. I mostly run R on an Ubuntu server via a Windows laptop. I log in to the remote server via SSH (via PuTTY on Windows), and then open an interactive R session through the usual ways (typing 'R' at the Linux command line). When creating

[R] Extracting data subset for plot

2010-10-11 Thread elaine kuo
Dear list, I want to make a plot based on the following information, using the command plot. variable A for x axis : temperature (range: -20 degrees to 40 degree) variable B for y axis : altitude (range: 50 m to 2500 m ) The data below 0 degree of X variable wants to be erased tentatively.

Re: [R] Help with function writing

2010-10-11 Thread Michael Bedward
Hello Tim, This function will do it where the covariates are provided as separate arguments. It would be easy to modify this to handle a list too. function(outcome, ...) { arg.names - as.character(match.call())[-1] nargs - length(arg.names) f - as.formula(paste(arg.names[1], ~,

  1   2   >