similar to: Error Handling

Displaying 20 results from an estimated 300 matches similar to: "Error Handling"

2008 Oct 01
2
Looking for position of character in a string
Hi all, I would like to check if a string contains "." in it. If yes, I would like to know the position of "." in the string. Eg: X<-"NM1236.3" In above example, "." is at position 7. I tried functions grep() and match(). It seems they couldn't detect ".". Thanks in advance for your help, Sityee [[alternative HTML version deleted]]
2008 Oct 20
1
par(mfrow=c(2,4))
Hi All, I'm going to draw 8 plots in one page. I want the plots to be arranged in two rows, each row has 4 plots. So, I set the it par(mfrow=c(2,4)). However, there might be too many plots in a page, all the 8 plots were drawn in triangular shape, which makes the x-y coordinate scale not in same length, the x-axis length is much shorter than the y-axis length. Could anybody let me know how
2011 Feb 25
1
speed up process
Dear users, I have a double for loop that does exactly what I want, but is quite slow. It is not so much with this simplified example, but IRL it is slow. Can anyone help me improve it? The data and code for foo_reg() are available at the end of the email; I preferred going directly into the problematic part. Here is the code (I tried to simplify it but I cannot do it too much or else it
2006 Feb 20
3
Boxplot Help for Neophyte
R helpers I am getting to grips with R but came across a small problem today that I could not fix by myself. I have 3 text files, each with a single column of data. I read them in using: myData1<-scan("C:/Program Files/R/myData1.txt") myData2<-scan("C:/Program Files/R/myData2.txt") myData3<-scan("C:/Program Files/R/myData3.txt") I wanted to produce a
2009 Jan 06
5
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang
2012 Jul 03
1
insert missing dates
Hello I have dataframes. mydata1 <-data.frame(value=c(15,20,25,30,45,50),dates=c("2005-05-25 07:00:00 ","2005-05-25 19:00:00","2005-06-25 07:00:00","2005-06-25 19:00:00 ","2005-07-25 07:00:00","2005-8-25 19:00:00")) or mydata2 <-data.frame(value=c(15,20,25,30,45,50),dates=c("2005-05-25 00:00:00 ","2005-05-25
2012 May 15
4
reading data into R
Hi I am really new using R, so this is really a beginner stuff! I created a very small data set on excel and then converted it to .csv file. I am able to open the data on R using the command "read.table ("mydata1.csv", sep=",", header=T)" and it just works fine. But when I want to work on the data (e.g. calculate the mean of variable "X") R says
2011 Sep 07
1
randomForest memory footprint
Hello, I am attempting to train a random forest model using the randomForest package on 500,000 rows and 8 columns (7 predictors, 1 response). The data set is the first block of data from the UCI Machine Learning Repo dataset "Record Linkage Comparison Patterns" with the slight modification that I dropped two columns with lots of NA's and I used knn imputation to fill in other gaps.
2011 Jul 11
1
GLS - Plotting Graphs with 95% conf interval
Hi, I am trying to plot the original data with the line of the model using the predict function. I want to add SE to the graph, but not sure how to get them out as the predict function for gls does not appear to allow for SE=TRUE argument. Here is my code so far: f1<-formula(MaxNASC40_50~hu3+flcmax+TidalFlag) vf1Exp<-varExp(form=~hu3) B1D<-gls(f1,correlation=corGaus(form=Lat~Lon,
2008 Jun 26
2
a question regarding package building
Hi List, In Windows, if I do " R CMD build mypkg", then I'll get 'mypkg_1.0.tar.gz'. Any option in R CMD build lets me to change the version, i.e. gives me 'mypkg_2.0.tar.gz"? It seems "-version" option doesn't do anything for me. Is it OK if I just change the version number in the file name manually? Thanks, ...Tao
2012 Jun 06
3
problem about set operation and computation after split
hi, I met some problems in R, plz help me. 1. How to do a intersect operation among several groups in one list, without a loop statement? (I think It may be a list) create data: myData <- data.frame(product = c(1,2,3,1,2,3,1,2,2), year=c(2009,2009,2009,2010,2010,2010,2011,2011,2011),value=c(1104,608,606,1504,508,1312,900,1100,800)) mySplit<- split(myData,myData$year)
2013 Jan 10
1
Semi Parametric Bootstrap
Greetings to you all, I am performing a semi parametric bootstrap in R on a Gamma Distributed data and a Binomial distributed data. The main challenge am facing is the fact that the residual variance depends on the mean (if I am correct). I strongly feel that the script below may be wrong due to mean-variance relationship #####R code####### fit1s
2008 Apr 15
2
How can I import user-defined missings from Spss?
Hi, It works for me to import spss datasets via library(foreign) with read.spss or via library Hmisc by (spss.get). But no matter which way I do import the data, user-defined missings from Spss are always lost. (it makes no difference if there are a single value, a range, or any combination of them. They are always ignored). Is there any way in R to find out if any value was user-defined missing
2010 Jan 22
1
confidence intervals for mean (GLM)
Dear useRs, How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM? I need the CI's for the Poisson and Negative Binomial distributions. Here's what I have: mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1)) model1 <- glm(value ~ treatments, data=mydata1, family=poisson) means1 <-
2008 Jul 09
2
Read.table - Less rows than original data
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named "mydata2", it was saved in the following command, write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t") The next day I read in above saved text file into R,
2008 Jul 09
1
read.table problem
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named "mydata2", it was saved in the following command, write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t") The next day I read in above saved text file into R,
2018 Mar 15
3
stats 'dist' euclidean distance calculation
Hello, I am working with a matrix of multilocus genotypes for ~180 individual snail samples, with substantial missing data. I am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated: 3x3 subset used
2008 Jul 04
1
Test for multiple comparisons: Nonlinear model, autocorrelation?
Dear R community, I have a nonlinear model describing average daily soil temperature. What test should I use to compare differences in soil temperature of the two studied vegetation types depending upon month? Building linear contrasts for the developed nonlinear model does not help since this model does not include variable “Months” (only “Days”). 1) Just a Student’s test is not probably
2011 Feb 28
0
Fwd: Re: speed up process
Dear Jim, Here is again exactly what I did and with the output of Rprof (with this reduced dataset and with a simpler function, it is here much faster than in real life). Thanks you again for your help! ## CODE ## mydata1<- structure(list(species = structure(1:8, .Label = c("alsen","gogor", "loalb", "mafas", "pacyn", "patro",
2010 Nov 11
2
Kolmogorov Smirnov Test
I'm using ks.test (mydata, dnorm) on my data. I know some of my different variable samples (mydata1, mydata2, etc) must be normally distributed but the p value is always < 2.0^-16 (the 2.0 can change but not the exponent). I want to test mydata against a normal distribution. What could I be doing wrong? I tried instead using rnorm to create a normal distribution: y = rnorm