thank you.
and for those who didn't get the reference:
http://en.wikipedia.org/wiki/Ren%C3%A9_Magritte
http://en.wikipedia.org/wiki/Ren%C3%A9_Magritte
Peter Dalgaard wrote:
>
> ticspd wrote:
>> I am trying to convert a string to a double using "as.numeric"
>> However, R is truncating the
Hi Nancy,
2009/12/30 Nancy Adam :
> Hi steve,
>
> Thank you so much for your reply.
>
> I’m asking about the difference between two cases:
>
> 1) when I use svm in a regression system and
>
> 2) when I use svm in a classification system.
>
> Is the code of using svm in these two cases the same?
Hi,
I seem to have to some problem using the rJava package. Any help is appreciated.
I have a sample java file Hello.java
public class Hello
{
public String sayHello()
{
String result=new String("Hell");
return result;
}
public static void main(String[] args)
{
}
}
and these are the com
Please ignore my message. I figured it out myself.
The way to do it is:
levels(testSeq_df[,i]) <- list(a=c('a'),c=c('c'),g=('g'),t=c('t'))
Thanks,
vishal
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.
Dear useR's
I have a small basic problem which I am hoping to get some help with. I have
a data frame, testSeq_df, with 1 row and 500 columns. Each column is a
character (a,c,g or t). I want this sequence to have 4 factors (a,c,g,t).
When I try the following:
for(i in 1:500){
if (length(level
Hi everyone,
Thanks a lot for the explanationâ¦
I tried the following code to compute R2 for a regression system but it does
not work:
my_svm_model <- function(myformula, mydata, mytestdata)
{
mymodel <- svm(myformula, data=mydata)
k<- summary(mymodel)
k$r.squared
}
Can anyone please te
Hi steve,
Thank you so much for your reply.Im asking about the difference between two
cases:1) when I use svm in a regression system and 2) when I use svm in a
classification system. Is the code of using svm in these two cases the
same?This is the code for a regression system:
my_svm_model <-
Hi Hao,
Ok.
Sorry for my last post.
bests
milton
On Tue, Dec 29, 2009 at 3:08 PM, Hao Cen wrote:
> Hi,
>
> I wonder how to pass several functions and their arguments as arguments to
> a function. For example, the main function is
>
> f = function(X ) {
> process1(X)
> ...
>
>
> process
Hi Hao,
I suggest you try again, starting by read posting guide at footnote of this
email.
How about a title for the message? How about identify yourself?
bests
milton
On Tue, Dec 29, 2009 at 2:59 PM, Hao Cen wrote:
> Hi,
>
> I wonder how to pass several functions and their arguments as argum
ticspd wrote:
I am trying to convert a string to a double using "as.numeric"
However, R is truncating the results!
No it isn't! As someone phrased it recently, there's a difference
between an object and the display of an object. "Ceci n'est pas une pipe".
Options(digits) is set to 7.
So
You need to learn how to use prop.test properly.
Is this a ONE-sample test or TWO-sample test?
Perhaps this will help:
#"hand" calculation
phat <- 58/691
p <- 56/691
q <- 1-p
n <- 691
z <- (phat-p)/sqrt(p*q/n)
z
[1] 0.2787970
pnorm(-z)*2
[1] 0.7804006
#"prop.test"
prop.test(x=58, n=691, p=56/69
The circle is not "too large"; it just uses your x-units for the
radius and your plotting region isn't square.
Here are some things to try:
plot(0, 0, xlim = c(-1, 1), ylim = c(-1, 1))
symbols(0, 0, circles = 1, inches = FALSE, add = TRUE)
abline(v = c(-1,1)) # shows that x-units 'fit'
abline(h =
On Tue, Dec 29, 2009 at 11:46 AM, Julia7 wrote:
>
> Hello,
>
> How do I fit a mixed effect model with no intercept using lmer()?
> Is the following syntax correct?
> lmer(y ~ -1+x1+x2+(-1+x1+x2|id), data=dt)
Yes. An alternative, which I prefer, is
lmer(y ~ 0 + x1 + x2 + (0 + x1 + x2|id), dt)
Hi r-users,
I would like to use prop.test code and I also calculate manually to test the
proportions for 2 groups. The problem is the answer for the p-value calculated
manually are different from prop.test. Here are the results:
## Manually
z value: z= (phat-p)/sqrt(pq/n) = (.084-.081)/sq
On 29/12/2009 5:24 PM, Hao Cen wrote:
Thanks. I don't know how many functions there will be.
What if g1, g2, g3 have variable number of parameters? say g1 has parg1a,
parg1b, and g3 has parg3a, parg3b, parg3c, parg4d.
pars could be a list of lists of parameters instead of a list of
parameters
Hello,
I am not able to plot a circle of a given radius using symbols(). In
the example below, the circle appears too large:
plot(0, 0, xlim = c(-1, 1), ylim = c(-1, 1))
symbols(0, 0, circles = 1, inches = FALSE, add = TRUE)
What's happening?
Ery
__
Thanks. I don't know how many functions there will be.
What if g1, g2, g3 have variable number of parameters? say g1 has parg1a,
parg1b, and g3 has parg3a, parg3b, parg3c, parg4d.
f <- function(X, fs, pars) {
process1(X)
for (i in 1:length(fs))
fs[[i]](pars[[i]]) # doesn't work h
On 29/12/2009 3:08 PM, Hao Cen wrote:
Hi,
I wonder how to pass several functions and their arguments as arguments to
a function. For example, the main function is
f = function(X ) {
process1(X)
...
process2(X)
}
I have a few functions that operate on X, e.g. g1(X, par1), g2(X, par2
Hi Magnus,
Magnus Torfason gmail.com> writes:
> I just noticed (the hard way of course) that when a query returns 0
> rows, the columns in the resulting data.frame get dropped as well. See
> the following example code (where conn is an active connection to an
> SQLite db):
>
> > dbGetQuery(
This came in at 11:21 today:
"From 30/12-2009 at 15.30 untill 31/12-2009 at 08.00, ALL IT services at
SUND-IT will be shut down!
ALL forms of electronic communication will be affected at SUND; VPN,
Webmail, Mail, Print, Network drives, Servers ie.
Furthermore, Panum, CSS, Teilum, Museion and
ah perfect .. digits = 8 is actually 8 digits TOTAL, not 8 digits after the
decimal point!
setting the default to 15 works for me
thank you!
Berend Hasselman wrote:
>
>
>
>
> ticspd wrote:
>>
>> I am trying to convert a string to a double using "as.numeric"
>> However, R is truncating t
On 29-Dec-09 21:11:38, James Rome wrote:
> I had an NA in one row of my data frame, so I called na.omit().
> But I do not understand where that row disappeared to.
>
>>fri=na.omit(fri)
>> fri
> Date.OnlyDAY Hour Min15 Quarter Arrival.Val Arrival4
> 109/05/2008 Friday833
Your script works well. Thank you very mcuh.
Lisa
Nutter, Benjamin wrote:
>
> It seems from your example that you're assuming all of the vectors have
> the same length. If this is the case, then a data.frame might be your
> friend.
>
>> df <- data.frame(
> v1 = c(0, 1, 0),
> v2 = c(
I had an NA in one row of my data frame, so I called na.omit(). But I do
not understand where that row disappeared to.
>fri=na.omit(fri)
> fri
Date.OnlyDAY Hour Min15 Quarter Arrival.Val Arrival4
109/05/2008 Friday833 3 328
210/24/2008 Friday 21
It seems from your example that you're assuming all of the vectors have
the same length. If this is the case, then a data.frame might be your
friend.
> df <- data.frame(
v1 = c(0, 1, 0),
v2 = c(1, 1, 0),
v3 = c(2, 1, 2),
v4 = c(2, 2, 1),
v5 = c(0, 1, 1) )
> x <- 5
> get.var
Thanks. I also need column name "v5".
Lisa
jholtman wrote:
>
> ?get
>
> something like:
>
>> v1 <- c(0, 1, 0)
>> v2 <- c(1, 1, 0)
>> v3 <- c(2, 1, 2)
>> v4 <- c(2, 2, 1)
>> v5 <- c(0, 1, 1)
>> x <- 5
>> cbind(v1, v2, get(paste('v', x, sep='')))
> v1 v2
> [1,] 0 1 0
> [2,] 1 1 1
> [
?get
something like:
> v1 <- c(0, 1, 0)
> v2 <- c(1, 1, 0)
> v3 <- c(2, 1, 2)
> v4 <- c(2, 2, 1)
> v5 <- c(0, 1, 1)
> x <- 5
> cbind(v1, v2, get(paste('v', x, sep='')))
v1 v2
[1,] 0 1 0
[2,] 1 1 1
[3,] 0 0 1
>
On Tue, Dec 29, 2009 at 3:54 PM, Lisa wrote:
>
> Thank you for your help
Thank you for your help. But here I just want to combine some vectors by
column based on the numbers determined by other R script.
For example, I have five vectors:
v1 <- c(0, 1, 0)
v2 <- c(1, 1, 0)
v3 <- c(2, 1, 2)
v4 <- c(2, 2, 1)
v5 <- c(0, 1, 1)
If I am going to combine the first two vecto
Could you just transpose the matrix?
Otherwise you can write a simple function that should work.
Try this
-(mat1 <- matrix(c(1, 2, 3, NA, 10, 2, NA, 8, 9, NA),nrow=2))
gl <- function(x)length(x[!is.na(x)]
apply(mat1, 1, gl)
==
Hello,
I have practice data of motor action in the format:
S | Cond. | Time
+-+
01 | c | 1.23
01 | nc| 0.89
02 | c | 2.15
02 | nc| 1.80
.
I want to look at the learning curves graphically.
I will appreciate pointers to relevant functions / pack
Hello,
How do I fit a mixed effect model with no intercept using lmer()?
Is the following syntax correct?
lmer(y ~ -1+x1+x2+(-1+x1+x2|id), data=dt)
Thanks,
Julia
--
View this message in context:
http://n4.nabble.com/lmer-how-to-lmer-with-no-intercept-tp990493p990493.html
Sent from the R h
I am trying to convert a string to a double using "as.numeric"
However, R is truncating the results!
Options(digits) is set to 7.
Can anyone shed some light on this?
Thanks!
> b[1]
[1] "116.28125"
> summary(b[1])
Length Class Mode
1 character character
> c <- as.numeri
ticspd wrote:
>
> I am trying to convert a string to a double using "as.numeric"
> However, R is truncating the results!
>
> Options(digits) is set to 7.
>
> Can anyone shed some light on this?
> Thanks!
> > b[1]
> [1] "116.28125"
>> summary(b[1])
>Length Class Mode
>
Hi,
I wonder how to pass several functions and their arguments as arguments to
a function. For example, the main function is
f = function(X ) {
process1(X)
...
process2(X)
}
I have a few functions that operate on X, e.g. g1(X, par1), g2(X, par2),
g3(X, par3). par1, par2 and par3 are
Hi,
I wonder how to pass several functions and their arguments as arguments to
a function. For example, the main function is
f = function(X ) {
process(X)
...
process(X)
}
I have a few functions that operate on X, e.g. g1(X, par1), g2(X, par2),
g3(X, par3). par1, par2 and par3 are para
Will something like this work for you:
> x <- cbind(runif(10), runif(10))
> x
[,1] [,2]
[1,] 0.26550866 0.2059746
[2,] 0.37212390 0.1765568
[3,] 0.57285336 0.6870228
[4,] 0.90820779 0.3841037
[5,] 0.20168193 0.7698414
[6,] 0.89838968 0.4976992
[7,] 0.94467527 0.7176185
[8,
On Tue, Dec 29, 2009 at 6:31 PM, Lisa wrote:
>
> Thank you for your reply. But in the following case, “cat()” or “print()”
> doesn’t work.
>
> data.frame(cbind(variable 1, variable 2, cat(paste("variable", x), "\n"))),
> where x is a random number generated by other R script.
>
> Lisa
Yes, becau
Hi all,
I have two columns of data, the first consists of parameter estimates and
the second probability estimates. I would like to extract the value from
the first column based on the max value of column two, but not sure how to
do this other than by extracting the value and then manually findin
Thanks! That's what I need.
On Tue, Dec 29, 2009 at 1:33 PM, Dimitris Rizopoulos <
d.rizopou...@erasmusmc.nl> wrote:
> have a look at ?ave(), e.g.,
>
> A <- 1:10
> B <- factor(c(1,2,2,4,4,4,7,7,7,7))
>
> ave(A, B)
>
>
> I hope it helps.
>
> Best,
> Dimitris
>
>
> farida...@gmail.com wrote:
>
>> D
have a look at ?ave(), e.g.,
A <- 1:10
B <- factor(c(1,2,2,4,4,4,7,7,7,7))
ave(A, B)
I hope it helps.
Best,
Dimitris
farida...@gmail.com wrote:
Dear R experts,
I would like to substitute the values of a vector, say A, with the average
values taken over a factor
For example, lets assum
Thank you for your reply. But in the following case, “cat()” or “print()”
doesn’t work.
data.frame(cbind(variable 1, variable 2, cat(paste("variable", x), "\n"))),
where x is a random number generated by other R script.
Lisa
Duncan Murdoch wrote:
>
> On 29/12/2009 1:16 PM, Lisa wrote:
>> De
Dear R experts,
I would like to substitute the values of a vector, say A, with the average
values taken over a factor
For example, lets assume
A
[1] 1 2 3 4 5 6 7 8 9 10
B
[1] 1 2 2 4 4 4 7 7 7 7
Levels: 1 2 4 7
I need to have
1.0 2.5 2.5 5.0 5.0 5.0 8.5 8.5 8.5 8.5 8.5
Thank you
On 29/12/2009 1:16 PM, Lisa wrote:
Dear All,
I am not sure how to remove double quotation marks in a string, e.g.,
paste("variable", 1). Can anybody please help me solve it? Thank you in
advance.
I think you need to tell us what is wrong with what you get from that.
When I look at the result:
Dear All,
I am not sure how to remove double quotation marks in a string, e.g.,
paste("variable", 1). Can anybody please help me solve it? Thank you in
advance.
Lisa
--
View this message in context:
http://n4.nabble.com/Remove-double-quotation-marks-tp990502p990502.html
Sent from the R help ma
On Tue, 29 Dec 2009, Phil Spector wrote:
Nancy -
Please notice that ** is not an R operator. The caret (^) is the
exponentiation operator in R.
- Phil
Actually, no,
2**3
[1] 8
Indeed ^ is the preferred exponentiation operator, but ** has 'always'
b
Hi,
I've been trying out the plm package, which seems like a great boon to
those who want to analyze panel data in R. I haven't started to use the
estimation functions themselves - for now I am just interested in having
a robust way to deal with lags in unbalanced panel data, since it is
such
Hi,
I’m new to R and object-oriented programming. I work primarily with
satellite datasets using IDL. I used IDL to ingest my data, run a
spectral mixture algorithm and output a timeseries of a snow index in
16-bit integer band interleaved by line format (for most of China). In
R, I read
Sorry for the late reply, maybe its is still of some help. See comments
below.
Sotiris Adamakis wrote:
Appologies for cross-posting
Dear R users,
I am using R2WinBUGS to call WinBUGS from R. After loading data, model, and
initial values I call this command
res <- bugs(data = dfile, ini
This problem may well be due to the repeated R_alloc calls, and might be
fixable by refactoring the code, but I am not sure that is the answer here.
This package is designed for the 3' biased arrays (and works well enough for
them), and isn't intended to be used for the newer random primer array
Gabor Grothendieck wrote:
** works as exponentiation for me:
3**2
[1] 9
Yes, but see ?"**" that it is just documented in a note and has been
deprecated in S since 20 years...
Uwe Ligges
On Tue, Dec 29, 2009 at 6:10 AM, Phil Spector wrote:
Nancy -
Please notice that ** is not an
Anny Huang wrote:
> Is there a way that I can import R functions into Fortran? Especially, I
> want to generate random numbers from some not-so-common distributions (e.g.
> inverted chi square) but did not find any routines written in Fortran that
> deal with distributions other than uniform and
** works as exponentiation for me:
> 3**2
[1] 9
On Tue, Dec 29, 2009 at 6:10 AM, Phil Spector wrote:
> Nancy -
> Please notice that ** is not an R operator. The caret (^) is the
> exponentiation operator in R.
> - Phil
>
>
>
> On Tue, 29 Dec 2009, Nancy Ad
You can keep each dataframe as a separate file and process them that way.
You can look into storing in a relational database or using filehash. It
all depends on how you want to process the data later.
On Tue, Dec 29, 2009 at 8:40 AM, Hao Cen wrote:
> Hi,
>
> I currently combine multiple proces
Hi Nancy,
Comments in line:
On Sun, Dec 27, 2009 at 3:34 AM, Nancy Adam wrote:
> Hi everyone,
>
> Can anyone please tell whether there is a difference between the code for
> using svm in regression and code for using svm in classification?
>
> This is my code for regression, should I change it
Jim Bouldin wrote:
When I try to run the following non-linear regression with variables
index1 and prl3:
beta = 4
nls(index1~beta*(1/prl3),start = list(beta = 4))
I get this error message:
Error in nls(index1 ~ beta * (1/prl3), start = list(beta = 4)) :
REAL() can only be applied to a
hot was taken immediately
after pressing up-arrow.
http://www.neilkodner.com/images/skitch/R_mystery-20091229-093157.jpg
Hopefully someone knows what to do about this.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
htt
On Sun, Dec 27, 2009 at 3:33 PM, Carlos J. Gil Bellosta <
c...@datanalytics.com> wrote:
> I tried Amazon EC2 with R recently and wrote an entry about it to a blog I
> collaborate with:
>
> http://analisisydecision.es/probando-r-sobre-el-ec2-de-amazon/
>
> (Unfortunately, it is in Spanish...)
>
Go
For a single row where mat is your matrix and r is the row
> sum(!is.na(mat[r,]))
For every row in the matrix
> rowSums(!is.na(mat))
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Verena Weber
Sent: Tuesday, December 29, 2009 8:
Try this:
rowSums(!is.na(x))
On Tue, Dec 29, 2009 at 11:49 AM, Verena Weber wrote:
> Hi,
>
> I have a n*m matrix and would like to count the number of elements not equal
> to NA in a ROW.
>
> e.g.
>
> x 1 2 3 NA 10
> y 2 NA 8 9 NA
>
> Which function can I use to obtain
> "4" for row x and
> "3"
Hi,
I have a n*m matrix and would like to count the number of elements not equal to
NA in a ROW.
e.g.
x 1 2 3 NA 10
y 2 NA 8 9 NA
Which function can I use to obtain
"4" for row x and
"3" for row y?
Could you help me? I found some functions for columns but not for rows...
Thank you very muc
Hi,
I currently combine multiple processed data (data frame) into a list and
save the list as ".rda" using the save command. When new data come, I load
the rda file, process the new data into a data frame, append the data
frame to the end of the list, and save the whole list to the disk. The
loadi
Dear list,
I have a balance connected to the serial port of a windows machine ("COM1") and
I read the text
output of the balance with
scan("COM1", what="character", sep="\n", n=1)
after calling the previous line I press the print key on the balance which
triggers sending one line
of text to th
Hi:
To make a more legible ordering of the plots, it might be a good idea to
make m$L1 an
ordered factor rather than a character variable:
m$L1 <- ordered(m$L1, levels = paste('dataset', 1:15, sep = ''))
# Lattice
bwplot(value ~ x | L1, data = m, as.table = TRUE)
# ggplot2
ggplot(m)+
geom_boxp
Nancy,
There is a function in the caret package called defaultSummary that
will compute both RMSE and R2 for you.
Max
On Dec 28, 2009, at 11:51 PM, Nancy Adam
wrote:
Hi everyone,
I tried to write the code of computing R2 for a regression system
but I failed.
This is the code I us
I forgot the base graphics way,
## divide the window in 4x4 cells
par(mfrow=n2mfrow(length(datasets)))
## loop over the list of datasets and plot each one
be.quiet <- lapply(datasets, function(ii) boxplot(y~x, data=ii))
ggplot2 has a website with many examples,
http://had.co.nz/ggplot2/
as well
Hi,
Here is some artificial data followed by minimal ggplot2 and lattice examples,
makeUpData <- function(){
data.frame(x=sample(letters[1:4], 100, repl=TRUE), y=rnorm(100))
}
datasets <- replicate(15, makeUpData(), simplify=FALSE)
names(datasets) <- paste("dataset", seq_along(datasets), sep
Dear All,
I am given 15 different data sets and I would like to generate a panel
showing all of them.
Each dataset will be presented either as a boxplot or as a histogram.
There are several possible ways to achieve this (as far as I know)
(1) using plot and mfrow()
(2) using lattice
(3) using ggp
Nancy -
Please notice that ** is not an R operator.
The caret (^) is the exponentiation operator in R.
- Phil
On Tue, 29 Dec 2009, Nancy Adam wrote:
Hi everyone,
I tried to write the code of computing R2 for a regression system but I failed.
This is
On 12/28/2009 10:38 PM, Dean1 wrote:
How can I resolve this problem?...
As a general example,
plot (1:4)
polygon(c(0,0,5,5),c(0,5,5,0), border="lavenderblush1", col =
"lavenderblush1")
###see how this overlays the axes lines
#I have tried...
for (k in 1:4) axis(k, lwd.ticks=0, label=F)
#...but
Hi,
I think you can also use plyr for this,
dft <- read.table(textConnection("P1idVeg1Veg2AreaPoly2 P2ID
1 p p 1 1
1 p p 1.5 2
2 p p 2 3
2 p h 3.5 4")
Hi,
Try print(p) instead of plot(p)
HTH,
baptiste
2009/12/29 Bryan Hanson :
> I¹m trying to build a simple formula interface to work with a function using
> ggplot2. The following scheme ³works² up until the plot(p) request, at which
> point there are complaints about xlim¹s and a blank graphic
71 matches
Mail list logo