similar to: Help with "For" instruction

Displaying 20 results from an estimated 300 matches similar to: "Help with "For" instruction"

2009 Apr 29
2
if condition doesn't evaluate to True/False
Hi friends, Please help me with this bug. *Bug in my code:* In this variable sub_grp_whr_cls_data[sbgrp_no,1] I store the where clause.every sub group has a where condition linked with it. Database1 Where clause was not found for a particular subgroup, sub_grp_whr_cls_data[sbgrp_no,1] value was NULL So the condition (*sub_grp_whr_cls_data[sbgrp_no,1]=="NULL" ||
2006 Nov 17
5
configure a rails app for multiple databases
Hello Rails community I cannot seem to find via Google what I had hoped would be a simple issue On a single DB system (currently, postgres 8.1.4), I have two databases, each containing multiple tables. I would like to configure my app and database.yml to recognize these two databases. What is the corrrect config for the database.yml ? Is it something like: > production: > adapter:
2011 Sep 25
4
Trouble creating and adjacency matrix
Hello all, I'm having trouble creating an adjacency matrix. Basically, I need to turn the following distance matrix into an adjacency matrix based on whether values are >1.5 or not. If they are >1.5, then the returned value should be 0. If they are =<1.5, then the returned value should be 1. DistanceMatrix: A B C D E [1,]
2008 Feb 19
1
rJava and matrices
Hi list, I'm wanting to use a matrix as input to some java code, but I seem to be unable to do this (See code below). When searching online for a solution I found that rJava 0.5-2 (the version under development not yet in CRAN) is adding "direct support for raw vectors as method parameters". Is this related? I also tried to use .jarray / .jcast in various combinations to no avail.
2009 May 17
2
Chow test(1960)/Structural change test
Hi,   A question on something which normally should be easy !   I perform a linear regression using lm function:   > reg1 <- lm (a b+c+d, data = database1)   Then I try to perform the Chow (1960) test (structural change test) on my regression. I know the breakpoint date. I try the following code like it is described in the “Examples” section of the “strucchange” package :   > sctest(reg1,
2011 Jan 20
1
Problems with ecodist
Dear Dr.Goslee and anyone may intrested in matrix manipulate, I am using your ecodist to do mantel and partial mantel test, I have locality data and shape variation data, and the two distance matrixs are given as belowings. When I run the analysis, it is always report that the matrix is not square, but I didn't know what's wrong with my data. Would you please help me on this. I am quite
2011 Sep 26
3
Nearest neighbour in a matrix
Hello all, I am brand new to R and doing an exercise for a class. I need to find the nearest neighbour for points in the following matrix: > DistanceMatrix x1 x2 x3 x4 x5 [1,] 0.000000 2.828427 1.581139 2.236068 2.000000 [2,] 2.828427 0.000000 1.581139 4.123106 2.000000 [3,] 1.581139 1.581139 0.000000 2.549510 2.121320 [4,] 2.236068 4.123106 2.549510
2011 Jan 01
3
How to make this script ask again
Hi, as an example I have made this script to give the user the answer if a number is odd or even: { cat("Please, enter a number (Zero ends)") n<-scan(n=1) if(n==0)break i<-("The number is odd") p<-("The number is even") if (n%%2==0) p else i } If you run this script it will only work once, I mean, after it gives you the answer is won't ask for
2011 Jan 06
4
Creating a Matrix from a vector with some conditions
Hi Suppose we have an object with strings: A<-c("a","b","c","d") Now I do: B<-matrix(A,4,4, byrow=F) and I get a a a a b b b b c c c c d d d d But what I really want is: a b c d b c d a c d a b d a b c How can I do this? thank you A. Dias -- View this message in context:
2011 Feb 02
2
matrix and a function - apply function
Hi I have this function and this matrix: function(x,y) x+y/x m<-matrix(c(1,2,4,2,10,8),3,2) > m [,1] [,2] [1,] 1 2 [2,] 2 10 [3,] 4 8 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the image in order to get this results: for point (1,2) I would get 1+2/1 = 3 for point (2,10) I would get 2+10/2 = 7 for point (4,8) I would get
2013 Jan 09
1
problem adding curve/abline
Hey, I'm stuck on something I already did before (just a different kind of database), and whatever I try, it doesn't work anymore. So thanks for your help. Here's how my data approximately looks like: year season replicate size freq weight 2000 summer ch1 6 1 45 2000 summer ch1
2007 Oct 27
2
Remote database search issues
Hi all. First, a note about remote database connection over Perl. We actually found an easy way to work around the unwrapped Renote::open issue.. We use a stub file. You might say that open_stub in also not wrapped.. which is true... HOWEVER... looking at the code, we realized that Database::open() opts to using stub_open if the argument is a string pointing to a stub file rather than a
2011 Jan 18
4
Relative frequency on a character vector
Hi, I have this character vector: A<-c("Tell me how many different letter this vector has?") Is there a way with R that it can let me know how many different letters I have on this vector? If I use nchar(A) que gives me the number 50. With this function he is counting all the letters present and also spaces between the words. Can we also not count the spaces between words? Then
2011 Feb 01
3
sum the values in a vector as a complete number
Hi I am trying to create a function that is able to calculate this sum: a<-c(2,3,5) b<-(8,7) with "a" meaning 235 and "b" 87. So the result of this sum would be 235 + 87 = 322. I've searched a function like strsplit but that worked for integers and in reverse - not spliting but combining. Can you give me a hand on this please? thanks AD -- View this message in
2008 Jan 25
1
How to execute R code
Hi, I have 'R' code in file. saved it as exmaple.r here is the code....... library("hopach") GSE <- read.table("gene_expression_data",sep="\t",header=TRUE,row.names=TRUE) gene.dist <- distancematrix(t(GSE),d="euclid") gene.hobj <- hopach(t(GSE), dmat=gene.dist, mss="med") labelstosil(gene.hobj$cluster$label,gene.dist) I dont
2011 Jan 06
2
Help with IF operator
Hi, I am with a problem on how to do a comparison of values. My script is as follows: repeat{ cat("How many teams to use? (to end write 0) ") nro<-scan(n=1) if(nro==0)break cat("write the", nro, "teams names \n") teams<-readLines(n=nro) if (teams[1]==teams[2)next else print(teams) } On this example I only compare teams 1 name with teams 2 name, and if they
2010 Oct 22
1
overlapping docids when searching on multiple databases?
Just a quick question - it seems to me that it's entirely possible to get overlapping docids when searching on multiple databases? For instance: open database1 add database2 to database1 search db1+db2 if docid 10 exists in both databases, is there any way of telling which which database to retrieve the document from? /Per Jessen, Z?rich
2008 Jan 26
1
Loosing IAX/SIP user's registration with asterisk as no-root
Hello list, hope some one could help me find the answer. Asterisk 1.4.16.2 installd as no-root user The main issue is that every now and then, cd * box seems to loose the user's registrations, there is nothing in the console, absolutely no messages, only when another friend trys to dial an extension I can see this on messages logs [Jan 26 10:35:46] WARNING[23015] app_dial.c: Unable to
2014 Jan 27
1
post-login scripting failing with "denied access to user" v2.1.7
I am trying to have a default sieve rule for new mailboxes that can be edited by users using the round cube sieve plugin. It would actually be better executed when a new user is created but my postfixadmin runs on a separate machine so that's a bit tricky. The "sieve-default =" setting won't quite achieve what I want as I want users to be able to edit the default rule (to
2010 Dec 31
1
Silhouette function problem
Hi, I am using code below to get a plot that will show me on the X axis the number of clusters and on the Y axis the cluster average widths. However I am getting this error: Error in summary(silhouette(cutree(d, x), dist(iris[, -5])))$si.summary : $ operator is invalid for atomic vectors the code I am using is: avgs<-sapply(1:20,function(x) summary(silhouette(cutree(d,x),