for example ...
x - 1:5 ; y- 6:8
(m - x %o% y) # is this what you mean by product of two vectors?
sum(m[row(m)!=col(m)]) # or ...
sum(m)-sum(diag(m))
On Wed, Jul 2, 2008 at 7:30 PM, Murali Menon [EMAIL PROTECTED] wrote:
folks,
is there a clever way to compute the sum of the product of
on 07/02/2008 01:55 PM Viswanathan Shankar wrote:
Hello ,
I am having some difficulty reading a CSV file of unequal record length
in R . The data has 26 columns and do not have header and is generated
from a R syntax -
write.table(schat,schat.csv, sep=,, col.names=FALSE, append = TRUE)
Try this:
x - read.table(textConnection(Conc Lat LonDepth
Point 56.25-5.65 70
Point0001 56.55-5.35 85
Point0002 56.25-5.65 65
Point0003 56.37-5.21 80
Point0004 56.45-5.23 30
Point 56.25-5.55 75
?[[
decision - one
raw[[decision]]
On Wed, Jul 2, 2008 at 3:10 PM, R_Learner [EMAIL PROTECTED] wrote:
raw - read.csv(file=filename, head=TRUE,sep=,)
I've read in a csv file, and I'm looking to access a column whose name is
held in a string.
For example, I want to access raw$one or
Here's one solution, YMMV:
library(maps)
# Note, plot the map first to get the aspect ratio (or projection) right
map(county, xlim=range(df2VisitTrips[, c(5, 7)]), ylim=range(df2VisitTrips[,
c(4, 6)]),
col=8)
map(state, add=T)
map.axes()
for (i in 1:length(df2VisitTrips[, 1])) {
Dear Ramya,
Try
# Gene list with 3 genes
genelist=list(gene1=rnorm(100),gene2=rnorm(100),gene3=rnorm(100))
genelist
# Map file with 50 genes
mapfile=data.frame(gene=paste(gene,1:50,sep=),coordinate=runif(50,6180,6300))
mapfile
# Genes in genelist (names)
NAMES=names(genelist)
NAMES
#
made my day, thanks, worked just fine with a little bit of tweaking
(flipping x and y around, basically).
rapid response much appreciated
Dick
On Wed, Jul 2, 2008 at 5:25 PM, Ray Brownrigg
[EMAIL PROTECTED] wrote:
Here's one solution, YMMV:
library(maps)
# Note, plot the map first to get the
Hi Jenny,
I try your code but I did not get in converge in fm3 (see the below).
For the first question, you could use fm1 to interpret the result
without bothering fm2 and fm3. It means that R0 and lrc can be treated
as pure fixed effects (Pinherir and Bates, 2000 Book).
For the second
On 7/2/08, David Afshartous [EMAIL PROTECTED] wrote:
All,
I can't seem to get auto.key to work properly in an xyplot that is employing
panel.text. Specifically, I often change the default grouping colors then
use auto.key accordingly, but for some reason the same functionality isn't
xlab = and ylab = suppress the labels but that won't change the
margins. For that you need to set mar= . If z is a zoo object:
plot(z, xlab = , ylab = , mar=...)
See ?par for description of mar.
On Wed, Jul 2, 2008 at 12:59 PM, [EMAIL PROTECTED] wrote:
Thank you for your time to help.
Hello all,
I am trying to use the neuralnet function from the neural package to train
neural networks. I am finishing my thesis over statistical learning in which I
am comparring the MSE values for various algorithms with random data sets, so I
do not have a specific application. I have two
Hi,
I have an existing XML document on disk, which I'd like
to use as a template, and exchange a subnode with my own
newly created subtree:
?xml version=1.0?
Duncan
name a=1 b=xyz
firstDuncan/first
lastTemple Lang/last
/name
I think it is zero, because you have lots of zeros there. It is not like
continous variables.
Thomas Lumley wrote:
On Wed, 2 Jul 2008, rlearner309 wrote:
I think the covariance between dummy variables or between dummy variables
and
intercept should always be zero. meaning: no
Does something like this get you close:
x - list()
keys - LETTERS[1:6]
# create
for (i in keys){
x[[i]] - data.frame(a=1:5, b=1:5, c=1:5)
}
# output
output - file('tempxx.txt', 'w')
for (i in keys){
write.table(i, row.names=FALSE, col.names=FALSE, file=output, quote=FALSE)
Hi, dear R experts ,
I am new. I met this problem when I am trying to learn how to use
the nlminb() function. I tried the example which the document
provides ( as the following code ) and R gives no response . I don't
know whether it is running or not and it takes a very long time but
Hi all
I have a question about correct usage of persp(). I have a simple neural
net-based XOR example, as follows:
library(nnet)
xor.data - data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0)))
names(xor.data) - c(x,y,o)
xor.nn - nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1)
# Create
Hi R Community:
I've got a character string that looks like: New Mexico
How to I create the new character string that looks like: New Mexico
That is, it is the original string (New Mexico) with double quotes
infront and behind it?
Thanks,
Phil Smith
I need to capture matching words in a string, any ideas ?
I tried using gregexpr, but it was no help. In this example, I need to capture
ID23423424 and ID324234325
s - sID23423424 apple pID324234325 orange gregexpr(ID[0-9]+, s)[[1]][1]
2 20attr(,match.length)[1] 10 11
Philip James Smith wrote:
Hi R Community:
I've got a character string that looks like: New Mexico
What does this mean? I do not think I understand. Do you have a vector
with one element (New Mexico) in it? I think we need a few more
details, like what it is exactly you have (class of
Hi
I have a problem with lm and predict
I have
us
[1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48
[9] 5103.75 5484.35 5803.08 5995.93 6337.75 6657.40 7072.23 7397.65
[17] 7816.83 8304.33 8746.98 9268.43 9816.98 10127.95 10469.60 10960.75
[25] 11685.93
Try this and see the gsubfn home page for more info:
http://gsubfn.googlecode.com
library(gsubfn)
Loading required package: proto
s - sID23423424 apple pID324234325 orange
strapply(s, ID[0-9]+)[[1]]
[1] ID23423424 ID324234325
On Wed, Jul 2, 2008 at 9:33 PM, Daren Tan [EMAIL PROTECTED]
Hello -
Keld Jørn Simonsen wrote:
Hi
I have a problem with lm and predict
I have
us
[1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48
[9] 5103.75 5484.35 5803.08 5995.93 6337.75 6657.40 7072.23 7397.65
[17] 7816.83 8304.33 8746.98 9268.43 9816.98
Dear Keld,
See ?predict.lm and its examples.
HTH,
Jorge
On Wed, Jul 2, 2008 at 9:40 PM, Keld Jørn Simonsen [EMAIL PROTECTED] wrote:
Hi
I have a problem with lm and predict
I have
us
[1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48
[9] 5103.75 5484.35
Thank you for your reply Chunhao!
I attached only part of the test data and that is why you might not be able to
get convergence. Sorry.
I have a couple more questions:
For the second question you answered, how to specify the correct length of
starting values. I tried using the length of
I ran you script and it came back in less than 1 second:
x - rnbinom(100, mu = 10, size = 10)
hdev - function(par) {
+ -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE))
+ }
nlminb(c(9, 12), hdev)
$par
[1] 9.760001 13.802305
$objective
[1] 278.9434
$convergence
[1] 0
$message
[1]
I have data that looks like
YC Age Num
82 11 2
83 10 0
84 9 8
85 8 21
86 7 49
87 6 18
88 5 79
89 4 28
90 3 273
91 2 175
with a program
mod1=lm(log(Num+1)~YC, data=box44)
With smaller tab-limited files, I could load them using read.table and the
likes. Now I have a gigantic 10^8 rows and 1^3 columns tab-limited file for
processsing, please throw some ideas how to handle it.
Thanks
_
Publish your
On 02/07/2008 8:47 PM, Rory Winston wrote:
Hi all
I have a question about correct usage of persp(). I have a simple neural
net-based XOR example, as follows:
library(nnet)
xor.data - data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0)))
names(xor.data) - c(x,y,o)
xor.nn - nnet(o ~ x + y,
Hi Jenny, (I use the data you provide in the previous e-mail)
For the 1st question, let me assume you only want to compare loc: A vs. B
So you could specified your code like this:
fmAB - nlme(Y ~ SSlogis(X, Asym, R0, lrc),data = LAST,
random = Asym ~1,
fixed = Asym+R0+lrc
Hi, Jim
thanks for your reply, I tried the scripts it still does not give
any response on my mac. I have to stop in manually.
what is your sessionInfo ? Thanks again.
On 2008-7-3, at 上午10:10, jim holtman wrote:
I ran you script and it came back in less than 1 second:
x - rnbinom(100,
101 - 130 of 130 matches
Mail list logo