[R] Help required to remove \\N

2010-11-06 Thread Mohan L
Dear All, I have .csv file it looks like this : rawdata <- read.csv(file='/home/Mohan/Rworks/tmp/VMList_User.txt',sep='\t' , header=FALSE) > head(rawdata,n=5) TenantDomain Owner Current State 1\\N ROOTadmin Running 2\\N ROOTadmi

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
Hi Richard, > ## for an array with > ## dim(a) == c(3,4,2) > ## a[i,j,k] means select the element in position > ##i + (j-1)*3 + (k-1)*3*4 My understanding; e.g. 1) dim(a) == c(3,4,2) 3 + (4-1)*3 + (2-1)*3*4 3+9+12=24 2) ## dim(a) == c(1,2,1) 1 + (2-1)*3 + (1-1)*3*4 1+3+0=4 3) ## dim(a)

[R] anova(lme.model)

2010-11-06 Thread Sibylle Stöckli
Dear R users Topic: Linear effect model fitting using the nlme package (recomended by Pinheiro et al. 2008 for unbalanced data set). The R help provides much info about the controversy to use the anova(lme.model) function to present numerator df and F values. Additionally different p-values ca

[R] calculate probability

2010-11-06 Thread Jumlong Vongprasert
Dear All I have some problem with calculate probability. Assume I have data with normal distribution with mean = 5 sd = 2. I want to approximate probability = 2.4. I used pnorm(2.4, 5, 2) - pnorm(2.4, 5, 2, lower.tail = FLASE), correct or not. Many Thanks Jumlong __

Re: [R] Help required to remove \\N

2010-11-06 Thread Henrique Dallazuanna
Try this: gsub("N", "BlankSpace", rawdata$Tenant) On Sat, Nov 6, 2010 at 8:15 AM, Mohan L wrote: > Dear All, > > I have .csv file it looks like this : > rawdata <- read.csv(file='/home/Mohan/Rworks/tmp/VMList_User.txt',sep='\t' > , header=FALSE) > > > head(rawdata,n=5) > TenantDoma

Re: [R] calculate probability

2010-11-06 Thread Ted Harding
On 06-Nov-10 11:16:28, Jumlong Vongprasert wrote: > Dear All > I have some problem with calculate probability. > Assume I have data with normal distribution with mean = 5 sd = 2. > I want to approximate probability = 2.4. > I used pnorm(2.4, 5, 2) - pnorm(2.4, 5, 2, lower.tail = FLASE), > correct o

[R] Extracting elements of a particular slot from S4 object

2010-11-06 Thread Megh Dal
Hi there, can anyone tell me how to extract to values of a particular slot for some S4 object? Let take following example: > library(fOptions) > val <-GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08, b = > 0.08, sigma = 0.30) > val Title: Black Scholes Option Valuation Call:

Re: [R] Extracting elements of a particular slot from S4 object

2010-11-06 Thread Henrique Dallazuanna
Try this: v...@price On Sat, Nov 6, 2010 at 11:41 AM, Megh Dal wrote: > Hi there, can anyone tell me how to extract to values of a particular slot > for some S4 object? Let take following example: > > > library(fOptions) > > val <-GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08,

[R] Removing NA in ggplot

2010-11-06 Thread Ottar Kvindesland
Hi list, I just got stuck with this one: In Data I have the sets age (numbers 1 to 99 and NA) and gender (M, F and NA). Then getting some nice plots using ggplot(data, aes(age[na.exclude(gender)])) + geom_histogram( binwidth = 3, aes(y = ..density.. ), fill = "lightblue" ) + facet_grid( gende

Re: [R] Removing NA in ggplot

2010-11-06 Thread Jeff Newmiller
Create a subset of your data that excludes the NAs before you feed it to ggplot. "Ottar Kvindesland" wrote: >Hi list, > >I just got stuck with this one: > >In Data I have the sets age (numbers 1 to 99 and NA) and gender (M, F >and >NA). Then getting some nice plots using > >ggplot(data, aes(age[

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
Hi Joshua, Thanks for your advice. 1) Re your advice:-[quote] > a3d , , 1 <--- this is the first position of the third dimension [,1] [,2] [,3] [,4] <--- positions 1, 2, 3, 4 of the second dimension [1,]147 10 [2,]258 11 [3,]369 12 ^ the first dim

Re: [R] anova(lme.model)

2010-11-06 Thread Bert Gunter
Sounds to me like you should really be seeking help from your local statistician, not this list. What you request probably cannot be done. What is wrong with what you get from lme, whose results seem fairly clear whether the P values are accurate or not? Cheers, Bert On Sat, Nov 6, 2010 at 4

[R] Where to get rcom for Linux

2010-11-06 Thread Stephen Liu
Hi folks, Debian 600 64-bit Is rcom for Linux available? rcom rcom: R COM Client Interface and internal COM Server http://cran.r-project.org/web/packages/rcom/index.html If YES please advise where to get it. TIA B.R. Stephen L __ R-help@r-proje

Re: [R] Where to get rcom for Linux

2010-11-06 Thread Shige Song
isn't COM a Windows-only technology? Shige On Sat, Nov 6, 2010 at 12:12 PM, Stephen Liu wrote: > Hi folks, > > Debian 600 64-bit > > Is rcom for Linux available? > > rcom > rcom: R COM Client Interface and internal COM Server > http://cran.r-project.org/web/packages/rcom/index.html > > If YES pl

[R] compare and replace

2010-11-06 Thread Robert Ruser
Hello R Users, I'm wondering if there exists any elegant and simple way to do the following: I have a data.frame X fills in numbers. I have a vector y with numbers as well. Every value in X that is equal to any values in y should be replaced by e.g. 1. Any idea? Robert ___

Re: [R] compare and replace

2010-11-06 Thread Ben Bolker
Robert Ruser gmail.com> writes: > > Hello R Users, > I'm wondering if there exists any elegant and simple way to do the > following: I have a data.frame X fills in numbers. I have a vector y with > numbers as well. Every value in X that is equal to any values in y should > be replaced by e.g. 1.

Re: [R] compare and replace

2010-11-06 Thread Erik Iverson
On 11/06/2010 11:36 AM, Robert Ruser wrote: Hello R Users, I'm wondering if there exists any elegant and simple way to do the following: I have a data.frame X fills in numbers. I have a vector y with numbers as well. Every value in X that is equal to any values in y should be replaced by e.g. 1.

Re: [R] table with values as dots in increasing sizes

2010-11-06 Thread Michael Friendly
This is a "tableplot", available on R-Forge at https://r-forge.r-project.org/projects/tableplot/ install.packages("tableplot", repos="http://R-Forge.R-project.org";) will install, as long as you are using R 2.12.x; otherwise, you'll have to download the source package and install from source. -

Re: [R] compare and replace

2010-11-06 Thread Robert Ruser
Thank you vary much Ben and Erik. It's exactly what I want. Below is my a little modified example. set.seed(12345) X = sample(c(40:60),40,replace=TRUE) x = matrix(X,nc=5) y = c(40,43,55,60) x[x %in% y] <- -1 __ R-help@r-project.org mailing list https://

Re: [R] About 5.1 Arrays

2010-11-06 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Saturday, November 06, 2010 7:38 AM > To: Joshua Wiley > Cc: r-help@r-project.org > Subject: Re: [R] About 5.1 Arrays > > Hi Joshua, > > Thanks for your advic

Re: [R] anova(lme.model)

2010-11-06 Thread Mike Marchywka
> Date: Sat, 6 Nov 2010 07:45:26 -0700 > From: gunter.ber...@gene.com > To: sibylle.stoec...@gmx.ch > CC: r-help@r-project.org > Subject: Re: [R] anova(lme.model) > > Sounds to me like you should really be seeking help from your local > statistician, not this list. What you request probably cannot

[R] 3-way interaction simple slopes

2010-11-06 Thread Michael Wood
Can anyone show me how to test for significant simple slopes of a 3-way interaction, with covariates. my equation tmod<-(glm(PCL~ rank.f + gender.f + MONTHS + CEXPOSE.M + bf.m + MONTHS*CEXPOSE.M*bf.m, data=mhatv, family=gaussian ,na.action=na.omit)) Thank you Mike [[alternative HTML vers

[R] Using changing names in loop in R

2010-11-06 Thread Tuatara
Hello everybody, I have usually solved this problem by repeating lines of codes instead of a loop, but it's such a waste of time, I thought I should really learn how to do it with loops: What I want to do: Say, I have several data files that differ only in a number, e.g. data points (or vector

Re: [R] Using changing names in loop in R

2010-11-06 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Tuatara > Sent: Saturday, November 06, 2010 9:22 AM > To: r-help@r-project.org > Subject: [R] Using changing names in loop in R > > > Hello everybody, > > I have usually solved

[R] Prettier axis labels when using log scales in Lattice

2010-11-06 Thread Marc Paterno
Hello, I am trying to alter the way in which lattice functions (specifically xyplot) print the axis labels when one uses the 'scales' parameter. I can obtain the effect I want by using scales=list(y=list(log=10, labels=expression(yvalues))) where yvalues are the values that would have been prin

Re: [R] Prettier axis labels when using log scales in Lattice

2010-11-06 Thread Gabor Grothendieck
On Sat, Nov 6, 2010 at 3:02 PM, Marc Paterno wrote: > Hello, > > I am trying to alter the way in which lattice functions (specifically xyplot) > print the axis labels when one uses the 'scales' parameter. > I can obtain the effect I want by using >  scales=list(y=list(log=10, labels=expression(yv

Re: [R] Using changing names in loop in R

2010-11-06 Thread Liviu Andronic
On Sat, Nov 6, 2010 at 5:22 PM, Tuatara wrote: > > Hello everybody, > > I have usually solved this problem by repeating lines of codes instead of a > loop, but it's such a waste of time, I thought I should really learn how to > do it with loops: > Would the following construct help? > for(i in 1:

Re: [R] anova(lme.model)

2010-11-06 Thread Ben Bolker
Mike Marchywka hotmail.com> writes: > > > > Date: Sat, 6 Nov 2010 07:45:26 -0700 > > From: gunter.berton gene.com > > To: sibylle.stoeckli gmx.ch > > CC: r-help r-project.org > > Subject: Re: [R] anova(lme.model) > > > > Sounds to me like you should really be seeking help from your local > >

[R] Hashing and environments

2010-11-06 Thread Levy, Roger
Hi, I'm trying to write a general-purpose "lexicon" class and associated methods for storing and accessing information about large numbers of specific words (e.g., their frequencies in different genres). Crucial to making such a class practically useful is to get hashing working correctly so t

[R] SMATR common slopes test

2010-11-06 Thread Eugenio Larios
Hi All, I am confused with SMATR's test for common slope. My null hypothesis here is that all slopes are parallel (common slopes?), right? So if I get a p value < 0.05 means that we can have confidence to reject it? That slopes are different? Or the other way around? it means that we have statisti

[R] saddle points in optim

2010-11-06 Thread Jonathan Phillips
Hi, I've been trying to use optim to minimise least squares for a function, and then get a guess at the error using the hessian matrix (calculated from numDeriv::hessian, which I read in some other r-help post was meant to be more accurate than the hessian given in optim). To get the standard erro

[R] I want to call some R function in C code

2010-11-06 Thread 刘力平
Hi, all: I want the user to give a function g as the parameter of our function f. In function f, we use user's function g to compute something. Since our function f is implemented in C++, how do I further pass this function to C++ code? Thank you very much! best Liping LIU [[alternativ

Re: [R] likelyhood maximization problem with polr

2010-11-06 Thread tjb
blackscorpio wrote: > > Dear community, > > I am currently trying to fit an ordinal logistic regression model with the > polr function. I often get the same error message : > > "attempt to find suitable starting values failed", for example with : > ... > Does anyone have a clue ? > Yes. The

[R] How to generate multivariate uniform distribution random numbers?

2010-11-06 Thread michael
I wish to generate 100 by 1 vector of x1 and x2 both are uniform distributed with covariance matrix \Sigma. Thanks, Michael [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] bugs and misfeatures in polr(MASS).... fixed!

2010-11-06 Thread tjb
The start value generation code in polr is also known to fail quite frequently. For example, against the Iris data as recently posted to this list by blackscorpio ( Sep 6, 2010). > polr(Species~Sepal_Length+Sepal_Width+Petal_Length+Petal_Width,data=iris) Error in polr(Species ~ Sepal_Length + Se

Re: [R] bugs and misfeatures in polr(MASS).... fixed!

2010-11-06 Thread tjb
Note that that the enhancements in my original post solve the unresolved problem of Chaehyung Ahn (22 Mar 2005) whose data I reproduce: y,x,lx 0,3.2e-02,-1.49485 0,3.2e-02,-1.49485 0,1.0e-01,-1.0 0,1.0e-01,-1.0 0,3.2e-01,-0.49485 0,3.2e-01,-0.49485 1,1.0e+00,0.0 0,1.0e+00,0.0 1,3.

Re: [R] Hashing and environments

2010-11-06 Thread William Dunlap
I would make make an environemnt called wfreqsEnv whose entry names are your words and whose entry values are the information about the words. I find it convenient to use [[ to make it appear to be a list (instead of using exists(), assign(), and get()). E.g., the following enters the 100,000 word

Re: [R] Using changing names in loop in R

2010-11-06 Thread Joshua Wiley
Hi, If you have data that is similar enough to warrant only changing the extension (i.e., 1, 2, etc.) and that you (at least at times) wish to perform operations on together, it is time to start thinking of a more flexible framework. Fortunately, such a framework already exists in lists. Lists l

Re: [R] SMATR common slopes test

2010-11-06 Thread Kevin Middleton
Eugenio - > I am confused with SMATR's test for common slope. My null hypothesis here is > that all slopes are parallel (common slopes?), right? > So if I get a p value < 0.05 means that we can have confidence to reject it? > That slopes are different? > Or the other way around? it means that we

Re: [R] How to generate multivariate uniform distribution random

2010-11-06 Thread Ted Harding
On 06-Nov-10 21:54:41, michael wrote: > I wish to generate 100 by 1 vector of x1 and x2 both are uniform > distributed with covariance matrix \Sigma. > > Thanks, > Michael First, some comments. 1. I don't think you mean a "100 by 1 vector of x1 and x2" since you have two variables. "100 by 2"

Re: [R] Hashing and environments

2010-11-06 Thread Kjetil Halvorsen
some of this can be automated using the CRAN package hash. Kjetil On Sat, Nov 6, 2010 at 10:43 PM, William Dunlap wrote: > I would make make an environemnt called wfreqsEnv > whose entry names are your words and whose entry > values are the information about the words.  I find > it convenient to

Re: [R] SMATR common slopes test

2010-11-06 Thread Eugenio Larios
great thanks a lot! On Sat, Nov 6, 2010 at 3:54 PM, Kevin Middleton wrote: > > Eugenio - > > > I am confused with SMATR's test for common slope. My null hypothesis here > is > > that all slopes are parallel (common slopes?), right? > > So if I get a p value < 0.05 means that we can have confiden

Re: [R] How to generate multivariate uniform distribution random

2010-11-06 Thread michael
Ted, Thanks for your help, it is right on the money! for your comments: 1. Yes I mean 100 by 2, each variable x1, x2 is 100 by 1. 2. The correlation is the only free parameter. Michael On Sat, Nov 6, 2010 at 7:07 PM, Ted Harding wrote: > On 06-Nov-10 21:54:41, michael wrote: > > I wish

Re: [R] Removing NA in ggplot

2010-11-06 Thread Ottar Kvindesland
OK, any reason why ggplot2 does not allow filtering of NA? ottar On 6 November 2010 15:23, Jeff Newmiller wrote: > Create a subset of your data that excludes the NAs before you feed it to > ggplot. > > "Ottar Kvindesland" wrote: > > >Hi list, > > > >I just got stuck with this one: > > > >In D

Re: [R] Removing NA in ggplot

2010-11-06 Thread Joshua Wiley
On Sat, Nov 6, 2010 at 4:43 PM, Ottar Kvindesland wrote: > OK, any reason why ggplot2 does not allow filtering of NA? It is not so much that ggplot2 does not allow the filtering of NA values, it is that you need to use data from the dataset you specified. By subsetting in aes() rather than in da

Re: [R] Using changing names in loop in R

2010-11-06 Thread Tuatara
A more detailed example: Say I would like to read in data files that are set-up identically and have identical (but somewhat) different text names (see below): data_1 <- read.csv("data1.txt") data_2 <- read.csv("data2.txt") data_3 <- read.csv("data3.txt") How do I automate this process? (I ass

Re: [R] How to generate multivariate uniform distribution random

2010-11-06 Thread G. Jay Kerns
Dear Michael, On Sat, Nov 6, 2010 at 7:27 PM, michael wrote: > Ted, > >      Thanks for your help, it is right on the money! > > for your comments: > 1. Yes I mean 100 by 2, each variable x1, x2 is 100 by 1. > 2. The correlation is the only free parameter. > > Michael > > I like Ted's solution.

Re: [R] Using changing names in loop in R

2010-11-06 Thread Joshua Wiley
On Sat, Nov 6, 2010 at 3:13 PM, Tuatara wrote: > > A more detailed example: > > Say I would like to read in data files that are set-up identically and have > identical (but somewhat) different text names (see below): > > data_1 <- read.csv("data1.txt") > data_2 <- read.csv("data2.txt") > data_3 <-

Re: [R] How to generate multivariate uniform distribution random

2010-11-06 Thread michael
Jay, Yes I'm looking for unif(0,1) and your method works just fine. I suppose your method should work for dimensions greater than 2, am I right? Michael On Sat, Nov 6, 2010 at 8:05 PM, G. Jay Kerns wrote: > Dear Michael, > > On Sat, Nov 6, 2010 at 7:27 PM, michael wrote: > > Ted, > > >

Re: [R] How to generate multivariate uniform distribution random

2010-11-06 Thread G. Jay Kerns
On Sat, Nov 6, 2010 at 8:22 PM, michael wrote: > Jay, > >   Yes I'm looking for unif(0,1) and your method works just fine. I > suppose your method should work for dimensions greater than 2, am I right? > > Michael > Yes, but it gets that much more tricky to specify the covariance matrix. Two

Re: [R] Where to get rcom for Linux

2010-11-06 Thread Stephen Liu
- Original Message From: Shige Song To: Stephen Liu Cc: r-help@r-project.org Sent: Sun, November 7, 2010 12:17:42 AM Subject: Re: [R] Where to get rcom for Linux > isn't COM a Windows-only technology? Hi Shige Thanks. I see. I was surprised for unable to find it after having turned

[R] postscript window size

2010-11-06 Thread threshold
Dear R users, simple figure: postscript(file="~/Desktop/figure.ps", horizontal=T, width=20, height=10) par(mfcol=c(2,5)) plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') ##- plot(rnorm(100), type='l') plot(

Re: [R] postscript window size

2010-11-06 Thread Joshua Wiley
Hi Robert, You need to add paper = "special" to the postscript() call. postscript(file="~/Desktop/figure.ps", horizontal=TRUE, width=20, height=10, paper = "special") plot() ... plot() dev.off() Otherwise it is reset because you are specifying a size outside of what can fit on the

[R] can't load nlme on windoze 7

2010-11-06 Thread Mike Marchywka
Hi, I've got a problem that sounds a lot like this, http://r.789695.n4.nabble.com/Re-R-R-2-12-0-hangs-while-loading-RGtk2-on-FreeBSD-td3005929.html under windoze 7. but it seems to hang with this stack trace, #0  0x77830190 in ntdll!LdrFindResource_U ()    from /cygdrive/c/Windows/system32/n

Re: [R] 3-way interaction simple slopes

2010-11-06 Thread David Winsemius
On Nov 6, 2010, at 9:06 AM, Michael Wood wrote: Can anyone show me how to test for significant simple slopes of a 3- way interaction, with covariates. You might start by defining what you mean by "simple slopes" when discussing a model with a three way interaction. You might also includ

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
Hi Daniel, > I am correcting you. :-) You are using dim() incorrectly, and not accessing >the array correctly. > > In all of your examples you should be using dim(3,4,2). Then you need to >specify the indexes > > of the array element you want to look at. So, to use your example Thanks

Re: [R] Hashing and environments

2010-11-06 Thread Levy, Roger
Wow, that is perfect: the hash package is exactly what I needed. Thank you! Roger On Nov 6, 2010, at 4:09 PM, Kjetil Halvorsen wrote: > some of this can be automated using the CRAN package > hash. > > Kjetil > > On Sat, Nov 6, 2010 at 10:43 PM, William Dunlap wrote: >> I would make make an e

[R] is this matrix symmetric

2010-11-06 Thread Jun Shen
Hi, I have this symmetric matrix, at least I think so. col1 col2 col3 [1,] 0.20 0.05 0.06 [2,] 0.05 0.10 0.03 [3,] 0.06 0.03 0.08 or structure(c(0.2, 0.05, 0.06, 0.05, 0.1, 0.03, 0.06, 0.03, 0.08 ), .Dim = c(3L, 3L), .Dimnames = list(NULL, c("var1", "var2", "var3"))) But isSymmetric() d

[R] creating a scale (factor) based on a continuous variable nested within levels of factor

2010-11-06 Thread hind lazrak
Hello R-helpers I hope that my subject line is not detering anyone from helping me out:) I have been stuck of a few hours now, and I don't seem to pinpoint where the problem is. I have a data.frame which is structured as follow: str(hDatPretty) 'data.frame': 1665 obs. of  8 variables: $ time  

[R] When using ACF, receive error: no applicable method for 'ACF' applied to an object of class "c('double', 'numeric')"

2010-11-06 Thread evt
I am guessing this is a very simple question, but this is only my second day with R so it is all still a bit imposing. I am trying to run an autocorrelation. I imported a CSV file, which has one column labeled "logistic". I ran the command: ACF(data$logistic,maxLag=10) However, I received the