Re: [R] lapack routines cannot be loaded [Help request]

2012-11-23 Thread Prof Brian Ripley
On 22/11/2012 11:23, Manca Marco (PATH) wrote: Dear BioConductor and R fellow users I apologize in advance for double posting, but I am not sure which list would actually be best fit for this message. The list relevant to the installation of R you used. Was this a binary installation?: if

Re: [R] Optimizing nested function with nlminb()

2012-11-23 Thread Berend Hasselman
On 22-11-2012, at 22:55, Дмитрий Островский wrote: I am trying to optimize custom likelyhood with nlminb() Arguments h and f are meant to be fixed. example.R: compute.hyper.log.likelyhood - function(a, h, f) { a1 - a[1] a2 - a[2] l - 0.0 for (j in 1:length(f)) { l - l +

Re: [R] Barplot with lines

2012-11-23 Thread Jim Lemon
On 11/23/2012 06:33 PM, Ripples wrote: Hi, I'm trying to plot stacked barplot with lines on it. Here is the data. emp days val1 val2 score 1 21 1 0 1200 2 35 1 1 na 3 42 na na 3000 4 53 2 1 2100 5 64 1 0 na 6 73 na na 1400 My X-axis is days. I'm looking to plot val1,val2 as stacked bars and

Re: [R] What is the . in formula ~. syntax?

2012-11-23 Thread Michael Weylandt
On Nov 23, 2012, at 4:26 AM, Brian Feeny bfe...@mac.com wrote: I know if I have a dataframe with columns y, x1, x2 and I wish to have y as my y value and x1 and x2 as x values I can do: y ~ x1 + x2 or y ~. but can someone explain what . actually is or what its transposed into?

Re: [R] What is the . in formula ~. syntax?

2012-11-23 Thread Brian Feeny
Thank you! I searched in the manual, but I did not see where this is mentioned, I looked under operators and in some of the formula documentation. Brian On Nov 23, 2012, at 3:15 AM, Michael Weylandt michael.weyla...@gmail.com wrote: On Nov 23, 2012, at 4:26 AM, Brian Feeny

Re: [R] [lattice] Increase distance between tick labels and ticks in wireframe plot (pad)

2012-11-23 Thread Felix Schönbrodt
Thanks - that's the solution! Felix Am 23.11.2012 um 03:03 schrieb Peter Ehlers ehl...@ucalgary.ca: On 2012-11-22 01:16, Felix Schönbrodt wrote: Hello, I try to increase the distance between tick labels and ticks in a lattice wireframe plot. Here's a minimal example: ## Minimal example

Re: [R] Factor function for coded numerical values

2012-11-23 Thread Milan Bouchet-Valat
Le jeudi 22 novembre 2012 à 13:12 -0800, maths123 a écrit : I have s data set where 2 of the columns give the coded versions of the factors A and B. Factor A is coded with 1, 2, 3. Factor B is coded with 1,2. How do use the factor function to convert these variables into factors, and also

Re: [R] Sentiment analysis in R

2012-11-23 Thread Milan Bouchet-Valat
Le vendredi 23 novembre 2012 à 10:47 +0530, sushobhan just saysI QUIT a écrit : Hi All, I am trying to perform sentiment analysis using R with the help of the library(sentiment). I am using the function classify_emotions(sentiment). It is basically selecting a particular word

Re: [R] What is the . in formula ~. syntax?

2012-11-23 Thread Prof Brian Ripley
On 23/11/2012 08:16, Brian Feeny wrote: Thank you! I searched in the manual, but I did not see where this is mentioned, I looked under operators and in some of the formula documentation. It *is* documented on the help page for formula (and it is not an operator, so should not be in the

Re: [R] printing difftime summary

2012-11-23 Thread R. Michael Weylandt
On Thu, Nov 22, 2012 at 5:49 PM, Sam Steingold s...@gnu.org wrote: * R. Michael Weylandt zvpunry.jrlyn...@tznvy.pbz [2012-11-22 12:11:55 +]: I now think that what I want is --8---cut here---start-8--- difftime.summary - function (v) { s -

Re: [R] Constant (= wrong) historical quotes via get.hist.quote() from yahoo.finance

2012-11-23 Thread Achim Zeileis
On Fri, 23 Nov 2012, Marius Hofert wrote: Dear expeRts, I would like to download a time series of historical data from the ticker with symbol ROG.VX. Interestingly, I obtain constant values (138.3 for each day in the chosen period) although the yahoo.finance website tells me that the time

Re: [R] help in M-estimator by R

2012-11-23 Thread S Ellison
-Original Message- i have to do something in robust regression by R programm , and i have some problems as following: *the first :* Afte loading MAS, type 'hubers' (without brackets) and look at the code. That should give you a clue. new psi ( psi.a=r/(1+(r/k)^2)) ,k=1.345 and

[R] column name prefix 'x' after data import via read.delim

2012-11-23 Thread e-letter
Readers, The function 'read.delim' was used to import data into R: columnnamea columnnameb columnnamec 1 2 3 2 3 4 3 4 5 After import, the column names were: X.columnnamea columnnameb columnnamec Why did this occur? -- r2151 __

Re: [R] column name prefix 'x' after data import via read.delim

2012-11-23 Thread Gerrit Eichner
Hello, e-letter, check ?read.delim and look for the argument check.names and from there you'll should end up reading ?make.names Hth -- Gerrit On Fri, 23 Nov 2012, e-letter wrote: Readers, The function 'read.delim' was used to import data into R: columnnamea columnnameb

Re: [R] Odp: Object Browser

2012-11-23 Thread Liviu Andronic
On Fri, Nov 23, 2012 at 6:44 AM, wampeh wam...@gmail.com wrote: How do I get gvarbrowser to display only data.frame named, say atab1 or atab2 or atab*? Also, how do I turn off the selection pull down box? Two remarks. If you hope to get an answer it would be a good idea to CC John Verzani,

Re: [R] Constant (= wrong) historical quotes via get.hist.quote() from yahoo.finance

2012-11-23 Thread Marius Hofert
Dear Achim, Thanks a lot for your quick help. Indeed, I did not realize that the Download to Spreadsheet gives the wrong result, so it's really a Yahoo! Finance issue (too bad, an R issue would have been easier to fix :-) ). Thanks again, Marius Achim Zeileis achim.zeil...@uibk.ac.at writes:

Re: [R] Adding a function with default parameters into the Rcmdr menu

2012-11-23 Thread Milan Bouchet-Valat
Le vendredi 23 novembre 2012 à 03:17 +0100, vincent guyader a écrit : Hi everyone, I made some tests with Rcmdr, to add a function with default parameters : For example (very simple): myfunction-function(var=314){ print(hello) print(var) } if I run myfunction() directly i see :

Re: [R] SEM raw moment matrix

2012-11-23 Thread John Fox
Dear Maya, sem() computes the fit statistics that I know how to compute for a model fit to a raw moment matrix. If you know how to compute the others (and if they're defined), then you could do that youself using the object returned by sem(). I'm not sure why you want the likelihood under the

[R] invalid colour name 'rgb(1.000,0,0)' error

2012-11-23 Thread Manish Gupta
Hi, I m working on latex and R and i need to dynamically generate colors. r-paste(rgb(1.000,,0,,,0,),sep=) # i m generating dynamically by paste command cars - c(1, 3, 6, 4, 9) plot(cars, type=o, col=r) *Error in plot.xy(xy, type, ...) : invalid colour name

[R] Failed to install RMySQL,help!

2012-11-23 Thread li1127217ye
I had installed R and MySQL ,then I input : install.packages('RMySQL',type='source') show the message below, Why? Why shows ERROR: configuration failed for package 'RMySQL'? 试开URL’http://mirrors.xmu.edu.cn/CRAN/src/contrib/RMySQL_0.9-3.tar.gz' Content type 'application/x-gzip' length 165363

[R] error in IF condition with factor evaluation

2012-11-23 Thread edoardo baldoni
Cam anyone tell me why the condition x[i] == DISCONECTED looks like producing an NA instead of TRUE/FALSE I would like to rename DISCONNECTED those factors inside the variable dataset$STATUS.x that are named DISCONECTED thank you summary(dataset$STATUS.x) ACTIVE DISCONECTED PENDING

Re: [R] ROC Curve: negative AUC

2012-11-23 Thread brunosm
Thanks, Do you know how to correct it? Cheers, Bruno -- View this message in context: http://r.789695.n4.nabble.com/ROC-Curve-negative-AUC-tp4650469p4650530.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] Function storing error messages in 32 bit R-2.15.2 version

2012-11-23 Thread Paarkhi
The data we used for testing is pasted below - http://r.789695.n4.nabble.com/file/n4650532/testfile.png Note that our objective is to analyse a dataset with 60 items and about 25,000 candidates but we used the above to test if we get desired result and the two versions gave different results.

Re: [R] Function storing error messages in 32 bit R-2.15.2 version

2012-11-23 Thread Paarkhi
I am working with Maulik on this. We installed a 64-bit version of R 2.15.1 now but the ltm package is under version 2.15.2 The same problem is occurring even with this version. -- View this message in context:

Re: [R] error in IF condition with factor evaluation

2012-11-23 Thread Eik Vettorazzi
Hi Edoardo, there is a difference between comparisons and assignments, both semantically as well as in R syntax: == vs = or -, latter being more obvious an assignment. This is the source of your error. But to change the labels of a factor object, it is easier to do sth like

Re: [R] error in IF condition with factor evaluation

2012-11-23 Thread Rui Barradas
Hello, Try if (!is.na(x[i]) x[i] == DISCONECTED) Hope this helps, Rui Barradas Em 23-11-2012 09:42, edoardo baldoni escreveu: Cam anyone tell me why the condition x[i] == DISCONECTED looks like producing an NA instead of TRUE/FALSE I would like to rename DISCONNECTED those factors inside

Re: [R] Summary statistics for matrix columns

2012-11-23 Thread Pete Brecknock
frespider wrote Hi, it is possible. but don't you think it will slow the code if you convert to data.frame? Thanks Date: Thu, 22 Nov 2012 18:31:35 -0800 From: ml-node+s789695n4650500h51@.nabble To: frespider@ Subject: RE: Summary statistics for matrix columns

Re: [R] invalid colour name 'rgb(1.000,0,0)' error

2012-11-23 Thread Rui Barradas
Hello, Why paste? rgb() is a function, you need its return value, not a character string. r - rgb(1.000,0,0) And the rest plots a graph in red. Hope this helps, Rui Barradas Em 23-11-2012 09:06, Manish Gupta escreveu: Hi, I m working on latex and R and i need to dynamically generate

Re: [R] error in IF condition with factor evaluation

2012-11-23 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rui Barradas Sent: Friday, November 23, 2012 2:37 PM To: edoardo baldoni Cc: R-help@r-project.org Subject: Re: [R] error in IF condition with factor evaluation Hello,

Re: [R] Using cumsum with 'group by' ?

2012-11-23 Thread peter dalgaard
On Nov 23, 2012, at 12:04 , TheRealJimShady wrote: Hi Arun everyone, Thank you very much for your helpful suggestions. I've been working through them, but have realised that my data is a little more complicated than I said and that the solutions you've kindly provided don't work. The

Re: [R] Failed to install RMySQL,help!

2012-11-23 Thread Gabor Grothendieck
On Fri, Nov 23, 2012 at 3:29 AM, li1127217ye li112721...@163.com wrote: I had installed R and MySQL ,then I input : install.packages('RMySQL',type='source') show the message below, Why? Why shows ERROR: configuration failed for package 'RMySQL'?

[R] Joining two files

2012-11-23 Thread Virgile Capo-Chichi
Hello all, I al trying to join (ADD FILES in SPSS) two files using the rbind() function. However, with rbind() R does not behave the same way as SPSS. I mean, it just concatenates the two blocs with no consideration for same variables if these are not in the same position in the two files. Anyone

Re: [R] Joining two files

2012-11-23 Thread jim holtman
Have you tried 'merge'? You did not provide any sample data (use 'dput' if you do) so that we could show a possible solution. On Fri, Nov 23, 2012 at 9:56 AM, Virgile Capo-Chichi vcapochi...@gmail.com wrote: Hello all, I al trying to join (ADD FILES in SPSS) two files using the rbind()

Re: [R] Joining two files

2012-11-23 Thread Virgile Capo-Chichi
Hi Jim, I did not try merge because I thought it only adds variables instead of cases. Below is what I am trying to do. When I joined data1 and data2, I was was expecting three variables: r1, r2 and r3 with r2 and r3 presenting missing values where they did not exist in the first place. V

Re: [R] Using cumsum with 'group by' ?

2012-11-23 Thread Pete Brecknock
TheRealJimShady wrote Hi Peter, Yes, I did miss an e from the first 'not' in the brackets at the end of the message, sorry. Thanks for that code, but when I use it, it creates a new column called csum which simply contains the values of the variable x . i.e. it just duplicates the values

Re: [R] Joining two files

2012-11-23 Thread jim holtman
You did not specify what you were expecting as output. Here is one way of using 'merge', but I am not sure if this is what you were after: r1-c(1,1,2,3) r2-c(2,1,2,2) r3-c(2,1,4,1) data1-data.frame(r1,r2) data2-data.frame(r1,r3) data1 r1 r2 1 1 2 2 1 1 3 2 2 4 3 2 data2 r1 r3

Re: [R] Summary statistics for matrix columns

2012-11-23 Thread Fares Said
Thank you all Sent from my iPhone On 2012-11-23, at 10:19, arun smartpink...@yahoo.com wrote: HI, You are right. It is slower when compared to Pete's solution: set.seed(125) x - matrix(sample(1:80),nrow=1000) colnames(x)- paste(Col,1:ncol(x),sep=) system.time({

[R] Student-t distributed random value generation within a confidence interval?

2012-11-23 Thread Thomas Schu
Dear R-users! I´m faced with following problem: Given is a sample where the sample size is 12, the sample mean is 30, and standard deviation is 4.1. Based on a Student-t distribution i´d like to simulate randomly 500 possible mean values within a two-tailed 95% confidence interval. Calculation of

Re: [R] Joining two files

2012-11-23 Thread Rui Barradas
Hello, I don't believe there's an R function that does what you want, but you can write one. myrbind - function(x, y){ cx - colnames(x) cy - colnames(y) if(is.null(cx) || is.null(cy)){ result - rbind(x, y) }else{ ox - order(cx) oy - order(cy)

Re: [R] Joining two files

2012-11-23 Thread Virgile Capo-Chichi
Thanks Jim for your help. Your results are not what I wanted. I would like to see something like the matrix below. This is what I would get if I used the ADD Files command in SPSS. V r1 r2 r3 1 2 NA 1 1 NA 2 2 NA 3 2 NA 1 NA 2 1 NA 1 2 NA 4 3 NA 1 2012/11/23 jim holtman

Re: [R] Adding a function with default parameters into the Rcmdr menu

2012-11-23 Thread vincent guyader
I will try this. thank you. 2012/11/23 Milan Bouchet-Valat nalimi...@club.fr Le vendredi 23 novembre 2012 à 03:17 +0100, vincent guyader a écrit : Hi everyone, I made some tests with Rcmdr, to add a function with default parameters : For example (very simple):

[R] read.csv.sql() to select from a large csv file

2012-11-23 Thread Juliane Struve
Dear list,   Dear list, I am using read.csv.sql() from the sqldf package to read individual-based data from a csv file that is too large for R. My original file contains a column called “ID” that identifies the individual. I would like to read in data for only one individual at a time, for

Re: [R] Function storing error messages in 32 bit R-2.15.2 version

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 2:21 AM, Paarkhi wrote: I am working with Maulik on this. We installed a 64-bit version of R 2.15.1 now but the ltm package is under version 2.15.2 The same problem is occurring even with this version. You and Maulik are posting messages without context and without the

Re: [R] Joining two files

2012-11-23 Thread Anthony Damico
library(reshape) ?rbind.fill On Fri, Nov 23, 2012 at 10:57 AM, Virgile Capo-Chichi vcapochi...@gmail.com wrote: Thanks Jim for your help. Your results are not what I wanted. I would like to see something like the matrix below. This is what I would get if I used the ADD Files command in

Re: [R] read.csv.sql() to select from a large csv file

2012-11-23 Thread Gabor Grothendieck
On Fri, Nov 23, 2012 at 11:12 AM, Juliane Struve juliane_str...@yahoo.co.uk wrote: Dear list, Dear list, I am using read.csv.sql() from the sqldf package to read individual-based data from a csv file that is too large for R. My original file contains a column called “ID” that identifies the

Re: [R] read.csv.sql() to select from a large csv file

2012-11-23 Thread Anthony Damico
you need to construct the character string. here's what you want to give to the sql argument -- paste( 'select * from file where ID = ' , Name ) so try Name - Bobby read.csv.sql(filename,sql = paste( 'select * from file where ID = ' , Name ) ) On Fri, Nov 23, 2012 at 11:12 AM, Juliane Struve

Re: [R] Joining two files

2012-11-23 Thread arun
Hi, Try this: r1-c(1,1,2,3)  r2-c(2,1,2,2)  r3-c(2,1,4,1)  data1-data.frame(r1,r2)  data2-data.frame(r1,r3) data1$r3-NA  data2$r2-NA  merge(data1,data2,all=TRUE,sort=FALSE) #  r1 r2 r3 #1  1  2 NA #2  1  1 NA #3  2  2 NA #4  3  2 NA #5  1 NA  2 #6  1 NA  1 #7  2 NA  4 #8  3 NA  1 A.K. -

Re: [R] read.csv.sql() to select from a large csv file

2012-11-23 Thread Rui Barradas
Hello, Try forming the sql statement with paste(). Name - Bobby sqlstatement - paste(select * from file where ID = ', Name, ', sep = ) read.csv.sql(filename, sql = sqlstatement) Note the opening and closing quotes around the name. Hope this helps, Rui Barradas Em 23-11-2012 16:12, Juliane

Re: [R] Joining two files

2012-11-23 Thread Virgile Capo-Chichi
All, thanks so much for your suggestions. both rbind.fill and creating NA where necessary worked. I think rbind.fill is much easier and quite elegant. Have a great weekend, V 2012/11/23 arun smartpink...@yahoo.com Hi, Try this: r1-c(1,1,2,3) r2-c(2,1,2,2) r3-c(2,1,4,1)

Re: [R] Joining two files

2012-11-23 Thread David L Carlson
Arun's solution can be modified slightly to be more general: r1-c(1,1,2,3) r2-c(2,1,2,2) r3-c(2,1,4,1) r4-c(3,4,1,2) r5-c(3,1,2,2) data1-data.frame(r1,r2,r4) data2-data.frame(r1,r3,r5) data1[,setdiff(names(data2), names(data1))] - NA data2[,setdiff(names(data1), names(data2))] - NA

Re: [R] Joining two files

2012-11-23 Thread Rui Barradas
Hello, So you need a function that can rbind and also return the total unique columns. It's a bit more complicated but I think this does what you want. ADD - function(x, y){ cx - colnames(x) cy - colnames(y) if(is.null(cx) || is.null(cy)){ d - length(cx) - length(cy)

[R] r cloud computing

2012-11-23 Thread ya
Dear list, I am trying to find some place on internet for R cloud computing.I have some questions about it. I followed this webpage: http://www.r-bloggers.com/crdata-org-to-shut-down/ trying to gain some knowledge about where I can find free cloud computing service for R. It looks like

Re: [R] Barplot with lines

2012-11-23 Thread Greg Snow
Look at the updateusr function in the TeachingDemos package. One of the examples shows adding lines to a barplot. On Fri, Nov 23, 2012 at 12:33 AM, Ripples 9ripp...@gmail.com wrote: Hi, I'm trying to plot stacked barplot with lines on it. Here is the data. emp days val1 val2 score 1 21

Re: [R] Student-t distributed random value generation within a confidence interval?

2012-11-23 Thread Ben Bolker
Thomas Schu th.schumann at gmx.de writes: I´m faced with following problem: Given is a sample where the sample size is 12, the sample mean is 30, and standard deviation is 4.1. Based on a Student-t distribution i´d like to simulate randomly 500 possible mean values within a two-tailed 95%

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-23 Thread brunosm
Use , instead of ; It should work now... Regards, Bruno -- View this message in context: http://r.789695.n4.nabble.com/Why-do-i-get-Error-unexpected-input-in-A-lm-GandW-Authocracy-Data-tp4650559p4650566.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Barplot with lines

2012-11-23 Thread skanap
Hi Jim, Thank you for the reply. But, when I use Barpos I get this error. plot(mydata$score,barpos) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ I need all the points in x-axis that are in 'days' column. If I'm selecting only points in val1 and val2 I'm missing

Re: [R] Using cumsum with 'group by' ?

2012-11-23 Thread arun
HI, If that is the case, this should work: dat1-read.table(text= id,  x,  date 1,  5,  2012-06-05 12:01 1,  10,    2012-06-05 12:02 1,  45,    2012-06-05 12:03 2,  5,  2012-06-05 12:01 2,  3,  2012-06-05 12:03

[R] R lapack routines cannot be loaded

2012-11-23 Thread arysar
I usually ran different statistical analysis in R with routines that use lapack like gam() lm(), etc but after several updates of libraries the following error appears: library(mgcv) This is mgcv 1.7-22. For overview type 'help(mgcv-package)'. model - with(chlaR,gam(ClorMAX ~ s(DegDay_NM)))

Re: [R] Summary statistics for matrix columns

2012-11-23 Thread arun
HI, You are right. It is slower when compared to Pete's solution: set.seed(125) x - matrix(sample(1:80),nrow=1000) colnames(x)- paste(Col,1:ncol(x),sep=) system.time({ res-sapply(data.frame(x),function(x) c(summary(x),sd=sd(x),IQR=IQR(x)))  res1-as.matrix(res) res2-res1[c(1:4,7,5,8,6),] }) #

Re: [R] How to override gWidgets:gvarbrowser_classes

2012-11-23 Thread jverzaniNWBKZ
Try this: library(gWidgets) options(guiToolkit=RGtk2) mydefaultclasses - list(Data sets1=c(data.frame) ) w - gwindow() vb - gvarbrowser(cont=w, knownTypes=mydefaultclasses) This could be done better, but I think the above does what you want. -- View this message in context:

[R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-23 Thread F86
Every time i insert : A-lm(GandW ~ Authocracy;Data) i get this Error. Iam using Mac. And i have checked that Data has been read correctly. The same command with the same Data has been used by a friend who is using Linux. Thanks for help! Stockholm university Faradj -- View this

[R] Add column index number to str() output

2012-11-23 Thread seth.fore
I often find it would be very useful when inspecting a data structure using str() to know the column index number in order to rearrange the data in a manner amenable to my purpose. Is there a way to modify the display options of the str() function to add column index? I know this is really a

[R] lines()

2012-11-23 Thread wdmc2012
I have some latitude and longitudes that I am trying to plot on an image with the lines() command like this: image(seq(-98, -93, 0.1), seq(28.5, 32.5, 0.1), z, xlab= Longitude, ylab= Latitude, main= Temperature) for (i in 2:length(subset(geo, Feature==Coast)[,1])) {

Re: [R] Odp: Object Browser

2012-11-23 Thread jverzaniNWBKZ
If gvarbrowser isn't quite to your liking, it isn't so hard to build your own variable browser. This uses a slight modification of Petr's function and wraps in a gWidgets interface. Modify his function to display what info you want and add a handler to the tbl object to have some action associated

Re: [R] Adding two different factors to one observation?

2012-11-23 Thread Florian Ahrweiler
On 16.11.2012 01:19, arun wrote: Hi, If you want to convert from the first way to the second way suggested by Jean: [...] A.K. - Original Message - From: Jean V Adams jvad...@usgs.gov To: Florian Ahrweiler florian.ahrwei...@uni-wh.de Cc: r-help@r-project.org Sent: Thursday,

[R] Spatstat: Mark correlation function

2012-11-23 Thread AMFTom
I normally use the following code to create a figure displaying the mark correlation function for the point pattern process A: M-markcorr(A) plot(M) I have now started to use the following code to perform 1000 Monte Carlo simulations of Complete Spatial Randomness (CSR). It is a Monte Carlo

[R] problem with svyglm

2012-11-23 Thread Pablo Menese
I have this problem. test - svydesign(id=~1,weights=~peso) logit - svyglm(bach ~ job2 + mujer + egp4 + programa + delay + mdeo + str + evprivate, family=binomial,design=test) then appear: Error in svyglm.survey.design(bach ~ job2 + mujer + egp4 + programa + : all variables must be in

Re: [R] printing difftime summary

2012-11-23 Thread Sam Steingold
* R. Michael Weylandt zvpunry.jrlyn...@tznvy.pbz [2012-11-23 09:13:36 +]: 2. because difftime.summary returns a data.frame and not a Classes 'summaryDefault', 'table' as I assume summary must return. See

Re: [R] Add column index number to str() output

2012-11-23 Thread Peter Ehlers
On 2012-11-23 08:54, seth.fore wrote: I often find it would be very useful when inspecting a data structure using str() to know the column index number in order to rearrange the data in a manner amenable to my purpose. Is there a way to modify the display options of the str() function to add

Re: [R] daily maximum temperature

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 10:04 AM, Dominic Roye wrote: Hello, I want to filter the daily maximum temperature. For this i made this skript, but it come out wrong results. Can anybody help me? Thanks for your help! Best regards datos$X - as.POSIXct(strptime(datos$X, %d/%m/%Y %H:%M:%S)) z -

Re: [R] problem with svyglm

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 12:08 PM, Pablo Menese wrote: I have this problem. test - svydesign(id=~1,weights=~peso) logit - svyglm(bach ~ job2 + mujer + egp4 + programa + delay + mdeo + str + evprivate, family=binomial,design=test) then appear: Error in svyglm.survey.design(bach ~ job2 + mujer

Re: [R] lines()

2012-11-23 Thread Duncan Murdoch
On 23/11/2012 11:56 AM, wdmc2012 wrote: I have some latitude and longitudes that I am trying to plot on an image with the lines() command like this: image(seq(-98, -93, 0.1), seq(28.5, 32.5, 0.1), z, xlab= Longitude, ylab= Latitude, main= Temperature) for (i in 2:length(subset(geo,

Re: [R] Add column index number to str() output

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 12:40 PM, Peter Ehlers wrote: On 2012-11-23 08:54, seth.fore wrote: I often find it would be very useful when inspecting a data structure using str() to know the column index number in order to rearrange the data in a manner amenable to my purpose. Is there a way to

Re: [R] printing difftime summary

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 12:35 PM, Sam Steingold wrote: * R. Michael Weylandt zvpunry.jrlyn...@tznvy.pbz [2012-11-23 09:13:36 +]: 2. because difftime.summary returns a data.frame and not a Classes 'summaryDefault', 'table' as I assume summary must return. See

Re: [R] Add column index number to str() output

2012-11-23 Thread David L Carlson
You could create a simple function using this as a starting point: str.ext - function(x) { if(!is.data.frame(x)) stop(No data frame!) st - gsub( \\$, , capture.output(str(x))) nm - prettyNum(0:length(x), width=3) cat(\n, paste(nm, st, \n, sep= )) } str.ext(iris) 0

Re: [R] read.csv.sql() to select from a large csv file

2012-11-23 Thread Juliane Struve
Rui, Anthony, and Gabor,   I got this to work in the end:   for(i in length(Names_EastCoast){ name - Names_EastCoast[i] sql - paste(select * from file where ID = ',name,',sep = ) Data - read.csv.sql(filename,sql = sql) }   loops through all individuals in the csv file.   Thanks a lot for all

Re: [R] daily maximum temperature

2012-11-23 Thread arun
Hi, Since you mentioned filtering the daily maximum temperature, this may help: datos-read.table(text= X, Ta, HR, RS, v 1/1/2010 1:00:00,5.28,100,0,2.3 1/1/2010 6:00:00,5.45,100,0,2.5 1/1/2010 11:00:00,5.51,100,0,1.1 2/1/2010 1:00:00,5.33,100,0,2.1 2/1/2010 6:00:00,5.48,100,0,2.3 2/1/2010

[R] caret train and trainControl

2012-11-23 Thread Brian Feeny
I am used to packages like e1071 where you have a tune step and then pass your tunings to train. It seems with caret, tuning and training are both handled by train. I am using train and trainControl to find my hyper parameters like so: MyTrainControl=trainControl( method = cv, number=5,

Re: [R] caret train and trainControl

2012-11-23 Thread Max Kuhn
Brian, This is all outlined in the package documentation. The final model is fit automatically. For example, using 'verboseIter' provides details. From ?train knnFit1 - train(TrainData, TrainClasses, + method = knn, + preProcess = c(center, scale), +

Re: [R] Barplot with lines

2012-11-23 Thread Jim Lemon
On 11/24/2012 02:21 AM, skanap wrote: Hi Jim, Thank you for the reply. But, when I use Barpos I get this error. plot(mydata$score,barpos) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ I need all the points in x-axis that are in 'days' column. If I'm selecting

Re: [R] caret train and trainControl

2012-11-23 Thread Brian Feeny
Max, Thanks, I do understand that the final model is fitted. I think I was not clear in my posting. I am changing datasets between tuning and real training. So maybe I tune on trainset but its only 5000 rows, doing my gridsearch and all that, and then once I have the hyper parameters, I

Re: [R] characters, mathematical expressions and computed values

2012-11-23 Thread mee1d3hs
The code hist(new, main=bquote(Heart Attack ( * bar(X)==.(round(mean(new),1)) * ))) does not work on 2.15.2 on OSX. the histogram is generated, but the title does show at all, which kind of tells me the bquote expression is failing I would appreciate any help in making this work, it seems it

[R] Problems with weight

2012-11-23 Thread Pablo Menese
Until a weeks ago I used stata for everything. Now I'm learning R and trying to move. But, in this stage I'm testing R trying to do the same things than I used to do in stata whit the same outputs. I have a problem with the logit, applying weights. in stata I have this output . svy: logit bach

Re: [R] Summary statistics for matrix columns

2012-11-23 Thread arun
Hi, No problem. There are a couple of other libraries which deal with summary statistics: library(pastecs) ?stat.desc() # library(matrixStats) #Using the functions from package: matrixStats fun1-function(x){

[R] R help..subsetting data frame that meeting multiple criteria

2012-11-23 Thread prasmas
Hi, I am new to R. I am trying to regroup data frame using multiple constrains. for example data frame: data value class percent 15526 36 4.6875 15527 62 85.9375 15527 82 32.4564 15528 36 70.3125 15528 62 9.375 15528 82 74.6875 I need to regroup

[R] Results displayed in Console

2012-11-23 Thread cavan
General question concerning summary results of a linear model. I've tried to look in help and search online but I either don't understand it or I can't find the answer. I've defined a model with a really large number of variables and levels. The summary results are so big that not all of the

Re: [R] characters, mathematical expressions and computed values

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 12:20 PM, mee1d3hs wrote: The code hist(new, main=bquote(Heart Attack ( * bar(X)==.(round(mean(new), 1)) * ))) does not work on 2.15.2 on OSX. the histogram is generated, but the title does show at all, which kind of tells me the bquote expression is failing Works

Re: [R] Spatstat: Mark correlation function

2012-11-23 Thread Rolf Turner
On 24/11/12 06:36, AMFTom wrote: I normally use the following code to create a figure displaying the mark correlation function for the point pattern process A: M-markcorr(A) plot(M) I have now started to use the following code to perform 1000 Monte Carlo simulations of Complete Spatial

Re: [R] R help..subsetting data frame that meeting multiple criteria

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 1:14 PM, prasmas wrote: Hi, I am new to R. I am trying to regroup data frame using multiple constrains. for example data frame: data value class percent 15526 36 4.6875 15527 62 85.9375 15527 82 32.4564 15528 36 70.3125 15528 62

Re: [R] R help..subsetting data frame that meeting multiple criteria

2012-11-23 Thread Rui Barradas
Hello, Like the following? dat - read.table(text= value class percent 15526 36 4.6875 15527 62 85.9375 15527 82 32.4564 15528 36 70.3125 15528 62 9.375 15528 82 74.6875 , header = TRUE) per70 - dat$percent 70 split(dat, list(dat$class, per70)) Hope this helps, Rui Barradas Em 23-11-2012

Re: [R] Problems with weight

2012-11-23 Thread Anthony Damico
from your stata output, it looks like you need to use the survey package in R for step-by-step instructions about how to do this (and comparisons to stata), see http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Damico.pdf once you're ready to run the regression, use svyglm() instead

Re: [R] R lapack routines cannot be loaded

2012-11-23 Thread Martin Morgan
On 11/23/2012 08:05 AM, arysar wrote: I usually ran different statistical analysis in R with routines that use lapack like gam() lm(), etc but after several updates of libraries the following error appears: library(mgcv) This is mgcv 1.7-22. For overview type 'help(mgcv-package)'. model -

[R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I have two very basic questions (console attached): 1) What am I getting an error message for # 5 and # 7 ? 2) How to fix the code? I would appreciate receiving your help. Thanks, Pradip Muhuri ## Reproducible Example # N - 100 set.seed(13)

Re: [R] subsetting - questions

2012-11-23 Thread Jorge I Velez
Hi Pradip, It is easier to use subset(). Check ?subset for some examples and pay special attention to the select parameter. By the way, do not call your data df as it is already a function. Best, Jorge.- On Sat, Nov 24, 2012 at 1:55 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello, I

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Arun, Thank you so much for your help. Pradip From: arun [smartpink...@yahoo.com] Sent: Friday, November 23, 2012 10:15 PM To: Muhuri, Pradip (SAMHSA/CBHSQ) Cc: R help Subject: Re: [R] subsetting - questions HI, This should work:

Re: [R] subsetting - questions

2012-11-23 Thread Peter Ehlers
On 2012-11-23 18:55, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello, I have two very basic questions (console attached): 1) What am I getting an error message for # 5 and # 7 ? 2) How to fix the code? I would appreciate receiving your help. Thanks, Pradip Muhuri ## Reproducible Example

[R] Building factors across two columns, is this possible?

2012-11-23 Thread Brian Feeny
I am trying to make it so two columns with similar data use the same internal numbers for same factors, here is the example: read.csv(test.csv,header =FALSE,sep=,) V1V2 V3 1 sun moonstars 2 stars moon sun 3 cat dog catdog 4 dog moon sun 5 bird plane

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Jorge, I could use subset(). But, I wanted to minimize coding. Thanks, Pradip From: Jorge I Velez [jorgeivanve...@gmail.com] Sent: Friday, November 23, 2012 10:02 PM To: Muhuri, Pradip (SAMHSA/CBHSQ) Cc: r-help@r-project.org Subject: Re: [R]

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello Peter, 1. -c(X3, X4, X5) For the above variables, class is integer. Arun has suggested the following: df[df$X1=8,][-which(names(df)%in% c(X3,X4,X5))] 2.df[df$X1=8,] [, !names(df) %in% drop_var] I agree - Arun has also suggested the same. Thanks and regards, Pradip

Re: [R] R help..subsetting data frame that meeting multiple criteria

2012-11-23 Thread David Winsemius
On Nov 23, 2012, at 6:32 PM, arun wrote: Hi David, Tried the solution on a slightly different data: dat - read.table(text= value class percent 15526 36 4.6875 15527 62 85.9375 15527 82 32.4564 15528 36 70.3125 15528 62 9.375 15528 82 74.6875 15529 72 50. 15530 72 50. , header = TRUE)

  1   2   >