Re: [R] lm without intercept

2012-08-15 Thread citynorman
The cor(mtcars$mpg, fitted(m0))^2 method works great - thanks so much Josh! I've had another instance (also ex intercept) where it actually gave the correct number, odd behavior. Thanks for the other posts also. As an aside, in my application a zero intercept makes economic sense and I'm using

Re: [R] twitteR location?

2012-08-15 Thread Sachinthaka Abeywardana
Did you mean the Vignette for twitteR? there is no FAQ section that I can see and I could not get the following to work either: a-searchTwitter(sydney, n=100, geocode='-33.871841,151.206709, 1mi') returns with a null list. Is there some sort of registration I need to do for this to work?

[R] Basic question -loading data

2012-08-15 Thread Dinuk Jayasuriya
Hi all, New user here - I include the following command in the prompt read.csv(document.csv, header = TRUE ) and the output shows up. But when I include the following command summary(data) I get the following message Error in object[[i]] : object of type 'closure' is not subsettable Can

Re: [R] twitteR location?

2012-08-15 Thread Jean-Pierre Müller
Have look at : http://stackoverflow.com/questions/11674842/how-to-extract-tweet-geocode-in-twitter-package-in-r/11678037#11678037 HTH, -- Jean-Pierre Müller SSP / Anthropole 4123 / UNIL / CH - 1015 Lausanne Voice:+41 21 692 3116 / Fax:+41 21 692 3115 Please avoid sending me Word or

[R] How to join two plotmath type expressions

2012-08-15 Thread Trevor Carey-Smith
If I have two variables set, one of which holds an expression, for example: label - 'Temperature' unit - expression(paste(degree,'C')) how can I join them together for use in mtext (or equivalent)? The following is conceptually what I want to do, but will obviously not work: plot(0:1)

Re: [R] to remove columns and rows

2012-08-15 Thread arun
Hello, Try this:  idlength-sapply(file1,function(x) length(unique(x)) )  which(idlength1) #V6 V8 V9  #6  8  9  #the ones that will be removed which(idlength==1) # V1  V2  V3  V4  V5  V7 V10   #1   2   3   4   5   7  10 idlength2-apply(file2,1,function(x) length(unique(x)))  which(idlength21)

Re: [R] Subsetting rows by multiple levels of selected values

2012-08-15 Thread arun
HI, In addition to merge(), you can also use: join() library(plyr) join(df1,df2,type=inner) A.K. - Original Message - From: Jun Shen jun.shen...@gmail.com To: R-help r-h...@stat.math.ethz.ch Cc: Sent: Tuesday, August 14, 2012 3:05 PM Subject: [R] Subsetting rows by multiple levels of

Re: [R] twitteR location?

2012-08-15 Thread Bhupendrasinh Thakre
Please read the FAQ file for twitteR. It mentions how to get both and as well as radius. Best Regards, Bhupendrasinh Thakre Sent from my iPhone On Aug 14, 2012, at 6:06 PM, Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: Hi all, Is it possible to get the latitude and

Re: [R] twitteR location?

2012-08-15 Thread Bhupendrasinh Thakre
Very true, it does bring null list. However while giving some other inputs like since, until, lang as Null you will get desired result. Bhupendrasinh Thakre On Aug 14, 2012, at 7:04 PM, Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: a-searchTwitter(sydney, n=100,

Re: [R] twitteR location?

2012-08-15 Thread Bhupendrasinh Thakre
There is something wrong in your geo code. What was the source. Although some trial and error suggests that we should use lat and lang till 4 decimal only. Don't know why. I have changed the geo-code somewhat and it works. Changed Code : searchTwitter('sydney',

Re: [R] Basic question -loading data

2012-08-15 Thread Jeff Newmiller
data is the name of a base function in R. Functions are objects of type closure. You can find out more about this function by reading the help. If you create your own object named data then your object will hide the base function and you won't be able to use it when you want to. Type ?data

Re: [R] Basic question -loading data

2012-08-15 Thread Dinuk Jayasuriya
Hi Jeff, Thank you - your comment was much appreciated. I'm now running an ordered probit regression and get the following error: Error in family$linkfun(mustart) : Value 1.125 out of range (0, 1) I can't decipher (after looking at other posts on google!) why this error occurs - is it

Re: [R] How to join two plotmath type expressions

2012-08-15 Thread Pascal Oettli
Hello, Try this one: mtext(expression(Temperature(degree*C))) Hope this help Regards, Pascal Le 12/08/15 12:56, Trevor Carey-Smith a écrit : If I have two variables set, one of which holds an expression, for example: label - 'Temperature' unit - expression(paste(degree,'C')) how can

Re: [R] dimnames in an array(I'll be grateful if this message will be passed to all list users)

2012-08-15 Thread aleksandr shfets
Hi Michael, Thanks for help on double brackets: I wasn't aware of this use of them. I went back to readjust my array so the dimnames(data11a)[[2]] would have two elements, and remade the array to include the new dimnames: dimnames(data11a)[[2]]=c(V,R) so that inside the second car of the train

[R] hidden for() loop subsetting a matrix?

2012-08-15 Thread Federico Calboli
Hi, I am subsetting a matrix thus: test [,1] [,2] [,3] [1,]17 13 [2,]28 14 [3,]39 15 [4,]4 10 16 [5,]5 11 17 [6,]6 12 18 test[cbind(c(1,3,5), c(2,1,3))] [1] 7 3 17 This works fine, and is the equivalent of c(test[1,2], test[3,1],

Re: [R] pass by reference

2012-08-15 Thread Alexandre Aguiar
Em Ter 14 Ago 2012, Bert Gunter escreveu: (Offlist, as my comments are not worth bothering the list about). (offlist as well) :-) R is what it is. And it can even do things it was not designed for, including indirection to internal data, through extensions. Thanks. -- Alexandre --

Re: [R] How to join two plotmath type expressions

2012-08-15 Thread S Ellison
label - 'Temperature' unit - expression(paste(degree,'C')) how can I join them together for use in mtext (or equivalent)? The following is conceptually what I want to do, This seems to work: plot(1:10, type='n') label - 'Temperature' unit - bquote(degree*C) text(5,5,substitute(l~u,

Re: [R] igraph: Turn multiple edges into weights

2012-08-15 Thread Rui Barradas
Hello, There is a function count.multiple that can be used to do what you want. You can also have a function return unique rows/edges. Here are three functions that count multiple edges. library(igraph) ee - c(1,2,2,3,1,2,2,4,1,2,2,3) g - graph(ee) plot(g) # Returns a two column matrix

[R] car::linearHypothesis fails to constrain factor to zero

2012-08-15 Thread Iuri Gavronski
Hi, I am trying to test whether a factor (coded as a set of dummy variables) is equal to zero, using linearHypothesis. I get an error. See a reproducible example: data(swiss) my_swiss = swiss my_swiss$fake = factor(sample(c(A,B),47,rep=T)) my_lm - lm(Infant.Mortality ~ Fertility + fake,

[R] How do you rotate axes in ctree - (Party Package)

2012-08-15 Thread Christopher Choi
I have a classification tree analyzed using ctree() was wondering how can one rotate the terminal nodes so that the axes are vertical? library(party) data(iris) attach(iris) plot(ctree(Species ~ Sepal.Length + Sepel.Width + Petal.Length + Petal.Width, data = iris))

[R] boxplot help

2012-08-15 Thread andyspeak
Hi, im a newbie with very wobbly coding abilities. Tearing my hair out over getting the boxplot i want... I have a dataset called 'eagle' which consists of year (2011 or 2012), month (jan - dec), roof (TT6, TT13 or BARE) and temp (the continuous variable that i want to plot). So i want boxplots

[R] How to plot data in logarithmic scale

2012-08-15 Thread Zuki
Hi everyone, I am new in R, just used it for 2 weeks and I have a basic question. I have data, for example table$attrib that I would like to plot its cumulative distribution in logarithmic scale. How do I do that? After browsing internet, I tested this command: plot.ecdf(1:100, log =y,

Re: [R] How to join two plotmath type expressions

2012-08-15 Thread arun
HI, Try this: plot(1:10, type='n')  newtxt-bquote(paste(Temperature, (,degree*C,),sep=))  mtext(newtxt,3) A.K. - Original Message - From: Trevor Carey-Smith trevor.carey-sm...@niwa.co.nz To: r-help@r-project.org Cc: Sent: Tuesday, August 14, 2012 11:56 PM Subject: [R] How to join two

[R] which() function not finding certain numbers

2012-08-15 Thread Tom Bird
Hi, I am using 32-bit R v 2.15.1, on Mac OsX v 10.6.8 with R GUI 1.52 Leopard build 32-bit (6188). I have also replicated this error on R 2.13.2 on a windows 7 machine. In some sequences of numbers, I am unable to use the which() function to index certain values.It seems to be primarily

Re: [R] boxplot help

2012-08-15 Thread John Kane
Hi Andy, Nice plot but yes, probably not exactly what you want. Thanks for providing the code. The nextthing you need to do is to send us some data to go with the code. There is a very handy function called dput() , which converts a dataset into a format that you can just copy from your R

Re: [R] which() function not finding certain numbers

2012-08-15 Thread John Kane
It looks like an example of FAQ 7.31 Why doesn't R think these numbers are equal? John Kane Kingston ON Canada -Original Message- From: tomasb...@gmail.com Sent: Wed, 15 Aug 2012 22:37:17 +1000 To: r-help@r-project.org Subject: [R] which() function not finding certain numbers

Re: [R] which() function not finding certain numbers

2012-08-15 Thread Jeff Newmiller
FAQ 7.31 ?is.equal --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#..

Re: [R] car::linearHypothesis fails to constrain factor to zero

2012-08-15 Thread John Fox
Dear Iuri, fake is not a coefficient in the model: linearHypothesis(my_lm, matchCoefs(my_lm, fake)) Linear hypothesis test Hypothesis: fakeB = 0 Model 1: restricted model Model 2: Infant.Mortality ~ Fertility + fake Res.DfRSS Df Sum of Sq F Pr(F) 1 45 322.54

Re: [R] Communative Matrix Multiplcation

2012-08-15 Thread David Reiner
As a mathematician, I have to correct the subject line to 'Distributive Matrix operations' -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Tuesday, August 14, 2012 12:55 PM To: Berend Hasselman Cc:

[R] Obtaining census tract data from addresses

2012-08-15 Thread Michael Leitson
Hello, I have a bunch of street addresses that I want to obtain the census tract data for. Is there any way I can do this in R? Thank you, -- Michael Leitson michael.leit...@gmail.com __ R-help@r-project.org mailing list

[R] store the results of two connected and disturbed for-loops to data.frame

2012-08-15 Thread Thomas Schu
Dear all, here is a example of my problem: /#data# g-c(1,1,1,2,2,2) A-runif(6,min=1,max=5) B-runif(6,min=100,max=1000) C-runif(6,min=30,max=31) D-runif(6,min=67,max=98765) var-cbind(A,B,C,D) label-colnames(var) store-data.frame(matrix(ncol=2)) colnames(store)=c(usedVar,prediction)

Re: [R] GEV distribution fitted by L-moment graph

2012-08-15 Thread Al Ehan
Many Thanks :) On Wed, Aug 8, 2012 at 2:43 PM, J. R. M. Hosking jrmhosk...@gmail.comwrote: On 2012-08-08 04:22, Al Ehan wrote: Hi, I have been having difficulties in finding packages/ codes that simplify plotting of a GEV fitted to dataset (by L-moments) that would print out graph

Re: [R] store the results of two connected and disturbed for-loops to data.frame

2012-08-15 Thread Rui Barradas
Hello, Just start the loop in 'k' after the value for 'i'. Try the following. nr - ncol(var) store-data.frame(matrix(nrow=nr*(nr - 1)/2, ncol=2)) colnames(store)=c(usedVar,prediction) a - 0 for (i in c(1:4)) { for (k in (i:4)[-1]) { dis-lda(g~var[,i]+var[,k],CV=TRUE,fold=6)#linear

[R] legend position help

2012-08-15 Thread Jinsong Zhao
Hi there, I draw a multiple figure in one plot, like the following: par(mfcol=c(1,5),mar=c(4,4,0,0)+0.2, oma=c(0,0,3,0)) plot(1:10, type = b) plot(1:10, type = b) plot(1:10, type = b) plot(1:10, type = b) plot(1:10, type = b) Now, I hope to plot the legend like the following: legend(top,

Re: [R] Obtaining census tract data from addresses

2012-08-15 Thread Anthony Damico
Zack Almquist has written an excellent UScensus2000 package.. but what you probably need is a batch conversion from https://webgis.usc.edu/Services/Geocode/Default.aspx or a census tract to zip code map from http://mcdc.missouri.edu/websas/geocorr12.html On Wed, Aug 15, 2012 at 9:59 AM,

[R] sample() from (un-)sorted vectors

2012-08-15 Thread saschaview
Hello, Vector y is an alphabetically sorted version of vector x. Will both samples, X and Y, be absolutely random or will they have systematic differences? And: Should I sort or shuffle a vector before sampling? Thank you, *S* x - as.factor(LETTERS[sequence(10:1)]) y - sort(x) X - sample(x,

Re: [R] legend position help

2012-08-15 Thread Greg Snow
You can use the grconvertY function to find the position in the current user coordinates that corresponds to the top of the device area (instead of using locator). Look at the merge argument to the legend function. On Wed, Aug 15, 2012 at 10:04 AM, Jinsong Zhao jsz...@yeah.net wrote: Hi there,

Re: [R] sample() from (un-)sorted vectors

2012-08-15 Thread Bert Gunter
Define: Absolutely random; systematic differences (All pseudorandom numbers are by definition generated by a deterministic algorithm from a possibly random starting seed set). On Wed, Aug 15, 2012 at 9:11 AM, saschav...@gmail.com wrote: Hello, Vector y is an alphabetically sorted version of

Re: [R] sample() from (un-)sorted vectors

2012-08-15 Thread Jeff Newmiller
This seems more theoretical than specific to R, so you should discuss this question in a more theoretical forum such as http://stats.stackexchange.com/. FWIW I believe the results will be equally random either way. That doesn't say either way will be absolutely random, since I don't think such

Re: [R] boxplot help

2012-08-15 Thread Richard M. Heiberger
Hi, I recommend the use of panel.bwplot.intermediate.hh in the HH package. This is a lattice function. Lattice usually gives you more control than base graphics. I build your example in several steps here. Critical items to notice: You must declare the months to be ordered; by default they are

[R] shade overlapping portions of circles (or other shapes)

2012-08-15 Thread Paul Johnson
I'm making some illustrations and it would be convenient to automatically shade the overlapping portions of circles. These illustrations are for Social Choice theory, a field in political science and economics. I've wrestled together some examples so you can see what I mean, but have not

[R] Plot ROC using TP,FP AND FN alone

2012-08-15 Thread vjyns
Hi, I want to plot ROC curve for my detection algorithm which is used to detect features in image. I had obtained true positive, false positive and false negative from the algorithm. There is no true negative in my case. I had run the algorithm for 6 images so i got 6 number of TP,FP

Re: [R] boxplot help

2012-08-15 Thread andyspeak
hi thanks the dput output is... structure(list(Year = c(2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L, 2011L,

[R] Error in metafor documentation on maximum iterations

2012-08-15 Thread John Hodgson
Both the official R documentation and Wolfgang's paper in the Journal of Statistical Science describing this (extremely useful) package, name the control variable for maximum iterations in numeric model fitting as 'maxiter'. The correct name is 'maxit'. A small point concerning an (I guess)

[R] ANOVA repeated measures and post-hoc

2012-08-15 Thread Diego Bucci
Hi, I performed an ANOVA repeated measures but I still can't find any good news regarding the possibility to perform multiple comparisons. Can anyone help me? Thanks Diego Bucci Fisiologia Veterinaria Dipartimento di Scienze Mediche Veterinarie Università degli Studi di Bologna Via Tolara di

[R] tikzDevice not available

2012-08-15 Thread nikos giallousis
Hello people! I just formatted my disk, and I have installed R 2.14 over. Now I am trying to restore my packages and all. I realized that tikzDevice, a crucial package for me is gone. Fortunately, I have kept my old, non-zipped, tikzDevice folder, but none of the commands I know seems to handle

Re: [R] which() function not finding certain numbers

2012-08-15 Thread Petr Savicky
On Wed, Aug 15, 2012 at 10:37:17PM +1000, Tom Bird wrote: Hi, I am using 32-bit R v 2.15.1, on Mac OsX v 10.6.8 with R GUI 1.52 Leopard build 32-bit (6188). I have also replicated this error on R 2.13.2 on a windows 7 machine. In some sequences of numbers, I am unable to use the which()

[R] per-vertex statistics of edge weights

2012-08-15 Thread Sam Steingold
I have a graph with edge and vertex weights, stored in two data frames: --8---cut here---start-8--- vertices - data.frame(vertex=c(a,b,c,d),weight=c(1,2,1,3)) edges - data.frame(src=c(a,a,b,c,d),dst=c(b,c,d,d,a), weight=c(1,2,1,3,1)) --8---cut

Re: [R] tikzDevice not available

2012-08-15 Thread peter dalgaard
On Aug 15, 2012, at 18:54 , nikos giallousis wrote: Hello people! I just formatted my disk, and I have installed R 2.14 over. Now I am trying to restore my packages and all. I realized that tikzDevice, a crucial package for me is gone. Fortunately, I have kept my old, non-zipped,

Re: [R] tikzDevice not available

2012-08-15 Thread Ulises M. Alvarez
On 08/15/2012 11:54 AM, nikos giallousis wrote: I realized that tikzDevice, a crucial package for me is gone. Fortunately, I have kept my old, non-zipped, tikzDevice folder, but none of the commands I know seems to handle this [i.e. load() and install.packages()]. Thus the formulation is like

[R] Constructing mgcv tprs basis functions

2012-08-15 Thread Casey Olives
Hello, I am trying to generate the design matrix associated with the tprs smooth in R mgcv from scratch. I want to construct the matrix X = [UkDkZk | T] which is produced from the function smoothCon following the steps provided in Simon Wood's 2003 Thin Plate Regression Splines paper (Appendix

[R] Reading one column .csv file

2012-08-15 Thread darnold
My friend sent an Excel file: http://msemac.redwoods.edu/~darnold/temp/cyu01_iqscores.xls http://msemac.redwoods.edu/~darnold/temp/cyu01_iqscores.xls I opened it in Excel, saved is as cyu01_iqscores.csv, then imported it into R with: iqscores=read.csv('cyu01_iqscores.csv',header=TRUE) The

[R] color-coding of biplot points for varimax rotated factors (from PCA)

2012-08-15 Thread Barbara Doll
I'm using R for PCA and factor analysis. I want to create biplots of varimax rotated factors that color-code points by their classification. My research is on streams that are urban and rural. So, I want to color code them by this classification. If you just do a biplot from prcomp or princomp,

Re: [R] Standard introductory presentation

2012-08-15 Thread clangkamp
Hi Everyone Thanks for answering both in public and on private email - I got numerous responses, and just for the people who have similar questions: Econometrics introduction I found this approach interesting to your purposes: http://eeecon.uibk.ac.at/~zeileis/papers/DAGStat-2007.pdf

Re: [R] boxplot help

2012-08-15 Thread Rui Barradas
Hello, I'm not sure wether this is what you want, but here it goes. dd - structure( ...etc... ) # your dataset # make group identifiers ym - paste(dd$Year, as.character(dd$Month), sep=-) op - par(las=2) # make labels perpendicular to axis bp - boxplot(Temp ~ ym, data=dd) axis(1, at =

[R] Color-coded Biplot of Varimax rotated factors from PCA based factor analysis

2012-08-15 Thread Barbara Doll
I'm using R for PCA and? factor analysis. I want to create biplots of varimax rotated factors that color-code points by their classification. My research is on streams that are urban and rural. So, I want to color code them by this classification. If you just do a biplot from prcomp or

[R] help function axis

2012-08-15 Thread aprendiz programa
Hello, I'm trying plot a graph, but the x-axis is not appearing.What am I doing wrong? xx 2000 42001 72002 82003 92004 22005 1 x-read.table(xx.txt, header=FALSE) plot(x,type=o,axes=FALSE,xlab=year,ylab=cases) axis(1,at=1:6, lab=c(2000,2001,2002,2003,2004,2005)) axis(2,0:9) Help me!

[R] message-passing algorithm

2012-08-15 Thread Gildas Mazo
Dear R users, I'm searching a message-passing algorithm in R. Any help much appreciated. Thank you, Gildas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] ggplot2: legend for geom_rug() ..?

2012-08-15 Thread Hadley Wickham
On Thu, Jun 7, 2012 at 9:30 AM, Tim Smith tim_smith_...@yahoo.com wrote: Hi, Here is the corrected code: library(ggplot2) ids - paste('id_',1:3,sep='') before - sample(9) after - sample(1:10,9) dat - as.matrix(cbind(before,after)) rownames(dat) - rep(ids,3) position -

Re: [R] boxplot help

2012-08-15 Thread John Kane
Okay your first main problem is that you have Year and Month as character variables. I think you need to convert them to a single date: Try this: eagle$dates - as.Date(paste(dd, /, 01, sep=), %Y/%b/%d) I think this helps cure a lot of the problem. However a different approach to the same

Re: [R] help function axis

2012-08-15 Thread John Kane
Well, first thing wrong is no data. See ?dput as a way to supply sample data Other than that everything seems okay or at least x-1:6 plot(x,type=o,axes=FALSE,xlab=year,ylab=cases) axis(1,at=1:6, lab=c(2000,2001,2002,2003,2004,2005)) axis(2,0:9) plots for me. John Kane Kingston ON Canada

[R] Subsetting with missing data

2012-08-15 Thread Robin Jeffries
Simply put, I want to subset the data frame 'a' where 'y=0'. a - as.data.frame(cbind(x=1:10, y=c(1,0,NA,1,0,NA,NA,1,1,0))) a x y 1 1 1 2 2 0 3 3 NA 4 4 1 5 5 0 6 6 NA 7 7 NA 8 8 1 9 9 1 10 10 0 names(a) [1] x y table(a$y) 0 1 3 4 table(a$y, useNA=always) 0

Re: [R] per-vertex statistics of edge weights

2012-08-15 Thread Sam Steingold
* Sam Steingold f...@tah.bet [2012-08-15 14:04:18 -0400]: sapply(vertices$vertex, function (v) mean(E(g)[inc(v)]$weight)) Note: no visible global function definition for 'inc' [1] 1.33 1.00 2.50 1.67 but I was wondering if this is TRT, given the correct answer with a scary

Re: [R] Reading one column .csv file

2012-08-15 Thread John Kane
I cannot duplicate this using LibreOffice Calc. It saves exactly as one would expect. John Kane Kingston ON Canada -Original Message- From: dwarnol...@suddenlink.net Sent: Wed, 15 Aug 2012 10:27:54 -0700 (PDT) To: r-help@r-project.org Subject: [R] Reading one column .csv file

Re: [R] Subsetting with missing data

2012-08-15 Thread Rui Barradas
Hello, From the help page for ?`==` Note Do not use |==| and |!=| for tests, such as in |if| expressions, where you must get a single |TRUE| or |FALSE|. Unless you are absolutely sure that nothing unusual can happen, you should use the |identical

Re: [R] Reading one column .csv file

2012-08-15 Thread jim holtman
There is nothing weird about it if you look at the structure of the CSV file: IQ Scores, 145, 101, 123, 106, 117, 102, 139, 142, 94, Notice that there is an extra comma that EXCEL is inserting and therefore when you are reading it in to R, it assumes there is an unnamed column that it calls X:

Re: [R] creation of package failed

2012-08-15 Thread Franckx Laurent
Problem solved - thanks for the help. It was indeed an issue with the path: not just leaving out the blanks, but also putting the Rtoolds folders in front. This is actually emphasized in the R Installation and Administration manual, but while considering all types of complicated conjectures, I

Re: [R] Subsetting with missing data

2012-08-15 Thread Ista Zahn
It makes sense if you think it through. Your index vector is a$y==0 [1] FALSE TRUENA FALSE TRUENANA FALSE FALSE TRUE and ?[ says NAs in indexing: When extracting, a numerical, logical or character 'NA' index picks an unknown element and so returns 'NA' in the

Re: [R] Reading one column .csv file

2012-08-15 Thread peter dalgaard
On Aug 15, 2012, at 22:11 , John Kane wrote: I cannot duplicate this using LibreOffice Calc. It saves exactly as one would expect. I can duplicate it with Excel on OSX. Each line of the CSV file ends with a comma! Corresponding thing happens if you save as .txt (TAB-delimited) and read

Re: [R] store the results of two connected and disturbed for-loops to data.frame

2012-08-15 Thread Thomas Schu
Dear Mr. Barradas , Thank you very much! It works very well, especially defining a-0 and using a-a+1 as some kind of loop-count was exactly what i searched for! best regards Thomas -- View this message in context:

[R] sensitivity and specificity in svyglm??

2012-08-15 Thread Diana Marcela Martinez Ruiz
Hello, As obtained from a table svyglm clasificaion, sensitivity and specificity. The funtion ConfusionMatrix () of the library (caret) gives these results but not how to apply it to svyglm. thanks [[alternative HTML version deleted]]

[R] Import Data from Excel

2012-08-15 Thread li li
Dear all, I want to import just part of an excel data file into R. I would like to have the data imported without rownames or colume names. I used read.delim(clipboard, header=F). Somehow even though I added the argument header=F, I still have the row names V1, V2, ..., Does anyone know

Re: [R] How to join two plotmath type expressions

2012-08-15 Thread Trevor Carey-Smith
On 08/15/2012 10:45 PM, S Ellison wrote: label- 'Temperature' unit- bquote(degree*C) text(5,5,substitute(l~u, list(l=label, u=unit))) Thanks, that's exactly what I was after. Regards, Trevor. -- Please consider the environment before printing this email. NIWA is the trading name of the

Re: [R] Import Data from Excel

2012-08-15 Thread Bert Gunter
Hannah: 1. First of all, they are column names, not row names. 2. Second, no, you cannot fix it. All columns in a data frame *must* have names, and if none are obtained from the import, the defaults you see will be provided. See ?data.frame for details of how columns are named. Columns of data

Re: [R] shade overlapping portions of circles (or other shapes)

2012-08-15 Thread Greg Snow
A quick and simple way would be to fill both circles with a semi-transparent color (does not work on all devices), then the overlapping area will will show up as a different color/shade due to the alpha blending. You might want to redraw the circles without fill after the filled ones so that the

[R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-15 Thread Rich Shepard
One set of data has censored (less-than detection limits) water chemistry concentrations for 80-100% of all observations. My initial trial-and-error attempts to apply the cenboxplot() method suggests that it has an upper limit to the percentage of censored observations. I do not see this limit

Re: [R] help function axis

2012-08-15 Thread William Dunlap
axis(), like many of R's add-to-a-plot functions, does not warn if you ask then to add things whose positions are out of the bounds of the current plot. plot(1:10,101:110) axis(side=3, at=11:12, lab=c(Eleven, Twelve)) # all out of bounds axis(side=4, at=c(105,115), lab=c(CX, CXV)) # second out

Re: [R] tikzDevice not available

2012-08-15 Thread Yihui Xie
I think it will come back again in the future. The maintainer is busy at the moment: https://github.com/Sharpie/RTikZDevice/commit/95069e0a1deeb8fb9db028bbb76f227ddfcdc559#commitcomment-1562437 For now, the easiest way to install it is probably via R-Forge: install.packages(tikzDevice,

Re: [R] Import Data from Excel

2012-08-15 Thread David Winsemius
On Aug 15, 2012, at 2:04 PM, li li wrote: Dear all, I want to import just part of an excel data file into R. I would like to have the data imported without rownames or colume names. I used read.delim(clipboard, header=F). Somehow even though I added the argument header=F, I still have

Re: [R] Import Data from Excel

2012-08-15 Thread David Winsemius
On Aug 15, 2012, at 4:07 PM, David Winsemius wrote: On Aug 15, 2012, at 2:04 PM, li li wrote: Dear all, I want to import just part of an excel data file into R. I would like to have the data imported without rownames or colume names. I used read.delim(clipboard, header=F). Somehow even

Re: [R] per-vertex statistics of edge weights

2012-08-15 Thread Gábor Csárdi
On Wed, Aug 15, 2012 at 2:04 PM, Sam Steingold s...@gnu.org wrote: I have a graph with edge and vertex weights, stored in two data frames: --8---cut here---start-8--- vertices - data.frame(vertex=c(a,b,c,d),weight=c(1,2,1,3)) edges -

Re: [R] [igraph] per-vertex statistics of edge weights

2012-08-15 Thread Gábor Csárdi
On Wed, Aug 15, 2012 at 4:10 PM, Sam Steingold s...@gnu.org wrote: [...] Also, this takes forever and consumes almost all 8GB RAM. It has been running on --8---cut here---start-8--- IGRAPH DNW- 18590 6734992 -- + attr: name (v/c), count (v/n), weight (e/n)

Re: [R] Reading one column .csv file

2012-08-15 Thread darnold
Peter, Interesting. Never heard of copying from the clipboard. I am also on a MacBook Pro, but I cannot get it to work. 1. I selected the column of data (including the header) in Excel. 2. Selected Edit-Copy. 3. In R, tried: a - read.delim(clipboard) Error in file(file, rt) : cannot open

Re: [R] Import Data from Excel

2012-08-15 Thread arun
HI, I guess you were talking about column names instead of rownames. If you have a data like the one below to read: dat1-read.table(text= beta0  beta1  pvalor    Crom rs17  158.5980 12.252462 9.083193e-135    1 rs46  163.3730  3.304276  3.279925e-06  1 rs63   

Re: [R] Subsetting with missing data

2012-08-15 Thread arun
HI, Try this: subset(a,y==0) #    x y #2   2 0 #5   5 0 #10 10 0 #or subset(a,y%in%0) #    x y #2   2 0 #5   5 0 #10 10 0 A.K. - Original Message - From: Robin Jeffries rjeffr...@ucla.edu To: r-help@r-project.org Cc: Sent: Wednesday, August 15, 2012 4:06 PM Subject: [R] Subsetting

Re: [R] which() function not finding certain numbers

2012-08-15 Thread Tom Bird
Yes, the round(seq( )) sollution does it. Many thanks to the sender of this (and other similar) solutions. TB On Thu, Aug 16, 2012 at 3:45 AM, Petr Savicky savi...@cs.cas.cz wrote: On Wed, Aug 15, 2012 at 10:37:17PM +1000, Tom Bird wrote: Hi, I am using 32-bit R v 2.15.1, on Mac OsX v

[R] nls()

2012-08-15 Thread li li
Dear all, I have a question on the four parameter logistic regression. Not sure about how to set the start values for the parameters. Can anyone familiar with this give some hint? Thanks so much. Hannah For example, suppose I have the following data values, temp

Re: [R] legend position help

2012-08-15 Thread Jinsong Zhao
On 2012-08-16 0:22, Greg Snow wrote: You can use the grconvertY function to find the position in the current user coordinates that corresponds to the top of the device area (instead of using locator). Thank you very much. grconvertX() and grconvertY() work very well. Look at the merge

Re: [R] Error in metafor documentation on maximum iterations

2012-08-15 Thread Michael Weylandt
Send this to Wolfgang directly. See maintainer(metaphor) Michael On Aug 15, 2012, at 12:13 PM, John Hodgson j...@formby.plus.com wrote: Both the official R documentation and Wolfgang's paper in the Journal of Statistical Science describing this (extremely useful) package, name the control

[R] Symbolic computation in R-solving system of equations

2012-08-15 Thread jpm miao
Hi, To my knowledge, Ryacas can do symbolic computation in R, like Mathematica or Maple. I wonder if it (or any other R package) can solve symbolically a system of equations? I have a system of four equations in four variables (non-linear, but not very hard to solve) and wonder if Ryacas

Re: [R] nls()

2012-08-15 Thread Gabor Grothendieck
On Wed, Aug 15, 2012 at 9:08 PM, li li hannah@gmail.com wrote: Dear all, I have a question on the four parameter logistic regression. Not sure about how to set the start values for the parameters. Can anyone familiar with this give some hint? Thanks so much. See ?SSfpl which is the

Re: [R] hidden for() loop subsetting a matrix?

2012-08-15 Thread R. Michael Weylandt
On Wed, Aug 15, 2012 at 5:32 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Hi, I am subsetting a matrix thus: test [,1] [,2] [,3] [1,]17 13 [2,]28 14 [3,]39 15 [4,]4 10 16 [5,]5 11 17 [6,]6 12 18 test[cbind(c(1,3,5),

Re: [R] Basic question -loading data

2012-08-15 Thread R. Michael Weylandt
On Wed, Aug 15, 2012 at 3:59 AM, Dinuk Jayasuriya dinuk.jayasur...@anu.edu.au wrote: Hi Jeff, Thank you - your comment was much appreciated. I'm now running an ordered probit regression and get the following error: Error in family$linkfun(mustart) : Value 1.125 out of range (0, 1) Error

Re: [R] Reading one column .csv file

2012-08-15 Thread David L Carlson
On the Mac try pipe(pbpaste) instead of clipboard. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-

Re: [R] Reading one column .csv file

2012-08-15 Thread Berend Hasselman
On 15-08-2012, at 23:11, darnold wrote: Peter, Interesting. Never heard of copying from the clipboard. I am also on a MacBook Pro, but I cannot get it to work. So you are running Mac OS X? 1. I selected the column of data (including the header) in Excel. 2. Selected Edit-Copy.

Re: [R] dimnames in an array(I'll be grateful if this message will be passed to all list users)

2012-08-15 Thread R. Michael Weylandt
On Wed, Aug 15, 2012 at 3:57 AM, aleksandr shfets a_shf...@mail.ru wrote: Hi Michael, Thanks for help on double brackets: I wasn't aware of this use of them. I went back to readjust my array so the dimnames(data11a)[[2]] would have two elements, and remade the array to include the new

Re: [R] Reading one column .csv file

2012-08-15 Thread darnold
Tried that already. My clipboard: x 2 3 4 5 My attempt: a - read.delim(pipe(pbpaste)) Warning message: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'pbpaste' And again: a -

Re: [R] Basic question -loading data

2012-08-15 Thread John
On Wed, 15 Aug 2012 17:59:53 +1000 Dinuk Jayasuriya dinuk.jayasur...@anu.edu.au wrote: Hi Jeff, Thank you - your comment was much appreciated. I'm now running an ordered probit regression and get the following error: Error in family$linkfun(mustart) : Value 1.125 out of range (0, 1)

[R] sum predictions by hand

2012-08-15 Thread Andrei Arsene Simion
Hi, If I do a standard svm regression with e1071 x - seq(0.1, 5, by = 0.05) y - log(x) + rnorm(x, sd = 0.2) m - svm(x, y) we can do predict(m,x) to get the fitted values. But what if I wan tho get them by hand? Seem to me like it should be w = t(m$coefs)%*%m$SV x.scaled = scale(x,

Re: [R] twitteR location?

2012-08-15 Thread John
On Wed, 15 Aug 2012 14:52:44 +1000 Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: That worked but how do you get the location of one particular tweet. So from that list of 10, say the first tweet, is there a way to say at exactly what location it was tweeted? You are teetering

  1   2   >