Re: [R] R Beginner : Loop and adding row to dataframe

2012-07-23 Thread Henrik Singmann
Hi Phil, I think you want: merge(listA, listB, by = NACE) which will give you: NACE Name aaa bbb ccc 11a a a c 21a a a c 31a a a c 42b a a c 52b a a c 63c a a c If you want to get rid of the Name column, the

Re: [R] [RsR] How does rlm in R decide its w weights for each IRLSiteration?

2012-07-23 Thread Maheswaran Rohan
Hi Valentin, If the contamination is mainly in the response direction, M-estimator provides good estimates for parameters and rlm can be used. Rohan -Original Message- From: r-sig-robust-boun...@r-project.org [mailto:r-sig-robust-boun...@r-project.org] On Behalf Of Valentin Todorov

Re: [R] Reorder in decreasing order

2012-07-23 Thread Duncan Murdoch
On 12-07-22 5:33 PM, arun wrote: Hi Duncan, That was my original suggestioin. His reply suggests that it is not that he wanted. I didn't see your reply. Maybe you sent it privately? In any case, I think it is up to Sverre to give an example of what he wants, since your suggestion,

Re: [R] taylor expansions with real vectors

2012-07-23 Thread bilelsan
Hi, Thanks a lot for answer. It is what I mean. But the code does not seem to work ( Le Jul 19, 2012 à 8:52 AM, Petr Savicky [via R] a écrit : On Wed, Jul 18, 2012 at 06:02:27PM -0700, bilelsan wrote: Leave the Taylor expansion aside, how is it possible to compute with [R]: f(e) = e1 +

[R] setar function error message

2012-07-23 Thread Ario Ario
Hi all, I have problem to estimate a SETAR model. I always get an error message. Here is the code: ## there are 4175 observation in the series (a). a[1:10,1] [1] 1.496498 1.496602 1.496636 1.496515 1.496515 1.496463 1.496429 1.496549 1.496480 [10] 1.496498 library(tsDyn) selectSETAR(a,

[R] Workspace Question.

2012-07-23 Thread Michael Trianni
I recently installed R version 2.14.1. After a session (not my first) in 2.14.1, I saved the 'workspace image'. I then opened earlier R versions, 2.14.0 2.12.0, and the only objects listed were from the 2.14.1 session. All the work under those previous versions were gone, to my dismay. This

Re: [R] npindex: fitted values of the function itself?

2012-07-23 Thread Kristin
Dear list, I realized my mistake! For those who are interested: what I predicted was in fact G*(X'b*): A single-index model assumes a linear index function for which I obtain the estimated coefficients b*. The predicted probabilities are then G*(X'b*). Indeed, this is equivalent to the

Re: [R] The best solver for non-smooth functions?

2012-07-23 Thread Patrick Burns
There is a new blog post that is pertinent to this question: http://www.portfolioprobe.com/2012/07/23/a-comparison-of-some-heuristic-optimization-methods/ Pat On 18/07/2012 21:00, Cren wrote: # Hi all, # consider the following code (please, run it: # it's fully working and requires just few

Re: [R] easy way to fit saturated model in sem package?

2012-07-23 Thread yrosseel
I will check out the lavaan package. Dear Joshua, The lavaan package may help you. The FIML estimator typically starts with the EM algorithm to estimate the moments of the unrestricted model. There is no 'one-shot' function for it, at the moment, but if you only need those moments, you

Re: [R] Workspace Question.

2012-07-23 Thread Rolf Turner
On 23/07/12 19:36, Michael Trianni wrote: I recently installed R version 2.14.1. After a session (not my first) in 2.14.1, I saved the 'workspace image'. I then opened earlier R versions, 2.14.0 2.12.0, and the only objects listed were from the 2.14.1 session. All the work under those previous

Re: [R] setar function error message

2012-07-23 Thread Pascal Oettli
Hello, Your problem is nto reproducible without the complete a dataset. Regards, Pascal Le 23/07/2012 09:49, Ario Ario a écrit : Hi all, I have problem to estimate a SETAR model. I always get an error message. Here is the code: ## there are 4175 observation in the series (a). a[1:10,1]

[R] 3D scatterplot, using size of symbols for the fourth variable

2012-07-23 Thread elpape
Dear R fans, I would like to create a scatterplot showing the relationship between 4 continuous variables. I thought of using the package scatterplot 3d to have a 3-dimensional plot and then using the size of the symbols to represent the 4th variable. Does anybody know how to do this? I

Re: [R] setar function error message

2012-07-23 Thread Ario Ario
Hi, I apologize for not attaching a complete dataset. The dataset contains only 1000 observations. Please find it in the attachment. Thanks (Ario) On Mon, Jul 23, 2012 at 3:46 PM, Pascal Oettli kri...@ymail.com wrote: Hello, Your problem is nto reproducible without the complete a dataset.

[R] mgcv: Extract random effects from gam model

2012-07-23 Thread janvanhove
Hi everyone, I can't figure out how to extract by-factor random effect adjustments from a gam model (mgcv package). Example (from ?gam.vcomp): library(mgcv) set.seed(3) dat - gamSim(1,n=400,dist=normal,scale=2) a - factor(sample(1:10,400,replace=TRUE)) b - factor(sample(1:7,400,replace=TRUE)) Xa

Re: [R] setar function error message

2012-07-23 Thread Pascal Oettli
Hello, It works for me (with a warning message), by adding this line before the setar procedure: a - as.ts(a) As I don't know the time step, thus it is only a pseudo time-series. Regards, Pascal Le 23/07/2012 18:18, Ario Ario a écrit : Hi, I apologize for not attaching a complete

Re: [R] mgcv: Extract random effects from gam model

2012-07-23 Thread Simon Wood
Hi Jan , coef(mod) will extract the coefficients, including for a. They are labelled and for 'a' are in the same order as levels(a). best, Simon On 23/07/12 10:08, janvanhove wrote: Hi everyone, I can't figure out how to extract by-factor random effect adjustments from a gam model (mgcv

Re: [R] 3D scatterplot, using size of symbols for the fourth variable

2012-07-23 Thread Jim Lemon
On 07/23/2012 06:20 PM, elpape wrote: Dear R fans, I would like to create a scatterplot showing the relationship between 4 continuous variables. I thought of using the package scatterplot 3d to have a 3-dimensional plot and then using the size of the symbols to represent the 4th variable. Does

[R] marginal effect lmer

2012-07-23 Thread Andigo
Hi everybody, I try to calculate and display the marginal effect(s) in a hierarchical model using lmer. Here is my model: m1- lmer(vote2011~ Catholic + Attendance+ logthreshold + West + Catholicproportion+ (Catholic * Catholicproportion) + (Attendance*Catholicproportion) + Catholicproportion²+

[R] help with Loop

2012-07-23 Thread Katrin Ronnenberg
hello there, I'm an R beginner and got plunged into this. I guess my attempts are hopeless so far, so I won't even show them. I want to write a loop, which prints all erroneous values. My definition of erroneous: If the current counts (partridge counts in a hunting district) differ from last

Re: [R] 3D scatterplot, using size of symbols for the fourth variable

2012-07-23 Thread Rui Barradas
Hello, Maybe the plot argument 'cex' will do it. ?par # in particular the entry for 'cex' s3d$points(MI, TD, EG_18, pch = 16, col = Dstarscale, cex=2*(Dstar - min(Dstar) + 0.3)) Multiply 2 into it because the points are very small. Hope this helps, Rui Barradas Em 23-07-2012 09:20,

Re: [R] help with Loop

2012-07-23 Thread Rui Barradas
Hello, Try the following. d - read.table(text= D Y C a 2005 10 a 2006 0 a 2007 9 b 2005 1 b 2006 0 b 2007 1 c 2005 5 c 2006 NA c 2007 4 , header=TRUE) d prn - lapply(split(d, d$D), function(x){ x - x[!is.na(x$C), ] x[c(FALSE, diff(x$C)/x$C[-length(x$C)] -0.5 diff(x$C) -5), ] })

Re: [R] car::Anova - Can it be used for ANCOVA with repeated-measures factors.

2012-07-23 Thread peter dalgaard
On Jul 23, 2012, at 02:48 , John Fox wrote: [snip long discussion which I admit not to have studied in every detail...] Unfortunately, my involvement with this issue has led me to another question. Winer and Kirk both discuss a split-plot ANCOVA in which one has measured a covariate for

Re: [R] Bug in my code (finding nonzero min)

2012-07-23 Thread S Ellison
Strictly, it's calculating the minimum of the positive values in each row. And you could do that with a bit less code using q[,1] - apply(remain, 1, function(x) min(x[x0])) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] 3D scatterplot, using size of symbols for the fourth variable

2012-07-23 Thread ellen pape
Hi, Both options worked fine! Thanks for the help! Regards Ellen On 23 July 2012 13:19, Rui Barradas [via R] ml-node+s789695n4637424...@n4.nabble.com wrote: Hello, Maybe the plot argument 'cex' will do it. ?par # in particular the entry for 'cex' s3d$points(MI, TD, EG_18, pch = 16,

[R] Fwd: 3D scatterplot, using size of symbols for the fourth variable

2012-07-23 Thread ellen pape
Hi, Both options work fine! Thanks! I'll play around with the scripts some more to see which way is the best to visualise the data. Regards Ellen -- Forwarded message -- From: ellen pape ellen.p...@gmail.com Date: 23 July 2012 14:40 Subject: Re: 3D scatterplot, using size of

Re: [R] [RsR] How does rlm in R decide its w weights for each IRLSiteration?

2012-07-23 Thread S Ellison
rlm includes an MM estimator. S Ellison -Original Message- From: Maheswaran Rohan [mailto:mro...@doc.govt.nz] Sent: 22 July 2012 23:08 To: Valentin Todorov; S Ellison Cc: r-sig-rob...@r-project.org; r-help Subject: RE: [RsR] How does rlm in R decide its w weights for each

Re: [R] Speeding up a loop

2012-07-23 Thread wwreith
1.15 60 0.553555415 0.574892872 1.15 60 0.563183983 0.564029359 Shouldn't the function row out the second one, since it it higher in position 3 and lower in position 4 i.e. it should not all be yes? -- View this message in context:

Re: [R] Workspace Question.

2012-07-23 Thread Robert Baer
The objects from an R session are saved in the RWorking directory of the session. The answer to your question will depend on whether you started the different versions of R using shortcuts located in different folders or the same folder. The objects should not be automatically deleted so I

Re: [R] marginal effect lmer

2012-07-23 Thread John Fox
Dear Andigo, You don't say what problems you encountered, and I don't know how to interpret the superscript 2s in your lmer() command, but if the intention is to fit a quadratic in Catholicproportion, then you can use poly(Catholicproportion, 2) in formulating the model. That way, effect()

[R] Sparse Logistic PCA package?

2012-07-23 Thread Ashley Bonner
Hi UseRs, Has anyone come across an R package (or any other software) that can implement Sparse Logistic PCA (an extension to Sparse PCA that works in the presence of binary-type data)? Specifically, I have read the 2010 paper by Lee et al. called Sparse Logistic Principal Component Analysis for

[R] CSV format issues

2012-07-23 Thread Guillaume Meurice
Dear all, I have some encoding problem which I'm not familiar with. Here is the case : I'm read data files which can have been generated from a computer either with global settings in french or in english. Here is an exemple ouf data file : * English output Time,Value 17,-0.0753953

[R] Help with Portfolio Optmization

2012-07-23 Thread MaheshT
Hi, I need some help with Portfolio Optimization problem. I am trying to find the minimum variance portfolio subjected to constraints on weights like /x1 w1 x2 x3 w2 x4/i I need help with solving for the minimum variance portfolio as solve.QP doesn't allow me to specify the lower boundaries.

[R] Large data set

2012-07-23 Thread Lorcan Treanor
Hi all, Have a problem. Trying to read in a data set that has about 112,000,000 rows and 8 columns and obviously enough it was too big for R to handle. The columns are mode up of 2 integer columns and 6 logical columns. The text file is about 4.2 Gb in size. Also I have 4 Gb of RAM and 218 Gb of

[R] date conversation

2012-07-23 Thread paladini
Hello, when I convert a factor like this a=01.10.2009 into a date using b=strptime(a, format=%d. %m. %Y). It works very well. But when I try to convert c = 2009/10 into a date using d=strptime(c, format=%Y/%m) it doesnt work at all. I get d=NA. What did I do wrong? Thank you very much for your

[R] accumulation curve

2012-07-23 Thread Michaël Aubert
Hello, I am actually trying to perform accumulation curves with the function accumcomp (package BiodiversityR). I am working on a data set species - sampling date - sampling sites and I would like to see the impact of sampling pressure (increasing sampling date) on species richness.

Re: [R] FIML using lavaan returns zeroes for coefficients

2012-07-23 Thread Andrew Miles
Thanks for the helpful explanation. As to your question, I sometimes use lavaan to fit univariate regressions simply because it can handle missing data using FIML rather than listwise deletion. Are there reasons to avoid this? BTW, thanks for the update in the development version. Andrew

Re: [R] Adding gamma and 3-parameter log normal distributions to L-moments ratio diagram lmrd()

2012-07-23 Thread J. R. M. Hosking
On 2012-07-22 03:31, otsvetkova wrote: How to adapt this piece of code but for: - gamma distribution - 3 parameter log normal More specifically, where can I find the specification of the parameter (lmom) for pelgam() and pelln3()? Lmom package info just gives: pelgam(lmom), lelln3(lmom), where

[R] Circular predictor in MARS

2012-07-23 Thread Pierric de Laborie
Hello, I am currently trying to build a statistical model using MARS (multiple adaptative regression splines) with package library earth v3.2-3 However I could not find a way to add a circular predictor, namely the wind direction [0-360°] . In GAMS (library mgcv) there is the possibility to use

Re: [R] CSV format issues

2012-07-23 Thread jim holtman
try this; looks for strings of numbers with commas and quotes them: x - readLines(textConnection(Time,Value + 32,-7,183246E-02 + 32,05,3,469364E-02)) # process the data putting in quotes on scientific x.new1 - gsub((-?[0-9]+,[0-9]+E-?[0-9]+), '\\1', x) x.new1 [1] Time,Value

Re: [R] date conversation

2012-07-23 Thread jim holtman
You have to supply a 'day' or the date is not known: c = '2009/10' d=strptime(paste0(c, '/1'), format=%Y/%m/%d) d [1] 2009-10-01 On Mon, Jul 23, 2012 at 9:05 AM, paladini palad...@beuth-hochschule.de wrote: Hello, when I convert a factor like this a=01.10.2009 into a date using

Re: [R] Large data set

2012-07-23 Thread jim holtman
First of all, try to determine the smallest file you can read with an empty workspace. Once you have done that, then break up your file into that size sets and read them in. The next question is what do you want to do with 112M rows of data. Can you process them a set a time and then aggregate

Re: [R] CSV format issues

2012-07-23 Thread Duncan Murdoch
On 23/07/2012 9:06 AM, Guillaume Meurice wrote: Dear all, I have some encoding problem which I'm not familiar with. Here is the case : I'm read data files which can have been generated from a computer either with global settings in french or in english. Here is an exemple ouf data file : *

Re: [R] CSV format issues

2012-07-23 Thread peter dalgaard
On Jul 23, 2012, at 15:06 , Guillaume Meurice wrote: Dear all, I have some encoding problem which I'm not familiar with. Here is the case : I'm read data files which can have been generated from a computer either with global settings in french or in english. Here is an exemple ouf

[R] Creating panel data

2012-07-23 Thread Jeff
I'm new to R. I am trying to create panel data with a slight alteration from a typical dataset. At present, I have data on a few hundred people with the dates of occurrences for several events (like marriage and employment). The dates are in year/quarter format, so 68.0

Re: [R] contingency tables in R

2012-07-23 Thread David L Carlson
Your first example creates a four-way table (sex, familyhist, numrisk, hypertension) and your second example adds four more risk factors. From the second example, you can use margin.table() to sum across any set of dimensions and ftable() to present the results of different slices. You should be

Re: [R] Creating panel data

2012-07-23 Thread Bert Gunter
Sounds like you would find it worthwhile to read a good Intro R tutorial -- like the one that comes shipped with R. Have you done so? If not, why not? If so, how about the data import/export manual? I certainly wouldn't guarantee that these will answer all your questions. They're just places to

Re: [R] EM for missing data

2012-07-23 Thread David L Carlson
This is chopped off. What happens next is important. EM can be used to compute covariance matrices and conducts the statistical analysis without imputing any missing values or it can be used to impute missing values to create one or multiple data sets. You might find Missing Data by Paul D.

Re: [R] Excel file Import - to Matrix format

2012-07-23 Thread David L Carlson
Use read.table() with the row.names= argument set to the column number that represents the row.names (presumably 1) and then convert the data.frame to a matrix: A - read.table(file=fname.csv, row.names=1) B - as.matrix(A) If you are using Windows, you can open Excel, copy the data, Copy and then

[R] extracting and combining statistics like BIC, Rsquare

2012-07-23 Thread Niklas Fischer
Dear all, I'd like to ask you if there is a way to combine Rsquare, BIC, AIC values after making imputations in R. There are five data sets I imputed with mice and and than when I create new variable and apply ologit model, I could extract Beta coefficients and its standard errors, but don't

Re: [R] Speeding up a loop

2012-07-23 Thread Rui Barradas
Hello, I think this is a boundary issue. In your op you've said less not less than or equal to. Try using = and = to see what happens, I bet it solves it. Rui Barradas Em 23-07-2012 14:43, wwreith escreveu: 1.15 60 0.553555415 0.574892872 1.15 60 0.563183983

Re: [R] Creating panel data

2012-07-23 Thread Jeff
At 10:38 AM 7/23/2012, you wrote: You might also find it useful to use Hadley Wickham's plyr and/or reshape2 packages, whose aim is to standardize and simplify data manipulation tasks. Cheers, Bert I have already used R enough to have correctly imported the actual data. After import, it is

[R] drop1, 2-way Unbalanced ANOVA

2012-07-23 Thread Nathan Miller
Hi all, I've spent quite a lot of time searching through the help lists and reading about how best to run perform a 2-way ANOVA with unbalanced data. I realize this has been covered a great deal so I was trying to avoid adding yet another entry to the long list considering the use of different

Re: [R] Creating panel data

2012-07-23 Thread John Kane
This looks really ugly but it 'may' do what you want. I was too lazy to generate enough raw data to check. Note i changed the names in x as they were a bit clumsy. x - data.frame( id = c(1,2), Event1= c(1,0), YEvent1 = c(68.25,0), Event2 = c(0,1), YEvent2 = c(0,68.5)) y -

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread Frank Harrell
It would make much more sense to convert in the opposite direction. Frank willsurg wrote I am looking to hire someone to convert a small bit of R code into SAS code. The R code is about 2 word pages long and uses Snell's law to convert likert scales. If you are willing to look at this, or

Re: [R] image function

2012-07-23 Thread Jean V Adams
Did you try this? image(x, xlim=c(0, 100), ylim=c(0, 100)) Jean li li hannah@gmail.com wrote on 07/22/2012 09:28:33 PM: Dear all, I have a question regarding changing the xlim and ylim in the function image(). For example, in the following code, how can I have a heatmap with

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread Barry Rowlingson
On Mon, Jul 23, 2012 at 6:19 PM, Frank Harrell f.harr...@vanderbilt.edu wrote: It would make much more sense to convert in the opposite direction. Frank I got the fear when I saw the unit of R code length was '[presumably MS] Word pages'. We had one student who wrote all her R code in MS

Re: [R] Unique Values per Column

2012-07-23 Thread Jean V Adams
Bert, Is it important that you end up with a data frame? If not, it would be very easy to generate a list with the unique values for each column. For example: df - data.frame(v1 = sample(5, 20, T), v2 = sample(7, 20, T), v3 = sample(9, 20, T), v4 = sample(11, 20, T)) lapply(df,

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread jim holtman
Why not just call the R code from SAS since SAS is supposed to have an interface for using R within SAS? On Mon, Jul 23, 2012 at 1:26 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Mon, Jul 23, 2012 at 6:19 PM, Frank Harrell f.harr...@vanderbilt.edu wrote: It would make much more

Re: [R] drop1, 2-way Unbalanced ANOVA

2012-07-23 Thread John Fox
Dear Nate, I don't want to repeat everything that I previously said on this subject, both on this email list and more generally, but briefly: The reason to do so-called type-II tests is that they're maximally powerful for the main effects if the interactions are nil, which is precisely the

Re: [R] Help with Portfolio Optmization

2012-07-23 Thread R. Michael Weylandt
On Mon, Jul 23, 2012 at 6:24 AM, MaheshT mahesh.m...@gmail.com wrote: Hi, I need some help with Portfolio Optimization problem. I am trying to find the minimum variance portfolio subjected to constraints on weights like /x1 w1 x2 x3 w2 x4/i I need help with solving for the minimum

Re: [R] drop1, 2-way Unbalanced ANOVA

2012-07-23 Thread peter dalgaard
On Jul 23, 2012, at 18:58 , Nathan Miller wrote: Hi all, I've spent quite a lot of time searching through the help lists and reading about how best to run perform a 2-way ANOVA with unbalanced data. I realize this has been covered a great deal so I was trying to avoid adding yet another

[R] looking to hire person to convert R to SAS

2012-07-23 Thread William N. Wang
Hi, I am looking to hire someone to convert a small bit of R code into SAS code. The R code is about 2 word pages long and uses Snell's law to convert likert scales. If you are willing to look at this, or could point me to someone who would, it would be very much appreciated. Thanks in advance!

Re: [R] Maximum number of patterns and speed in grep

2012-07-23 Thread mdvaan
Hi, I have a minor follow-up question: In the example below, ann and nn in the third element of text are matched. I would like to ignore all matches in which the character following the match is one of [:alpha:]. How do I do this without removing the ignore.case = TRUE argument of the strapply

Re: [R] FIML using lavaan returns zeroes for coefficients

2012-07-23 Thread ya
Hi Miles and Yves, I agree with Miles to use lavaan to do regression so that FIML can be used. This is one of the amazing things that lavaan can do. If lavaan can handle missing values for the univariate regression using FIML, I don't see why you want to avoid it. ya From: Andrew Miles

Re: [R] marginal effect lmer

2012-07-23 Thread Andigo
Dear John, yes, the superscript shall say that the quadratic term of Catholicproportion is included as well (plus the interaction terms with it). In my dataset the quadratic Catholicproportion is already included as a variable of its own, so it should be fine or do I have to use the syntax with

Re: [R] Remove row.names column in dataframe

2012-07-23 Thread thecathack
try row.names(your.data.frame)-NULL Salut! -- View this message in context: http://r.789695.n4.nabble.com/Remove-row-names-column-in-dataframe-tp856647p4637486.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]

[R] extract values from summary of function indval of the package labdsv

2012-07-23 Thread katse
Hi everybody, I am doing Indicator species analysis using the function indval from the package labdsv. For further analysis I need the values Number of Significant Indicators and Sum of Indicator Values that is calculated from the summary on my indval object.

[R] VARMA

2012-07-23 Thread aedudek
Hi all,   I need to estimate the coefficient of Varma model with linear constraints. The packages that I found that deal with Varma are dlm and dse. Does any of them can be used in that case? I will be very grateful for any help.   Anna Dudek AGH University of Science and Technology in Krakow

[R] How to use color shade in Stacked bar plot?

2012-07-23 Thread Manish Gupta
Hi, I am wokring on stacked R plot but i want to use shade color of red for each stack and corresponding legend. How can i use it? Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-use-color-shade-in-Stacked-bar-plot-tp4637468.html Sent from the R help mailing

[R] Solving equations in R

2012-07-23 Thread Diviya Smith
Hi there, I would like to solve the following equation in R to estimate 'a'. I have the amp, d, x and y. amp*y^2 = 2*a*(1-a)*(-a*d+(1-a)*x)^2 test data: amp = 0.2370 y= 0.0233 d= 0.002 x= 0.091 Can anyone suggest how I can set this up? Thanks, Diviya [[alternative HTML version

[R] help building dataset

2012-07-23 Thread walcotteric
I'm having trouble building a dataset. I'm working with Census data from Brazil, and the particular set I'm trying to get into right now is a microdata sample which has 4 data files that are saved at .txt files full of numbers. The folder also has lot of excel sheets and other text files

Re: [R] tm_map help

2012-07-23 Thread yofiffy
I encountered this error when I used readLines on a text file, and some of the lines were empty. Once I extracted empty rows it worked fine, EG Text = readLines(~/text.txt) extracts = which(Text == ) Text = Text[-extracts] -- View this message in context:

Re: [R] FIML using lavaan returns zeroes for coefficients

2012-07-23 Thread Joshua Wiley
Hi Andrew, I do not think there is a reason to avoid it for univariate regression other than: 1) as was stated the predictors must be continuous 2) it will be slower (non issue for a handful of regressions on a few thousand cases but for people doing thousands of regression on millions of

Re: [R] Solving equations in R

2012-07-23 Thread Duncan Murdoch
On 23/07/2012 2:46 PM, Diviya Smith wrote: Hi there, I would like to solve the following equation in R to estimate 'a'. I have the amp, d, x and y. amp*y^2 = 2*a*(1-a)*(-a*d+(1-a)*x)^2 test data: amp = 0.2370 y= 0.0233 d= 0.002 x= 0.091 Can anyone suggest how I can set this up? See

Re: [R] How to use color shade in Stacked bar plot?

2012-07-23 Thread R. Michael Weylandt
Far too vague a question but perhaps something like barplot(1:12, col = c(brown1, brown3, brown2, firebrick, firebrick1, firebrick4, firebrick3, firebrick2, darkred, red4, red3)) legend(topleft, col = c(brown1, brown3, brown2, firebrick, firebrick1, firebrick4, firebrick3, firebrick2, darkred,

Re: [R] help building dataset

2012-07-23 Thread R. Michael Weylandt
Weren't you told to take a look at read.table() (both the function help and the manual describing it)? If the rows correspond in each data file, something like do.call(cbind, lapply(dir(), read.table)) will possibly align the results of read.table()-ing each file in your directory. To parse

Re: [R] Solving equations in R

2012-07-23 Thread Berend Hasselman
Diviya Smith wrote Hi there, I would like to solve the following equation in R to estimate 'a'. I have the amp, d, x and y. amp*y^2 = 2*a*(1-a)*(-a*d+(1-a)*x)^2 test data: amp = 0.2370 y= 0.0233 d= 0.002 x= 0.091 Can anyone suggest how I can set this up? This should help

[R] igraph node placement

2012-07-23 Thread Steven Wolf
Hello R users, I've just defended my PhD dissertation, and I'm engaging in discussions with the ruler lady. She has some problems with my figures. The problem is that my nodes overlap the text that I've put inside of them. Here is a url for the figure:

Re: [R] turning R expressions into functions?

2012-07-23 Thread Hadley Wickham
One of the things I would love to add to my package would be the ability to compare more than two expressions in one call. But unfortunately, I haven't found out so far whether (and if so, how) it is possible to extract the elements of a ... object without evaluating them. Have a look at

Re: [R] EM for missing data

2012-07-23 Thread Jie
I am not a professional and sorry if I bring any incorrect concept. When you say impute, I guess you want to replace the missing part by its conditional expection. This is not safe if you do non-linear opearations later. An simple example is the expection of quadratic form, E(X'AX) !=

Re: [R] marginal effect lmer

2012-07-23 Thread John Fox
Dear Andigo, On Mon, 23 Jul 2012 07:42:49 -0700 (PDT) Andigo andreas.goldb...@unige.ch wrote: Dear John, yes, the superscript shall say that the quadratic term of Catholicproportion is included as well (plus the interaction terms with it). In my dataset the quadratic Catholicproportion is

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread willsurg
I will see if my SAS programer can do that, He initially had no idea what R was, which is what prompted me looking for someone who knew R -- View this message in context: http://r.789695.n4.nabble.com/Hire-person-to-convert-R-code-to-SAS-tp4637436p4637497.html Sent from the R help mailing list

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread willsurg
interesting idea, the problem is that I have a dataset of 27,000 and already of coded in SAS. I have the R code and just need someone to duplicate it in SAS. :) -- View this message in context: http://r.789695.n4.nabble.com/Hire-person-to-convert-R-code-to-SAS-tp4637436p4637496.html Sent

Re: [R] turning R expressions into functions?

2012-07-23 Thread S Ellison
One of the things I would love to add to my package would be the ability to compare more than two expressions in one call. But unfortunately, I haven't found out so far whether (and if so, how) it is possible to extract the elements of a ... object without evaluating them. Have a look at

Re: [R] turning R expressions into functions?

2012-07-23 Thread Hadley Wickham
On Mon, Jul 23, 2012 at 2:12 PM, S Ellison s.elli...@lgcgroup.com wrote: One of the things I would love to add to my package would be the ability to compare more than two expressions in one call. But unfortunately, I haven't found out so far whether (and if so, how) it is possible to extract

[R] R2wd package wdGet() error

2012-07-23 Thread Jean V Adams
I am having trouble using the R2wd package. The last time I used it successfully, I was running an earlier version of R and an earlier version of Word with an earlier Windows OS. I'm not sure which if any of these changes might be contributing to the problem. Right now I'm using R

Re: [R] Hire person to convert R code to SAS

2012-07-23 Thread Ranjan Maitra
You actually have a SAS programmer who has never heard of R? On Mon, 23 Jul 2012 11:52:14 -0700 willsurg surg...@mac.com wrote: I will see if my SAS programer can do that, He initially had no idea what R was, which is what prompted me looking for someone who knew R -- View this

Re: [R] turning R expressions into functions?

2012-07-23 Thread William Dunlap
list(...) evaluates the things in ... E.g., f0 - function(x, ...) list(...) f0(1, warning(Hmm), stop(Oops), cat(some output\n))[[2]] Error in f0(1, warning(Hmm), stop(Oops), cat(some output\n)) : Oops In addition: Warning message: In f0(1, warning(Hmm), stop(Oops), cat(some

Re: [R] turning R expressions into functions?

2012-07-23 Thread Bert Gunter
Bill: Is there some reason to prefer your odd idiom to match.call, perhaps as as.list(match.call()), as proposed by Hadley? -- Bert On Mon, Jul 23, 2012 at 2:25 PM, William Dunlap wdun...@tibco.com wrote: list(...) evaluates the things in ... E.g., f0 - function(x, ...) list(...)

Re: [R] turning R expressions into functions?

2012-07-23 Thread Bert Gunter
... or better still, the idiom used in update.default: match.call(expand.dots=FALSE)$... ? -- Bert On Mon, Jul 23, 2012 at 2:45 PM, Bert Gunter bgun...@gene.com wrote: Bill: Is there some reason to prefer your odd idiom to match.call, perhaps as as.list(match.call()), as proposed by Hadley?

Re: [R] turning R expressions into functions?

2012-07-23 Thread William Dunlap
I tend not to use match.call for this because it feels like I'm repeating work (argument matching) that has already been done. Also, match.call's output needs to be processed a bit to get the expressions. The following 2 functions give the same results, a pairlist of the unevaluated arguments

Re: [R] Creating panel data

2012-07-23 Thread David Winsemius
On Jul 23, 2012, at 10:33 AM, Jeff wrote: At 10:38 AM 7/23/2012, you wrote: You might also find it useful to use Hadley Wickham's plyr and/or reshape2 packages, whose aim is to standardize and simplify data manipulation tasks. Cheers, Bert I have already used R enough to have correctly

Re: [R] R2wd package wdGet() error

2012-07-23 Thread Robert Baer
On 7/23/2012 4:25 PM, Jean V Adams wrote: I am having trouble using the R2wd package. The last time I used it successfully, I was running an earlier version of R and an earlier version of Word with an earlier Windows OS. I'm not sure which if any of these changes might be contributing to the

[R] translating IDL to R

2012-07-23 Thread Tom Roche
I would appreciate * guidance regarding translation of IDL routines to R, generally * assistance translating two IDL routines to R, specifically Why I ask: I'm slowly learning how to do atmospheric modeling. One language that has been been popular in this space is IDL

Re: [R] translating IDL to R

2012-07-23 Thread Michael Sumner
R can do all this, but you'll need to get into specifics a little more. Most of your code is covered by R's ?read.table, ?data.frame, ?array, ?file and ?Extract. See the ncdf (or ncdf4 or RNetCDF) package for examples that will look quite similar to the IDL code that opens a NetCDF file. You

[R] Convert Package Interest?

2012-07-23 Thread Stephen Sefick
I am thinking about submitting a package to CRAN that contains some units conversion functions that I use on a regular basis. Would this be helpful to the community, or would it be better to keep this as a personal package? I don't want to clutter CRAN. many thanks, -- Stephen Sefick

Re: [R] Convert Package Interest?

2012-07-23 Thread Gabor Grothendieck
On Mon, Jul 23, 2012 at 8:12 PM, Stephen Sefick sas0...@auburn.edu wrote: I am thinking about submitting a package to CRAN that contains some units conversion functions that I use on a regular basis. Would this be helpful to the community, or would it be better to keep this as a personal

Re: [R] Creating panel data

2012-07-23 Thread Jeff
At 06:33 PM 7/23/2012, David Winsemius wrote: I didn't see a clear way to use either reshape() or the plyr/reshape2 packages to do this, (but would enjoy seeing an example that improved my understanding on this path) so I just looked at your x and then created a scaffold with the number of

Re: [R] Convert Package Interest?

2012-07-23 Thread Spencer Graves
If you haven't already, you might try findFn in the sos package to look for other functions that do things similar to what your functions do. If your package offers some functionality not present in other packages, I'd encourage you to submit it to CRAN. Again, if you haven't already done

Re: [R] Convert Package Interest?

2012-07-23 Thread Rolf Turner
On 24/07/12 12:12, Stephen Sefick wrote: I am thinking about submitting a package to CRAN that contains some units conversion functions that I use on a regular basis. Would this be helpful to the community, or would it be better to keep this as a personal package? I don't want to clutter

  1   2   >