[R] how to convert a vector to an upper matrix

2011-06-09 Thread Zhishi Wang
Hi all, If I have a vector A<-1:6, I would like to convert A to an upper matrix M=[0 1 2 3 ; 0 0 4 5 ; 0 0 0 6; 0 0 0 0]. That is, if the length of the known vector is n, then the order m of the matrix I'd like to have should satisfy m(m-1)/2=n How could I do this in R? I really don't want to do i

Re: [R] How to assess the accuracy of fitted logistic regression using glm

2011-06-09 Thread Xiaobo Gu
Hi Professor Brian, Thanks for your reply. I think there are many statisticians here, and it is somehow R related, hoping someone can help me. I have done a simple test, using a sample csv data which I post if need. donut <- read.csv(file="D:/donut.csv", header = TRUE); donut[["color"]] <- as.f

Re: [R] merge large number of raster objects

2011-06-09 Thread Henrik Bengtsson
...and ?mget for retrieving multiple objects as a list. /Henrik On Thu, Jun 9, 2011 at 10:32 PM, Henrik Bengtsson wrote: > See ?get and ?do.call.  That should be enough. > > ?Reduce may be an alternative for do.call(), but could also be less > memory efficient. > > My $.02 > > /Henrik > > On Thu

Re: [R] merge large number of raster objects

2011-06-09 Thread Henrik Bengtsson
See ?get and ?do.call. That should be enough. ?Reduce may be an alternative for do.call(), but could also be less memory efficient. My $.02 /Henrik On Thu, Jun 9, 2011 at 7:57 PM, Ben Zaitchik wrote: > Hello, > > I have a large number of raster objects in memory, with names RH100, RH101, > RH

[R] Linear multivariate regression with Robust error

2011-06-09 Thread Barjesh Kochar
Dear all, i am doing linear regression with robust error to know the effect of a (x) variable on (y)other if i execute the command i found positive trend. But if i check the effect of number of (x.x1,x2,x3)variables on same (y)variable then the positive effect shwon by x variable turns

[R] merge large number of raster objects

2011-06-09 Thread Ben Zaitchik
Hello, I have a large number of raster objects in memory, with names RH100, RH101, RH102, etc. (myobjects <- ls(pattern='^RH')). These rasters are sections of a continuous map, and I would like to combine them using the RasterObject merge tool in package 'raster.' Merge expects an input list

[R] Need help of using R in cox regression model

2011-06-09 Thread Zhibo Hu
Dear all, I am doing estimation of parameters of the cox model, and both partial likelihood and full likelihood method have to be used. I knew the coxph can handle with the partial likelihood. But when I assume the baseline hazard function arbitrarily and use full likelihood to do the estimation,

Re: [R] error with geomap in googleVis

2011-06-09 Thread soid
Hi Markus, Problem solved - Simple upgrade to googleVis 0.2.5 and now all the new charts and geoMaps works fine. A big thank you to you and Google for help and this excellent package! As per your credits, thank you Manoj Ananthapadmanabhan and Anand Ramalingam! Kind regards, Michael Phipps --

[R] smoothScatter function question and adding a legend

2011-06-09 Thread Clayton K Collings
Hello, I have a few questions, regarding the smoothScatter function. I have a scatter plot with more than 500,000 data points for two samples. So, I am wanting to display the density in colors to convince people that my good correlation coefficient is not due to an "influential point effect" an

Re: [R] Question on Manova

2011-06-09 Thread John Fox
Dear Veronika, Is this the Manova() function in the car package? If so, there isn't a fixed limit on the number of variables, although depending upon the size of the data set, available memory, the conditioning of the problem, etc., you might have a problem too big for it to handle. You don't spec

Re: [R] Calculating a mean based on a factor range

2011-06-09 Thread Peter Alspach
Tena koe Sam You could use cut() to convert the depths into your categories and then tapply(). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Sam Albers > Sent: Friday, 10 June 2011 10:10 a.m. > To:

[R] Question on Manova

2011-06-09 Thread Schuster, Veronika
Hi all, Is the Manova in R restricted to a certain amount of variables? I have currently problems building a model with 47 variables. Thanks a lot! Best, Veronika ** This message is intended only for the use o

[R] Item analysis

2011-06-09 Thread Trying To learn again
Hi all, For several reasons I have no used CARN R in monthsI have an idea and I want to retry to learn CRAN R. I know I need to formulate more "intelligent" questions but I will expose and if someone can help me I would be very gratefull I promise to try to learn again The question I hav

Re: [R] scatterplot3d - help assign colors based on multiple conditions

2011-06-09 Thread Karthik Kota
Thanks a lot! This is very helpful. If I have to extend this to one more condition say assign "blue" if both the corresponding labels have "_Tongue_dorsum", is there a straight forward function. Doing something like below is overriding the colors assigned by the first statement. col <- ifelse

[R] nls Error Message - Singular Gradient Matrix

2011-06-09 Thread cahulme-lowe
I've been trying to run some analysis using the nls function in R but keep coming up with an error message which I don't understand how to fix. The message follows here: Error in nls(formula = f.p, data = n.data, start = list(S = 1, a = -0.1, : singular gradient In addition: Warning messages

Re: [R] ggplot2 Histogram with density curve

2011-06-09 Thread Brian Diggs
On 6/7/2011 8:08 AM, wwreith wrote: I am learning ggplot2 commands and I have figured out how to create histograms and density curves but I am not sure how to add a density curve on top of a histogram. Here are the two graphs that I created. ## Histogram t<-rnorm(500) w<-qplot(t, main="Normal R

[R] Calculating a mean based on a factor range

2011-06-09 Thread Sam Albers
Hello all, I have been using an instrument that collects a temperature profile of a water column. The instrument records the temperature and depth any time it takes a reading. I was sampling many times at discrete depth rather than a complete profile of the water column (e.g. interested in 5m, 10m

Re: [R] Rcpp and Object Factories

2011-06-09 Thread Nick Sabbe
You might want to send this message to the Rcpp mailing list at: Rcpp-devel mailing list rcpp-de...@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel It will improve your chances of getting a swift (if not helpful) reply. Nick Sabbe -- ping: nick

Re: [R] lattice plot query

2011-06-09 Thread Dennis Murphy
Hi: Try the following - the illustration below is for exactly one set of panel plots. Adapt as necessary to your situation: # Reorder the levels of subject - in this case I put them in a new variable MyData$subj <- factor(MyData$Subj, levels = c(paste('S', 1:13, sep = ''))) xyplot(value ~ Time |

Re: [R] How to subset based on column name that is a number ?

2011-06-09 Thread peter dalgaard
On Jun 9, 2011, at 21:34 , Mauricio Cornejo wrote: > Hi, > > I have a data frame with column names "1", "2", "3", ... and I'd like to > extract > a subset based on the values in the first column. None of the methods I > tried > worked (below). > > > x <- subset(dframe, 1 = = "My Text") >

Re: [R] Coercing Output from mget() into Proper Data Frame

2011-06-09 Thread ntyson
Nevermind, I found the problem. I was using a variant of the function that was wrong. Quoting "Sarah Goslee" : That's not enough information for us to be able to help you, since there's no reproducible code. Here's the crucial bit: stem_freqs_list <- mget(uniq_stems,stem_dict) stem_f

Re: [R] How to subset based on column name that is a number ?

2011-06-09 Thread Jorge Ivan Velez
Hi Mauricio, Try the following: # using the iris data require(MASS) x <- iris x[x[, 5] == 'setosa',] # and your data dframe[dframe[, 1] == "FY11_Q4", ] HTH, Jorge On Thu, Jun 9, 2011 at 3:34 PM, Mauricio Cornejo <> wrote: > Hi, > > I have a data frame with column names "1", "2", "3", ... and

Re: [R] Coercing Output from mget() into Proper Data Frame

2011-06-09 Thread Sarah Goslee
That's not enough information for us to be able to help you, since there's no reproducible code. Here's the crucial bit: >stem_freqs_list <- mget(uniq_stems,stem_dict) >stem_freqs <- do.call(rbind,stem_freqs_list) What does stem_freqs_list look like? What does stem_freqs look like? dim()

Re: [R] Reshape:cast; error using "..." in formula expression.

2011-06-09 Thread misterbray
Dennis, doing some more research, and it seems you actually can include the ... term directly in the formula: cf. page 8 of http://www.had.co.nz/reshape/introduction.pdf (that article also explains why you might want to do so). It seems including the ... term only works, however, when your value co

[R] How to subset based on column name that is a number ?

2011-06-09 Thread Mauricio Cornejo
Hi, I have a data frame with column names "1", "2", "3", ... and I'd like to extract a subset based on the values in the first column. None of the methods I tried worked (below). x <- subset(dframe, 1 = = "My Text") x <- subset(dframe, "1" = = "My Text") x <- subset(dframe, names(dframe)[1]

[R] Trying to make code more efficient

2011-06-09 Thread Abraham Mathew
I have a repetative task in R and i'm trying to find a more efficient way to perform the following task. lst <- list(roots = c("car insurance", "auto insurance"), roots2 = c("insurance"), prefix = c("cheap", "budget"), prefix2 = c("low cost"), suffix = c("quote", "quotes

Re: [R] Reshape:cast; error using "..." in formula expression.

2011-06-09 Thread misterbray
Wow---Dennis, your answer makes me feel good about humanity. Thank you; you've made my day. Yours, Rob -- View this message in context: http://r.789695.n4.nabble.com/Reshape-cast-error-using-in-formula-expression-tp3584721p3586482.html Sent from the R help mailing list archive at Nabble.com. __

[R] missing values and error message

2011-06-09 Thread Anglin, Morris
Hello forum, I am using R to do some Exploratory analysis on my data resulting in the following 4 plots. #1- Histogram of the variable; #2- Kernel density estimation of the variable; #3- Normal Q-Q plot ; #4- Box-plot of the variable. The error message comes in when i try to plot # 2 above when

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-09 Thread stefan.d...@gmail.com
thanks for the hint, Kjetil. That looks more like what I am looking for. Thanks for all your mails! Best, Stefan On Wed, Jun 8, 2011 at 11:25 PM, Kjetil Halvorsen wrote: > see inline below. > > On Wed, Jun 8, 2011 at 12:37 PM, Anupam wrote: >> It is difficult for someone from a statistical frame

[R] Coercing Output from mget() into Proper Data Frame

2011-06-09 Thread ntyson
Hello R-philes: I have the following function that gets the output of mget() and converts it to a data frame to return. What I am finding is that the dimensions are wrong. Basically, I get: bridesmaid wed u see m gt lt like love X.0 dress pagetrack one go X3 get 1 56 35 27 30

[R] Coercing Output from mget() into Proper Data Frame

2011-06-09 Thread ntyson
Hello R-philes: I have the following function that gets the output of mget() and converts it to a data frame to return. What I am finding is that the dimensions are wrong. Basically, I get: bridesmaid wed u see m gt lt like love X.0 dress pagetrack one go X3 get 1 56 35 27 30

[R] package.sk​eleton() does not create 'data' folder

2011-06-09 Thread Nipesh Bajaj
Hi again, yesterday I mailed this query however I could not see this on the mail list. Therefore, I am reposting it again. I was using package.skeleton() function to create the skeleton of my package in windows. Here is my attempt: rm(list = ls()) setwd("F:/R_PackageBuild") package.skeleton("tria

[R] Rcpp and Object Factories

2011-06-09 Thread Michael King
Hello, I'm not exactly sure how to ask this question, but let me give it a shot... Is it possible (easy) to use Rcpp Modules in conjunction with object factories? For example what I am trying to do is something like this: // c++ classes class Foo { public: void do_something() {}; }; clas

Re: [R] scatterplot3d - help assign colors based on multiple conditions

2011-06-09 Thread Uwe Ligges
On 09.06.2011 16:51, Karthik Kota wrote: Hi I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want t

[R] Help on survival analysis

2011-06-09 Thread Ronaldo Reis Junior
Hi, I need a help in a survival analysis using survreg function with weibull distribution from survival package. Look the data sample: ## Start of script dados <- structure(list(TFD = c(20L, 34L, 1L, 2L, 3L, 3L, 50L, 26L, 1L, 50L, 21L, 3L, 13L, 11L, 22L, 50L, 50L, 1L, 50L, 9L, 50L, 1L,

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread yrosseel
On 06/09/2011 06:06 PM, R Help wrote: I am using missing = 'fiml', which would require estimating intercepts. I figured they would effect my overall model fit, but can I still estimate my loading coefficients the same way? Yes, no problem. Yves Rosseel http://lavaan.org _

Re: [R] error with geomap in googleVis

2011-06-09 Thread Mike Marchywka
I still got blanks with Firefox with the two examples below, I put html up here if you want to look at it, http://98.129.232.232/xxx.html I just downloaded googlevis from mirror 68 and it claimed it was 0.2.5 ( I thought, but maybe I should check again). install.packages("googleVis",dep=T) l

Re: [R] Adapting R code for different traps

2011-06-09 Thread Jonathan Daily
OK, Assume all your trap names are stored in a vector trap.names. Does: sapply(trap.names, FUN = function(x) { tmp. <- outer(release.days[Trap==x],collection.days.2[Trap==x],'-') tmp <- ifelse(temp.ACAP1>=0,NA,temp.ACAP1) return(apply(temp.ACAP1,2,max,na.rm=TRUE)) } ) Work? I feel there has to b

Re: [R] set.seed and for loop

2011-06-09 Thread Petr Savicky
On Thu, Jun 09, 2011 at 10:14:48AM -0500, Soyeon Kim wrote: > Dear All, > > This is hard to describe so I made a simple example. > set.seed(1001) > total <- 0 > data <- vector("list", 30) > for(i in 1:30) { > data[[i]] <- runif(50) > } > Let's call a data set runif(50). > While the for loop is r

[R] How to display the mean source?

2011-06-09 Thread Bogdan Lataianu
How can I show the mean source in an Anova table, the one which has always degree of freedom 1? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Abraham Mathew
I passed it as an argument to the function because every week I'll need to add keywords to the lst, and that function will make the process more automated. On Thu, Jun 9, 2011 at 10:21 AM, Sarah Goslee wrote: > On Thu, Jun 9, 2011 at 11:53 AM, Abraham Mathew > wrote: > > > > lst is a list wit

[R] Specifying grouping factor for augPred in nlme

2011-06-09 Thread Maria Stager
Dear list, I have a seemingly simple problem with plotting predictions from nlme for which I have not been able to find an answer in the archives nor do I see any mention of this in Pinheiro & Bates 2000. I am using the following model of chick growth for seven different species, with season, nest

Re: [R] histogram - density on y axis and restriction to interval [0, 1]

2011-06-09 Thread Sarah Goslee
Did you read the help for hist? freq: logical; if ‘TRUE’, the histogram graphic is a representation of frequencies, the ‘counts’ component of the result; if ‘FALSE’, probability densities, component ‘density’, are plotted (so that the histogram has a total area of

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Sarah Goslee
On Thu, Jun 9, 2011 at 12:27 PM, Abraham Mathew wrote: > > I passed it as an argument to the function because every week I'll  need to > add keywords to the lst, and that function will make the process more > automated. But it doesn't. lst is hard-coded within your function, so passing somethin

Re: [R] set.seed and for loop

2011-06-09 Thread Uwe Ligges
e commented, minimal, self-contained, reproducible code. __ Information from ESET NOD32 Antivirus, version of virus signature database 6193 (20110609) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, versi

Re: [R] set.seed and for loop

2011-06-09 Thread Duncan Murdoch
different data from the data set gotten from 23th for loop. > How can I get 23th data set without the loop? > > Thank you, > Soyeon > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help &g

Re: [R] set.seed and for loop

2011-06-09 Thread Duncan Murdoch
different data from the data set gotten from 23th for loop. > How can I get 23th data set without the loop? > > Thank you, > Soyeon > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help &g

[R] histogram - density on y axis and restriction to interval [0, 1]

2011-06-09 Thread Christine SINOQUET
Hello, To indicate probability densities instead of counts on a histogram, I specify freq = FALSE. However, I expect that summing all top y coordinates over all the intervals of the histogram will provide 1. 1) v <- c(0.2885, 0.2988, 0.3139, 0.2615, 0.3179, 0.3163, 0.2583, 0.3052, 0.2527,

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Sarah Goslee
On Thu, Jun 9, 2011 at 11:53 AM, Abraham Mathew wrote: > > lst is a list within the function. Then why is it passed as an argument to the function? You can have a function with no arguments, but in this case why, since it would do exactly the same thing every time? Arguments are for passing info

Re: [R] set.seed and for loop

2011-06-09 Thread R Help
th data set without the loop? > > Thank you, > Soyeon > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and

[R] Fwd: Re: residual checking for GAM (mgcv)

2011-06-09 Thread Simon Wood
The plots look reasonable to me. The plot of residuals against linear predictor always looks scary when many of the fitted values are very close to zero, so I tend to look at residuals against sqrt(fitted) in such cases. I don't think that the presence of the zero curve is a reason to reject the

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Carl Witthoft
I would start out by checking out ?switch and getting rid of most of those "if"s . Next: I apologize for the harshness of this, but your code really does qualify for http://thedailywtf.com . Creating a zillion variables dXY, for example, is really poor programming practice. Create a list o

Re: [R] cairoDevice on Windows: succesful installation but does not load

2011-06-09 Thread Prof Brian Ripley
On Thu, 9 Jun 2011, Agustin Lobo wrote: Hi! I've tried to install playwith on Windows XP but, install.packages("cairoDevice") trying URL 'http://cran.at.r-project.org/bin/windows/contrib/2.13/cairoDevice_2.15.zip' Content type 'application/zip' length 52371 bytes (51 Kb) opened URL downloade

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread yrosseel
On 06/09/2011 05:21 PM, R Help wrote: Ok, I think this is the last question I have. My model is producing an estimate of intercepts for my variables along with my loadings. From the documentation it appears that this is controlled by the meanstructure option in cfa. It says that setting it t

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread R Help
I am using missing = 'fiml', which would require estimating intercepts. I figured they would effect my overall model fit, but can I still estimate my loading coefficients the same way? The warning would be helpful, but if I had looked closer into the 'fiml' option I might have been able to figure

Re: [R] any documents

2011-06-09 Thread Mike Marchywka
> Date: Thu, 9 Jun 2011 02:21:21 -0700 > From: wa7@gmail.com > To: r-help@r-project.org > Subject: [R] any documents > > Hi, > > I'm doing a textual analysis of several articles discussing the evolution of > prices in order to give a forecast

[R] Help creating a scatterplot with errorbars using gplot

2011-06-09 Thread Philip.Coryell
I am having a problem creating a scatterplot with error bars using gplot. This is only my second day using R so I am very much a newbie. My x-values (OD600) are: 0.0040 0.0187 0.0473 0.0873 0.2247 0.4240 0.8207 1.3923 1.6110 My y-values (cellconc) are: 2e+06

[R] scatterplot3d - help assign colors based on multiple conditions

2011-06-09 Thread Karthik Kota
Hi I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want to extend the condition to assign a color bas

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Abraham Mathew
lst is a list within the function. Good point about the working directory. Thanks Abraham On Thu, Jun 9, 2011 at 9:35 AM, Sarah Goslee wrote: > Can you boil that down into a short reproducible example? > > For instance, when you run your function at the end > > newdf <- myfunc(lst) > > I can

[R] County map for Alaska, Hawaii, and Puerto Rico

2011-06-09 Thread jaysoap
I have been looking for a way to create a county level map of Alaska and Hawaii in R and cannot find any good example for the life of me. I also need to map Puerto Rico and cannot get a nice map of that either. I used the ggplot2 and maps package to create a perfect map of the mainland US, but I

[R] how can I compute the multidimensional extension of the McDonald's omega by using R?

2011-06-09 Thread netrunner
Hi, I need to perform a computation of reliability of a 5-point Likert scale having 6 items. From a factor analysis I found that my scale is a multidimensional scale (3 factors), so I cannot use Crobach's alpha to compute reliability. I have seen in several papers that it is possibile to use the mu

Re: [R] set.seed and for loop

2011-06-09 Thread jim holtman
t.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > __ Information from ESET NOD32 Antivirus, version of virus signature > databa

Re: [R] Problem with a if statement inside a function

2011-06-09 Thread Sarah Goslee
Can you boil that down into a short reproducible example? For instance, when you run your function at the end > newdf <- myfunc(lst) I can't run it myself because I don't know what lst is. Although it seems not to matter - what are you passing as an argument to the function, since it seems to be

Re: [R] gam() (in mgcv) with multiple interactions

2011-06-09 Thread Simon Wood
I think that the main problem here is that smooths are not constrained to pass through the origin, so the covariate taking the value zero doesn't correspond to no effect in the way that you would like it to. Another way of putting this is that smooths are translation invariant, you get essentia

Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Barry Rowlingson
On Thu, Jun 9, 2011 at 11:09 AM, amrita gs wrote: > I will explain more clearly > > I have an online feedback form which has all the form elements like > radiobuttons,checkboxes,textareas,textboxes etc. I have to get the values of > these form elements and use it for data analysis in R. It wil

Re: [R] Adapting R code for different traps

2011-06-09 Thread bjmjarrett
Hi Jon, Sorry about the lack of information. I'll give the data from one of my traps: (nb. all of the data for each trap is referenced to the start day of the trap. ie ACAP1 started collecting at day 0 but parasitoid releases occurred 266, 259, 225 etc days before collecting took place) Trapc

Re: [R] Adapting R code for different traps

2011-06-09 Thread bjmjarrett
The below works for one trap. Surely there is a quick way to scale it to all of the traps? > temp.ACAP1<-outer(release.days[Trap=="ACAP1"],collection.days.2[Trap=="ACAP1"],'-') > temp.ACAP1<-ifelse(temp.ACAP1>=0,NA,temp.ACAP1) > diff.ACAP1<-apply(temp.ACAP1,2,max,na.rm=TRUE) Thanks Ben -- View

Re: [R] set.seed and for loop

2011-06-09 Thread Samuel Le
ible code. __ Information from ESET NOD32 Antivirus, version of virus signature database 6193 (20110609) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 6193 (20110609

[R] cairoDevice on Windows: succesful installation but does not load

2011-06-09 Thread Agustin Lobo
Hi! I've tried to install playwith on Windows XP but, > install.packages("cairoDevice") trying URL 'http://cran.at.r-project.org/bin/windows/contrib/2.13/cairoDevice_2.15.zip' Content type 'application/zip' length 52371 bytes (51 Kb) opened URL downloaded 51 Kb package 'cairoDevice' successfully

Re: [R] set.seed and for loop

2011-06-09 Thread Duncan Murdoch
On 09/06/2011 11:14 AM, Soyeon Kim wrote: Dear All, This is hard to describe so I made a simple example. set.seed(1001) total<- 0 data<- vector("list", 30) for(i in 1:30) { data[[i]]<- runif(50) } Let's call a data set runif(50). While the for loop is running, 100 data sets are generated. I

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread R Help
Ok, I think this is the last question I have. My model is producing an estimate of intercepts for my variables along with my loadings. >From the documentation it appears that this is controlled by the meanstructure option in cfa. It says that setting it to TRUE includes the intercepts, and sett

Re: [R] set.seed and for loop

2011-06-09 Thread R Help
There are certainly people that would know how the random functions work better than I, but I believe you would need to simulate 22 datasets and then get the 23rd dataset. So to restore the 23rd: set.seed(1001) for(i in 1:22){ garbage = runif(50) } data[[23]] = runif(50) Hope that helps, Sam

Re: [R] Rtools - "The setup files are corrupted" message when trying to install

2011-06-09 Thread Henrik Bengtsson
FYI, Rtools212.exe: File size: 44,224,666 bytes MD5:15ce69dcfc989c43825bedeaa8389aa6 Rtools213.exe: File size: 38,122,354 bytes MD5: 09052655da7c6e8a81f2d398ed6004b5 /Henrik On Thu, Jun 9, 2011 at 6:12 AM, Martyn Byng wrote: > Hi, > > Apologies if this is the wrong list to be sending this ques

[R] Problem with a if statement inside a function

2011-06-09 Thread Abraham Mathew
I have a really long functions, and at the end of the function, I am using a if statement to tag certain keywords based on whether they have certain values contained in them. However, the if statement doesn't seem to work. When I had split up the commands into various functions, it worked fine, b

[R] set.seed and for loop

2011-06-09 Thread Soyeon Kim
Dear All, This is hard to describe so I made a simple example. set.seed(1001) total <- 0 data <- vector("list", 30) for(i in 1:30) { data[[i]] <- runif(50) } Let's call a data set runif(50). While the for loop is running, 100 data sets are generated. I want to restore 23th data set (the data se

Re: [R] Histogram

2011-06-09 Thread Anupam
Thanks. That is the type of graph I want, except with more options and combinations. Here is an example with percent on Y-axis: http://i.imgur.com/pr8M3.jpg This combines both 'histogram' and 'cumulative histogram' type of data. In place of straight lines connecting the points I want step-functions

Re: [R] Adapting R code for different traps

2011-06-09 Thread Jonathan Daily
Hi Ben, Unfortunately, I left the usb cable for my crystal ball at home, and thus have no idea how your data is organized. Could you post an example along with what you expect the output to be? Jon On Thu, Jun 9, 2011 at 7:22 AM, bjmjarrett wrote: > Hi all, > > My code: > >> temp<-outer(release

Re: [R] Rtools - "The setup files are corrupted" message when trying to install

2011-06-09 Thread Uwe Ligges
Still fine when downloading from my location ... Uwe Ligges On 09.06.2011 15:12, Martyn Byng wrote: Hi, Apologies if this is the wrong list to be sending this question to. I am trying to install a copy of the R tools required to create / compile packages on windows. After downloading Rtools

Re: [R] assign a cluster based on a variable

2011-06-09 Thread Dominik P.H. Kalisch
Oh, right. Now I see. Thanks for your help. Dominik On Thu, 09 Jun 2011 15:33:43 +0200, Uwe Ligges wrote: > On 09.06.2011 14:31, Dominik P.H. Kalisch wrote: >> Hi Uwe, >> >> thanks for your help. I didn't know that function (mea culpa)... >> With merge() it works what I want to do. >> But I'm st

Re: [R] assign a cluster based on a variable

2011-06-09 Thread Uwe Ligges
On 09.06.2011 14:31, Dominik P.H. Kalisch wrote: Hi Uwe, thanks for your help. I didn't know that function (mea culpa)... With merge() it works what I want to do. But I'm still interessted, for a learning purpose, why the loop didn't work. So here are the str() results: str(cluster) int [

[R] what is the mistake?? the coding still not function. no result display

2011-06-09 Thread Ungku Akashah
#lda.r > # > #Author:Amsha Nahid, Jairus Bowne, Gerard Murray > #Purpose:Perform Linear Discriminant Analysis (LDA) > # > #Input:Data matrix as specified in Data-matrix-format.pdf > #Output:LDA plot > # > #Notes:Missing values (if any) are replaced by the

[R] Rtools - "The setup files are corrupted" message when trying to install

2011-06-09 Thread Martyn Byng
Hi, Apologies if this is the wrong list to be sending this question to. I am trying to install a copy of the R tools required to create / compile packages on windows. After downloading Rtools from http://www.murdoch-sutherland.com/Rtools/ windows keeps complaining that "The setup files are corrup

Re: [R] assign a cluster based on a variable

2011-06-09 Thread Dominik P.H. Kalisch
Hi Uwe, thanks for your help. I didn't know that function (mea culpa)... With merge() it works what I want to do. But I'm still interessted, for a learning purpose, why the loop didn't work. So here are the str() results: > str(cluster) int [1:18, 1:2] 12051000 12052000 12053000 12054000 1206000

[R] (no subject)

2011-06-09 Thread Ungku Akashah
> # >> # Generate the figures (on screen) >> # >> # Image generation - function definition >> pic_onscr<-function(matrix, title, cex_val=1) > + {x11() + par(mgp=c(5,2,0), # axis margins + # (title, > labels, line) + mar=c(7,4,4,2), # plot margins (b,l,t,r) + > las=

[R] Adapting R code for different traps

2011-06-09 Thread bjmjarrett
Hi all, My code: > temp<-outer(release.days,collection.days,'-') > temp<-ifelse(temp>=0,NA,temp) > release.diff<-apply(temp,2,max,na.rm=TRUE) works for one trap and does what I want. That is, it determines the time difference between the collection date of a trap and date of parasitoid release i

Re: [R] Histogram

2011-06-09 Thread R Help
I'm getting the impression that you're not overly familiar with R? If so then you should really try and read some of the manuals from r-project.org. R is a very complex language and has a steep learning curve. That being said, the command takes a 2xK array, where K is the number of observations

[R] booklet on using R for time series analysis

2011-06-09 Thread Coghlan, Avril
Dear all, I've written a small booklet on using R for time series analysis, available here : http://a-little-book-of-r-for-time-series.readthedocs.org/ It is just a little booklet for beginners like myself (I am studying Stats,

[R] any documents

2011-06-09 Thread rgui
Hi, I'm doing a textual analysis of several articles discussing the evolution of prices in order to give a forecast. if someone can give me a clear approach to this knowing that I work on the package tm. Thank you very much -- View this message in context: http://r.789695.n4.nabble.com/any-doc

Re: [R] Classifying boolean values

2011-06-09 Thread Grifone
Yes, it works! Thanks a lot! Now, i have another question... When i try to use the tree for predict the value of the class with the function "predict" the result is not a vector with TRUE or FALSE value (that is what i want for every row of my test set) but is a sort of matrix with a weight on the

Re: [R] error with geomap in googleVis

2011-06-09 Thread Gesmann, Markus
Hi all, This issue occurs with googleVis 0.2.4 and RJSONIO > 0.7.1. Version 0.2.5 of the googleVis package has been uploaded to CRAN two days ago and should have fixed this issue. Can you please try to update to that version, e.g. from http://cran.r-project.org/web/packages/googleVis/ Further ver

Re: [R] Resources for utilizing multiple processors

2011-06-09 Thread Martin Morgan
On 06/08/2011 08:54 PM, Robin Jeffries wrote: Hello, I know of some various methods out there to utilize multiple processors but am not sure what the best solution would be. First some things to note: I'm running dependent simulations, so direct parallel coding is out (multicore, doSnow, etc). I

Re: [R] Histogram

2011-06-09 Thread R Help
It's difficult to understand what exactly you're looking for without seeing an example, could you post a simple version? imgur.com is a website that lets you quickly upload pictures to share with others. I think your problem can be solved with the type='s' option to the general plot routine. Con

Re: [R] Results of CFA with Lavaan

2011-06-09 Thread R Help
Thanks for the help, the std.lv=TRUE command is exactly what I was looking for. As you stated, it doesn't matter in terms of overall model fit, but my client is more interested in the loadings than the factor variances. In terms of speed, it's just a very large model (7 factors, 90 observations,

Re: [R] Histogram

2011-06-09 Thread Anupam
Nice graphs there. Thanks. I too am looking to make a similar plot, with a difference: I need only the top parts of the many 'histograms' (a step-function like plot for histogram/bar-plots). I already have values for "heights" of bars for x1-x2 intervals computed from a large survey data; I want st

Re: [R] 3D-plotting a 2D-matrix that contains z-values (3rd dimension)

2011-06-09 Thread oliver
On Thu, Jun 09, 2011 at 01:50:17PM +0200, Uwe Ligges wrote: > > > On 09.06.2011 13:37, oliver wrote: > >On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: > >>Well, > >> > >>persp(x, y, z) does exactly what you asked for: it plots tha matrix > >>z along the values given by the vectors x

[R] k-nn hierarchical clustering

2011-06-09 Thread Christian Hennig
Hi there, is there any R-function for k-nearest neighbour agglomerative hierarchical clustering? By this I mean standard agglomerative hierarchical clustering as in hclust or agnes, but with the k-nearest neighbour distance between clusters used on the higher levels where there are at least k>1

Re: [R] 3D-plotting a 2D-matrix that contains z-values (3rd dimension)

2011-06-09 Thread Uwe Ligges
On 09.06.2011 13:37, oliver wrote: On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: Well, persp(x, y, z) does exactly what you asked for: it plots tha matrix z along the values given by the vectors x and y. But I don't have these vectors x and y, so I have to create them just to

Re: [R] 3D-plotting a 2D-matrix that contains z-values (3rd dimension)

2011-06-09 Thread oliver
On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: > Well, > > persp(x, y, z) does exactly what you asked for: it plots tha matrix > z along the values given by the vectors x and y. But I don't have these vectors x and y, so I have to create them just to call persp(). And persp also need

[R] lattice plot query

2011-06-09 Thread Vijayan Padmanabhan
Dear R Group I have the following data for which I am trying to create subject wise lattice plot for a given attribute and product . though the lattice plot is generated, for some reasons that i dont understand in each plot the subject panels take a random order, I would rather want all the plot

Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Santosh Srinivas
You question has multiple answers that you can choose from and the group has been trying to help you. My suggestion would be to write it to the database using PHP and use R to extract and analyze (and write back) the data. The integration of R with web functionality is quite nascent but the Rapac

  1   2   >