similar to: Calculate correctly, but gives an error message

Displaying 20 results from an estimated 10000 matches similar to: "Calculate correctly, but gives an error message"

2012 Jul 22
2
R Beginner : Loop and adding row to dataframe
Hi everybody, I am currently quite inexperienced with R. I try to create a function that simply take a value in a dataframe, look for this value in another dataframe and copy all the row that have this value This example is a simplified version of what I am doing but it's enough to help me listA Name NACE a 1 b 2 c 3 ListB NACE aaa bbb ccc 1 a a c 1 a a c 1 a a c 2 a a c 2 a a c 3 a a c 4 a
2010 Nov 27
1
d.f. in F test of nested glm models
Dear all, I am fitting a glm to count data using poison errors with the log link. My goal is to test for the significance of model terms by calling the anova function on two nested models following the recommendation in Michael Crawley's guide to Statistical Computing. Without going into too much detail, essentially, I have a small overdispersion problem (errors do not fit the poisson
2004 May 17
3
Accessing data
Hello, I would like to access my data frame without one variable. E.g.: > colnames(x) [1] "Besch" "Ang.m" "Arb.m" "i10" "Umsatz" "arbstd" I can try x[,-1], but this variable must be called by it??s name. x[,-"Besch"] x[,!"Besch"] attach(x) x[-Besch] ... ... does not work. I could not found a solution of
2007 Sep 01
2
Comparing "transform" to "with"
Hi All, I've been successfully using the with function for analyses and the transform function for multiple transformations. Then I thought, why not use "with" for both? I ran into problems & couldn't figure them out from help files or books. So I created a simplified version of what I'm doing: rm( list=ls() ) x1<-c(1,3,3) x2<-c(3,2,1) x3<-c(2,5,2)
2005 Feb 21
5
Compare rows of two matrices
Hello, #I have two matrices, eg.: y <- matrix( c(20, NA, NA, 45, 50, 19, 32, 101, 10, 22, NA, NA, 80, 49, 61, 190), ncol=4 ) x <- matrix( c(20, NA, NA, NA, 50, 19, 32, 101, 10, 22, NA, NA, 80, 49, 61, 190), ncol=4 ) #Whereas x contains all NA?s from y plus some additional NA?s. #I want to find the index of these additional NA?s. I think, there must be a very
2016 May 04
2
GVN pass: does global value numbering remove duplicate computations in loops?
Hello, I was hoping to get some clarification on the aim of the GVN pass. I have been reading a bit about global value numbering, and from what I understand, there are polynomial time algorithms for removing duplicate computations from loops[1]. I have an example program[2] which computes the sum of an array twice, in two separate accumulators. Here, sum0 and sum1 are both sums of the array A.
2008 Oct 17
2
Text (eg. summary) to text file, Howto?
Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script goes something like this: ... lmMax <- lm(NUMAMMON ~ YYYY*MM*DD) sum1 <- summary(lmMax) # help needed here... how to dump sum1
2008 Apr 22
4
how to convert non numeric data into numeric?
I am having the following error in my function function(theta,reqdIRR) { theta1<-theta[1] theta2<-theta[2] n<-length(reqdIRR) constant<- n*(theta1+theta2) sum1<-lapply(reqdIRR*exp(theta1),FUN = sum) sum2<-lapply(exp(theta2 - reqdIRR*exp(theta1)),FUN = sum) sum = sum1 + sum2 log.fcn = constant - as.numeric(sum) result = - log.fcn return(result) } *error :
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
Greetings. For R gurus this may be a no brainer, but I could not find pointers to efficient computation of this beast in past help files. Background - I wish to implement a Cramer-von Mises type test statistic which involves double sums of max(X_i,Y_j) where X and Y are vectors of differing length. I am currently using ifelse pointwise in a vector, but have a nagging suspicion that there is a
2010 Sep 24
2
grep contents of file on remote server
Hello, I am attempting to grep the contents of a key file I have SCP'd to a remote server. I am able to cat it: [code] [bluethundr at LBSD2:~]$:ssh root at sum1 cat /root/id_rsa.pub root at lcent01.summitnjhome.com's password: ssh-rsa
2004 May 27
2
Rcmd check, windows xp, perl (2)
Thank you for your help. I??m sorry that I found not the right entries in the R-devel. Now, I have again a problem. After installing all needed things I have run Rcmd INSTALL -l ../mypkg and respectively make mypkg By running Rcmd check I get following message: * checking for working latex ...Error: environment variable TMPDIR not set (or set to unusable value) and no default
2014 Sep 29
2
[LLVMdev] Alias Analysis across functions
Hi, I am trying to get the alias info for the following code. The alias analysis returns "MayAlias" for arrays "A" and "B" in both the functions instead of "NoAlias". What passes should I run in opt before the alias analysis pass to get the accurate result? Example: //Note: static and called by func() only. static int sum(int *A, int *B) { int i = 0,
2008 Nov 26
1
SSE2 code won't compile in VC
Jean-Marc, At least VS2005 (what I'm using) won't compile resample_sse.h with _USE_SSE2 defined because it refuses to cast __m128 to __m128d and vice versa. While there are intrinsics to do the casts, I thought it would be simpler to just use an intrinsic that accomplishes the same thing without all the casting. Thanks, --John @@ -91,7 +91,7 @@ static inline double
2012 Feb 02
2
contar caracteres de los elementos de un factor
Hola, necesito contar la cantidad de caracteres de cada elemento de un vector o factor Por ejemplo si el factor es: a<-c("jose", "javier", "mariano") aplicando alguna funcion, el resultado q quiero es 4, para jose 6 para javier 7, para mariano q es la cantidad de caracteres q tiene cada uno de los elementos del factor a probe usando length(a) y me da la
2006 Apr 12
2
Lattice, panel.grid and groups
Hello, Given the following plot, which shows following data: a <- c(8.976000, 8.976000, 8.856000, 8.856000, 8.756000, 8.756000, 8.771000, 8.751000, 8.856000, 8.856000, 16.812000, 16.800000, 8.845000, 9.032000, 8.706000, 9.636000, 9.032000, 16.802000, 8.726000, 8.779000, 8.779000, 8.856000, 8.856000, 8.534000, 8.534000, 8.764000, 8.646000, 8.856000, 8.856000, 13.081000, 10.760000, 8.600000,
2005 May 30
2
How to access to sum of dissimilarities in CLARA
Dear All , Since dissimilarity is one of quality measures in clustering , I'm trying to access to the sum of dissimilarity as a whole measure. But after running my data using CLARA I obtain : 1128 dissimilarities, summarized : Min. 1st Qu. Median Mean 3rd Qu. Max. 0.033155 0.934630 2.257000 2.941600 4.876600 8.943700 But I can not find the sum of dissimilarity.How can i
2013 Mar 25
2
Faster way of summing values up based on expand.grid
Hello! # I have 3 vectors of values: values1<-rnorm(10) values2<-rnorm(10) values3<-rnorm(10) # In real life, all 3 vectors have a length of 25 # I create all possible combinations of 4 based on 10 elements: mycombos<-expand.grid(1:10,1:10,1:10,1:10) dim(mycombos) # Removing rows that contain pairs of identical values in any 2 of these columns: mycombos<-mycombos[!(mycombos$Var1
2000 Feb 15
1
rpois gives a large number repeatedly (PR#439)
Full_Name: Kjetil Kjernsmo Version: 0.65.1 OS: Digital UNIX 4.0 Submission from: (NULL) (129.240.28.172) I'm experiencing problems with rpois. Occasionally, it draws a very high number. Yeah, I know, this is statistics, things like that does happen, but this really strange because a poisson distribution with a parameter of 3 shouldn't see the number 1932 very often, but the same,
2018 Mar 16
3
Discrepancy: R sum() VS C or Fortran sum
Hi all, I found a discrepancy between the sum() in R and either a sum done in C or Fortran for vector of just 5 elements. The difference is very small, but this is a very small part of a much larger numerical problem in which first and second derivatives are computed numerically. This is part of a numerical method course I am teaching in which I want to compare speeds of R versus Fortran (We
2005 Mar 30
5
2d plotting and colours
Hi! I am new to R just 3 days in it and i apologize if my questions seem very trivial and consumed your valuable time. I am coding in perl and i stumbled upon R regarding plotting good statistical graphs. I tried the kmean clustering for a large matrix ,say > 150 * 150 . I tried the example code given in the tutorial to perform 2d plot # i ranges from 2 to 10 cl <- kmeans(x, i, 20)