Thanks, Bill
bill.venab...@csiro.au wrote:
fn <- function(x) {
j <- x+1
cat("the value of j is ", j, "\n")
j
}
fn(1:10)
It is clear for me now the use of cat(). As Steve pointed out in his
mail, I've failed at providing an example, one of the rules of thumb of
this
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Many thanks, BBsolve works like a charm.
First I thought I should use the squares of the equations because BBsolve
would use some minimization objective function anyway but it actually only
works if I don't use the squared equations. I'll check the documentation if
I find something about the obj
Hi,
Does anybody know whether it's possible (and sensible) to calculate R^2 (or
something approximating R^2) on the results of a major axis Model II regression
done by lmodel2?
The function lmodel2 provides an R^2 for the OLS regression only (example
below), but not for major axis regression.
hi,,i'm icha,,,
i'm indonesian college student in Padjadjaran University major in Statistics.
My lecture suggests me to use R in finishing my final project which is focus on
hierarchical forecasting. sir,,could you help me, i wanna ask the R-languanges
deal with hierarchical forecasting with to
massiel wrote:
Hello,
I am trying to learn how to run Bugs from R using Linux…I’m new
at Linux so I have been looking what others do on the web, but the info is
confusing. Is there any good source where to go and learn how to set up and
run Bugs from R in Linux? When I needed to do thi
windows XP
R 2.8.1
I would like to learn to use Sweave with R. I have no experience using Latex. I
have looked at the sweave manual
(http://www.statistik.lmu.de/~leisch/Sweave/Sweave-manual.pdf) and have found
it difficult to understand, probably because I don't know Latex. Can someone
recomme
Resolved. It works if I set iter=0.
On Thu, Aug 6, 2009 at 9:03 PM, Donald Braman wrote:
> I was trying to fit a curve to the number of people who identify as liberal
> by age. I got some puzzling results which suggested to me that I don't
> really understand how local polynomial fitting works
Yes,
I already have solid code to estimate the probabilities and gather the
public estimates.
What I'm stuck on is how to train the "race-wise" logit and then somehow
combine them to come up with a final set of coefficients.
I could just train a glm on the whole data set, but would be losing t
I am trying to fit a curve to the number of people who identify as liberal
by age. I got some puzzling results which suggested to me that I don't
really understand how local polynomial fitting works. Why, I am wondering,
is lowess producing a local fit of zero for every age?
> liberal
[1] 0 0 0
I was trying to fit a curve to the number of people who identify as liberal
by age. I got some puzzling results which suggested to me that I don't
really understand how local polynomial fitting works. Why, I am wondering,
is lowess producing a local fit of zero for every age?
> liberal.bin
[1]
Ivo Shterev wrote:
Hi,
Perhaps I have to rephrase a bit my question. If we have the following:
i = 10
f1 = function(i){
i <<- 1
}
after calling f1, the value of i becomes 1. Now, suppose that f1 is called in
another function f2, and i is initialized in f2 as well, i.e:
f2 = function(n){
i =
Hello,
[5956] 10242.793600 10233.872700 10229.265400 10230.835200 10230.715500
[5961] 10233.706500 10231.821200 10235.511800 10232.515900 10240.365800
[5966] 10244.216100 10252.208800 10249.710600 10249.591500 10258.640800
[5971] 10263.172300 10263.327800 10271.161200 10268.512200 10268.465800
[5
Hello,
I am trying to learn how to run Bugs from R using Linux...I'm
new at Linux so I have been looking what others do on the web, but the
info is confusing. Is there any good source where to go and learn how to
set up and run Bugs from R in Linux? When I needed to do this with
windows
Hi
I have a data set which is like this:
Data
ID Type
1 A
2 B
3 A
4 A
5 A
6 B
7 B
8 A
9 B
10 B
As you can see, there are 5 A and 5 B. Now, I want to a randomization of the
data set which will assign 5 ID to a new group called "Set1"
Wow. Very nice. Amazingly terse. I will throw out the looping function I
just debugged...
greg
Henrique Dallazuanna wrote:
>
> Try this:
> t(sapply(DF1, table))
>
> On Thu, Aug 6, 2009 at 2:14 PM, ghinkle wrote:
>
>>
>> Can anyone explain how best to go from a dataframe to a table (or be
Hi,
On Aug 6, 2009, at 7:25 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote:
Please, could you give me an example about how to use cat() to read
the value of a variable in a function? Any other way?
Can you please give an example of what you're trying to do?
It seems like you're asking to u
Please, could you give me an example about how to use cat() to read the
value of a variable in a function? Any other way?
I've found how to make it globally available, thus printing it, but I
don't know how to read out the value of any variable within the function.
Thanks for your help,
Rica
Hello,
I am trying to learn how to run Bugs from R using Linux
Im new
at Linux so I have been looking what others do on the web, but the info is
confusing. Is there any good source where to go and learn how to set up and
run Bugs from R in Linux? When I needed to do this with windows I
Steve and others have already directly answered your question
but to add to that note that the
way this would normally be done in R is to avoid the need
for references and environment handling in the first place
and just have f1 pass i back and have f2 assign f1's output to i.
f1 <- function(i) 1
Thanks Roger,
I appreciate the feedback.
The paper I'm reading makes it sound like a very simple step. I'm still
not sure how to do this. I'll keep reading.
Thanks!
-N
On 8/6/09 3:15 PM, roger koenker wrote:
> You could take a look at:
>
> M West, PJ Harrison, HS Migon - Journal of the Amer
You could take a look at:
M West, PJ Harrison, HS Migon - Journal of the American Statistical
Association, 1985 - jstor.org
Page 1. Dynamic Generalized Linear Models and Bayesian Forecasting
and the subsequent literature it has generated... or along the same
lines the literature on chess
r
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris
> Sent: Thursday, August 06, 2009 3:00 PM
> To: milton.ru...@gmail.com
> Cc: r-help@r-project.org; daniel.gerl...@geodecapital.com
> Subject: Re: [R] Why is 0 not
Hi,
Perhaps I have to rephrase a bit my question. If we have the following:
i = 10
f1 = function(i){
i <<- 1
}
after calling f1, the value of i becomes 1. Now, suppose that f1 is called in
another function f2, and i is initialized in f2 as well, i.e:
f2 = function(n){
i = n
f1(i)
}
The inten
Posted about this earlier. Didn't receive any response
But, some further research leads me to believe that MAYBE a GLMM or a
GEE function will do what I need.
Hello,
I have a bit of a tricky puzzle with trying to implement a logit model
as described in a paper.
The particular paper is on
I ran an instant experiment...
> typeof(0)
[1] "double"
> typeof(-0)
[1] "double"
> identical(0, -0)
[1] TRUE
Best,
Giovanni
> By the way:
>
> Are there difference between -0 and 0?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/l
Please do read the posting guides and give us a reproducible
example. We don't know what the errors you get from HoltWinters
are. I guess we need to see the data you are using etc.
Giovanni Petris
> Date: Thu, 06 Aug 2009 11:33:58 -0700 (PDT)
> From: voidobscura
> Sender: r-help-boun...@r-proje
By the way:
Are there difference between -0 and 0?
On Thu, Aug 6, 2009 at 5:00 PM, Gerlanc, Daniel <
daniel.gerl...@geodecapital.com> wrote:
> b/c
> > class(0)
> [1] "numeric"
>
> > typeof(0)
> [1] "double"
>
> > class(0L)
> [1] "integer"
>
> > typeof(0L)
> [1] "integer"
>
> When you call the
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius
> Sent: Thursday, August 06, 2009 1:40 PM
> To: ghinkle
> Cc: r-help@r-project.org
> Subject: Re: [R] Convert dataframe to table with counts where
> column namesb
Well, the tick marks are at every 200, how do i make them at every 100?
On Thu, Aug 6, 2009 at 2:02 PM, Mehdi Khan wrote:
> nevermind, I just looked at Steve's reply to mohsen and it worked!
> stripplot(jitter(clahanvs30) ~ vs30, data = completetable, ylim=c(0:2000),
> xlim=c(0:2000))
>
>
> On T
Try this:
g <- sapply(DF1$ID, grep, x = DF2$ID)
transform(DF2[unlist(g),],ID = DF1$ID[which(g > 0)])
On Thu, Aug 6, 2009 at 1:41 PM, Rnewbie wrote:
>
> dear all,
>
> I have two dataframes
>
> dataframe1
> ID
> a
> b
> c
>
> dataframe2
> ID value
> a;W 100
> X;c 200
> Y;Z 300
nevermind, I just looked at Steve's reply to mohsen and it worked!
stripplot(jitter(clahanvs30) ~ vs30, data = completetable, ylim=c(0:2000),
xlim=c(0:2000))
On Thu, Aug 6, 2009 at 1:54 PM, Mehdi Khan wrote:
> Hello everyone, simple question--the documentation is confusing so i am
> forced to as
b/c
> class(0)
[1] "numeric"
> typeof(0)
[1] "double"
> class(0L)
[1] "integer"
> typeof(0L)
[1] "integer"
When you call the ":" function it always returns an integer sequence,
but when you assign a numeric to an element of the vector it gets
coerced to the more general type, in this case, nume
Hi,
On Aug 6, 2009, at 4:48 PM, Mohsen Jafarikia wrote:
Hello All:
Can anybody tell me what is the problem with my program please. I
have an
error message as appears below.
My program is:
ifn <- "Jul08_09.LM"
data <- read.table(ifn)
ofn <- "Jul.png"
bitmap(ofn, type = "png256", width = 3
Hello everyone, simple question--the documentation is confusing so i am
forced to ask:
I have a strip plot, how do create my own axis tick marks and set limits?
Thanks!
stripplot(jitter(clahanvs30) ~ vs30, data = completetable)
Mehdi Khan
[[alternative HTML version deleted]]
Hello All:
Can anybody tell me what is the problem with my program please. I have an
error message as appears below.
My program is:
ifn <- "Jul08_09.LM"
data <- read.table(ifn)
ofn <- "Jul.png"
bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg =
"white",res=50)
par(mar=c(
On 8/6/2009 4:11 PM, Marilyn & Rich Short wrote:
Hello,
I'm having a problem in R. The R GUI is crashing with a message to
contact Microsoft for the solution. I've contacted Microsoft and they
are of no help. Below is a distilled set of code that will cause the
crash. As you will see, there a
On Aug 6, 2009, at 1:14 PM, ghinkle wrote:
Can anyone explain how best to go from a dataframe to a table (or
better yet
a new dataframe) of counts, where the row names in the new table (or
dataframe) are the column names of the original df.
start w/
DF1 =
Pos1 Pos2 Pos3
oli
Try this:
t(sapply(DF1, table))
On Thu, Aug 6, 2009 at 2:14 PM, ghinkle wrote:
>
> Can anyone explain how best to go from a dataframe to a table (or better
> yet
> a new dataframe) of counts, where the row names in the new table (or
> dataframe) are the column names of the original df.
>
> start
So is your question:
Can you/how do you pass variables by reference in R? I do not know the answer,
but I do think that is what you're getting at, yes?
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Ivo Shterev
Sent: Thursday
On 8/6/2009 4:11 PM, Ivo Shterev wrote:
Hi,
The intention is that after executing f2, the value of i to become 1.
f1 = function(i){i = 1}
f2 = function(n){ i = length(n)
f1(i)
print(i)}
i.e. f2 should print 1, not length(n).
ivo
--- On Thu, 8/6/09, Steve Lianoglou wrote:
From: Steve Li
dear all,
I have two dataframes
dataframe1
ID
a
b
c
dataframe2
ID value
a;W 100
X;c 200
Y;Z 300
I wanted to match the IDs from the two dataframes and record the values into
a new column of dataframe1 at the corresponding rows. This is what I expect:
dataframe1
ID valu
Howdy,
On Aug 6, 2009, at 4:11 PM, Ivo Shterev wrote:
Hi,
The intention is that after executing f2, the value of i to become 1.
f1 = function(i){i = 1}
f2 = function(n){ i = length(n)
f1(i)
print(i)}
i.e. f2 should print 1, not length(n).
Yeah, you can using parent.frame()'s and such:
f
Hello,
I'm having a problem in R. The R GUI is crashing with a message to
contact Microsoft for the solution. I've contacted Microsoft and they
are of no help. Below is a distilled set of code that will cause the
crash. As you will see, there are two do-loops within which is a "load"
command.
Hi all,
I just need help understanding the filter function. I've seen how to use it
to smooth a time series, but how do you know which is a good smoothing?
Also, I have seen people do things like x1 = filter(x,filter=rep(1/5,5)) or
x2 = filter(x,filter=rep(1/10,10)). I know that rep creates a
It freezes at the last line. Do you know why?
> dump.pager <- function( files, ...){
+cat( readLines( files ), sep = "\n" )
+ }
> options( pager = dump.pager )
> help(ls)
Help on topic 'ls' was found in the following packages:
Package Library
AnnotationDbi /home/
I have a set of data (in a matrix). I spliced a column out and parsed it
as.ts (time series). I then plotted the time series but I found that it was
very noisy. I wanted to smooth it out. However, I am having some problems
smoothing and plotting the smoothed version.
> A <- as.ts(read.table
Hello I have performed the following ANOVA test (age = young and old,
tret = non treated and treated):
> ANOVA_EPC<-aov(Dibi ~ age*tret, data = EPC)
> summary(ANOVA_EPC)
Df Sum Sq Mean Sq F value Pr(>F)
age 1 25.346 25.346 2.4510 0.13587
tret 1 5.962 5.96
Can anyone explain how best to go from a dataframe to a table (or better yet
a new dataframe) of counts, where the row names in the new table (or
dataframe) are the column names of the original df.
start w/
DF1 =
Pos1 Pos2 Pos3
oligo1 G C A
oligo2 U U A
o
Hi,
The intention is that after executing f2, the value of i to become 1.
f1 = function(i){i = 1}
f2 = function(n){ i = length(n)
f1(i)
print(i)}
i.e. f2 should print 1, not length(n).
ivo
--- On Thu, 8/6/09, Steve Lianoglou wrote:
> From: Steve Lianoglou
> Subject: Re: [R] A question r
Try this:
myfunc <- function(...)table(...)
with(mydataset, myfunc(ages, sex))
On Thu, Aug 6, 2009 at 4:50 PM, Polwart Calum (County Durham and Darlington
NHS Foundation Trust) wrote:
> I may be doing this wrong! but I have a function which I have simplified a
> lot below. I want to pass some
Dear All?
Basically I want to write the results of the sample function into an array
is a specific order. The sample function uses a dataframe x.1 and therefore
the result is also a dataframe and so I cannot write the result into the
array in the correct order. If I convert x.1 into a matrix then
Dear All
I 've solved this problem...
Thanks
Meenu
On Thu, Aug 6, 2009 at 1:28 AM, Meenu Sahi wrote:
> No its not an or condition. Please see the changed attachment.
>
> Many thanks for your help.
>
> Regards
> Meenu
>
> On Wed, Aug 5, 2009 at 6:36 PM, David Winsemius wrote:
>
>>
>> On Aug 4,
I may be doing this wrong! but I have a function which I have simplified a lot
below. I want to pass some 'field names' of a data-frame to the function for
it to then do some manipulation of.
Here's my code:
#build a simple dataset
mydataset = data.frame (
ages=c('40-49','40-49','40-49','30-
Ravi Varadhan wrote:
>
> You have two options:
>
> 1. The `BBsolve' function in the "BB" package to solve this system of 3
> equations.
> 2. Try `nleqslv' function in the "nleqslv" package.
>
> These would work even if the residual is not zero.
>
I hope so but I have some doubts.
>From th
Hi,
You can define your own pager:
Something like this might do what you want:
dump.pager <- function( files, ...){
cat( readLines( files ), sep = "\n" )
}
options( pager = dump.pager )
Romain
On 08/06/2009 08:59 PM, Peng Yu wrote:
Hi,
In R command line, when I type "help(something)
Is there a command line option for me to figure out what R version
Rscript calls?
On Aug 6, 10:23 am, Gabor Grothendieck
wrote:
> Try:
>
> Rscript -e R.version.string
>
> to get the R version, or
>
> Rscript --version
>
> if you want to know the version of Rscipt itself rather than R.
>
>
>
> On
Dear r-help,
I am using R for MacOS (R 2.9.1 GUI 1.28 Tiger build 32-bit (5444))
and would like to be able to use MacOS system fonts for the labels on
my plots. So far I have been unsuccessful, to get this to work.
Reading the help I found the quartz() and quartzFonts() commands. In
an at
Hi,
In R command line, when I type "help(something)", it will always show
the help in the different mode such that I don't see command lines
anymore but just the help document. If I quit from the help mode, I
will only see the command lines by not the help document.
I would like the help document
Hi,
I'm wondering if R provide a vi mode in the command line just like
other shells such as bash do. Can somebody let me know?
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting gu
Hello,
I have a bit of a tricky puzzle with trying to implement a logit model
as described in a paper.
The particular paper is on horseracing and they explain a model that is
a logit trained "per race", yet somehow the coefficients are combined
across all the training races to come up with a
On Thu, Aug 6, 2009 at 10:45 AM, Vitalie S. wrote:
>
>>
>> Completion should be automatic if you define names() to return the valid
>> names.
>
> Thank you Deepayan, that works beautifully. I wonder though; names function
> for environment objects always returns NULL, but completion still works.
>
Anyone have any experience installing R on UNIX or Linux,
I have a Solaris 10 server and have been trying to read the admin
guide and install the R binaries on the machine.
There are several failures due to an unknown pathname:
"ERROR: attribute verification of
failed
pathname does not exist
Completion should be automatic if you define names() to return the valid
names.
Thank you Deepayan, that works beautifully. I wonder though; names
function for environment objects always returns NULL, but completion still
works. Looks tricky.
Vitalie.
--
_
?capture.output
so with the given example this line should do what you wanted while avoiding
the output file
dummy <- capture.output(comparison <- LSD.test(yield,virus,df,MSerror,
p.adj="bonferroni",
group=FALSE, main="Yield of sweetpotato\ndealt with different virus"))
Matthias
David Winsemi
Late, but hopefully not too late ...
Ben,
I had same problem with Cairo-1.4-5 on FreeBSD CURRENT-8.0 (i386). On of
the authors of Cairo (thanks to Simon Urbanek) reminded me to use gmake
instead of make. So in my case I set the environment variable
temporarily like this (in tcsh):
setenv M
On Aug 6, 2009, at 10:36 , bed.si...@oracle.com wrote:
Hi Simon,
I am using the R 2.9.1 with Window XP.
I have one query related with R to the database. I have
successfully connected R to MS-Access.
But when I tried to connect R to SQL Server 2000 then it throwing
some class not foun
On Aug 6, 2009, at 12:24 PM, Erik Iverson wrote:
In my example, I don't want LSD.test to print any output, I just
want
to use some of it later... How to stop it printing anything?
?invisible
I'm not sure that works in this situation:
test <- function() {
print("output")
}
test()
invi
>> In my example, I don't want LSD.test to print any output, I just want
>> to use some of it later... How to stop it printing anything?
>?invisible
I'm not sure that works in this situation:
test <- function() {
print("output")
}
test()
invisible(test())
Both of the above still print out
On Aug 6, 2009, at 11:42 AM, Tymek W wrote:
Hi,
I want to use an output of one function (LSD.test) in other. How is it
that while saving output from LSD.test to variable, it prints own
output out?
The function could be simplified to:
fun <- function ( ... ) {
...
lsd <- LSD.test(data[1
Hi, I have an equation Xcp and would like to look at errors affecting it. I
am applying errors of -.58 to .1 to R and -.45 to .47 to Xc. I would like
to look at all combinations. I set up a matrix function as follows and it
does not work. On the last line, when it run, it does not seem like the
Or just use runif's built-in bounds:
thisMin<-40.15
thisMax<-56.58
runif(1,thisMin,thisMax)
Scott
Scott Sherrill-Mix
Department of Microbiology
University of Pennsylvania
402B Johnson Pavilion
3610 Hamilton Walk
Philadelphia, PA 19104-6076
On Thu, Aug 6, 2009 at 11:11 AM, Sarah Goslee wrote
Hi,
I want to use an output of one function (LSD.test) in other. How is it
that while saving output from LSD.test to variable, it prints own
output out?
The function could be simplified to:
fun <- function ( ... ) {
...
lsd <- LSD.test(data[1], data[2], df, mse)
...
}
In my example,
It really sounds like you want to use points(). Maybe I'm missing the
true question but ellipsePoints returns a 2 column matrix of point
coordinates so passing it's output to points() should plot those
points on whatever plot you currently have open (in this case the plot
of the previous ellipse).
In the solution you cite, yes. In the second solution I provided
in the subsequent (second) response to your question, no.
On Thu, Aug 6, 2009 at 11:17 AM, Rnewbie wrote:
>
> it works, but does that mean I really have to specify what to keep rather
> than what to remove?
>
>
> Gabor Grothendieck
Try:
Rscript -e R.version.string
to get the R version, or
Rscript --version
if you want to know the version of Rscipt itself rather than R.
On Thu, Aug 6, 2009 at 11:18 AM, Peng Yu wrote:
> I didn't know that OS matters. My machine is a linux machine.
>
> I have a few different version of R in
it works, but does that mean I really have to specify what to keep rather
than what to remove?
Gabor Grothendieck wrote:
>
> Try something along these lines:
>
> gsub("[^[:alnum:][:space:],]", "", string)
>
>
> On Thu, Aug 6, 2009 at 8:37 AM, Rnewbie wrote:
>>
>> Dear all,
>>
>> I wanted to
This may be a simple problem, but I am looking to select a subset of rows
from a dataframe that will have the same parameters as all the rows in
another dataframe.
e.g. I have a 500 row dataframe with 20 columns. I want to select a subset
of rows from a larger dataframe that match the distributi
Here is a second solution that may be closer to
what you were thinking of in terms of structure:
library(gsubfn)
gsubfn("[[:punct:]]", ~ sub("[^,]", "", x), string)
This matches each punctuation character and then
removes any non-commas by applying the
function function(x)sub("[^,]", "", x)
gsub
I didn't know that OS matters. My machine is a linux machine.
I have a few different version of R installed in my machine (different
commands like R, R-2.9.0, R-2.8 ..). But I don't see the version of
Rscript. How to figure out which version of R my Rscript uses?
Regards,
Peng
On Thu, Aug 6, 200
That's pretty straightforward to do - here's a simple function. The
exact behavior
at the "edges" is left as an exercise. :)
rbound <- function(rmin, rmax)
{
x <- runif(1)
x <- x * (rmax - rmin) + rmin
x
}
Sarah
On Thu, Aug 6, 2009 at 11:02 AM, damien landais wrote:
> Hi,
> I would obt
sample(c("a","b"))[1]
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of damien landais
Sent: Thursday, August 06, 2009 11:02 AM
To: R-help@r-project.org
Subject: [R] random between two values
Hi,
I would obtain a random value between
Thanks Martin, it's clearer now.
Indeed things get a bit dirty with replace methods. I'm wondering if
it's a bug, a normal behaviour or if there is nothing to do about it?
I think it's because the replace method of A into B is not called after
replacing an object's slot. I imagine this would be
Hi,
I would obtain a random value between two (for example between 40.15 and 56.58
I would have only one value).
I'm looking for a package/a function which could do this.
Could anybody help me please?
Cordialement
Damien Landais
__
R-help@r-project.org
Try something along these lines:
gsub("[^[:alnum:][:space:],]", "", string)
On Thu, Aug 6, 2009 at 8:37 AM, Rnewbie wrote:
>
> Dear all,
>
> I wanted to remove all punctuations except commas from a string.
>
> I used:
>
> gsub("[[:punct:]]", "", string)
>
> but I don't know how to exclude the co
Dear Sir,
I am working with one example in R donlp2. How I can get the Hessian matrix
from the output.
p = c(10,10)
par.l = c(-100,-100)
par.u = c(100,100)
nlin.l = nlin.u = 2
fn = function(x) {
x[1]^2+x[2]^2
}
dfn = function(x){
c(2*x[1], 2*x[2])
}
attr(fn, "gr") = dfn
nlcon = function(x){
x
Try this:
string <- "Aaaa. , ccc"
gsub("[^,[:alpha:]|[:space:]]", "", string)
On Thu, Aug 6, 2009 at 9:37 AM, Rnewbie wrote:
>
> Dear all,
>
> I wanted to remove all punctuations except commas from a string.
>
> I used:
>
> gsub("[[:punct:]]", "", string)
>
> but I don't know how to exclude
Hi,
Are there any R packages around which would break down a time series into a
MxN table for analysis purposes?
For example, show the total sales per month per calendar year.
Jan Feb. Total
2008
2009
Total
Thanks,
Eduard
--
View this message in context:
http://www.nabble.com/
Hi Simon,
I am using the R 2.9.1 with Window XP.
I have one query related with R to the database. I have successfully
connected R to MS-Access.
But when I tried to connect R to SQL Server 2000 then it throwing some class
not found error.
I tried the below script for R
Hi all,
I have a data frame like this:
DF <- data.frame(x = rnorm(10), y = rnorm(10), gr = rep(1:5, 2))
and I make the following xy-plot:
library(lattice)
xyplot(y ~ x, data = DF, groups = gr, type = "b", col = 1)
Is it possible that the two points that belong to the same group specified by
Dear all,
I wanted to remove all punctuations except commas from a string.
I used:
gsub("[[:punct:]]", "", string)
but I don't know how to exclude the commas ",". Anyone would kindly answer
my basic question?
--
View this message in context:
http://www.nabble.com/Remove-all-punctuations-exce
I am facing a similar problem
The code which i am pasting below has been taken from the book "Bayesian
Computation with R" by Jim Albert.
laplace=function (logpost, mode, par)
{
options(warn=-1)
fit=optim(mode, logpost, gr = NULL, par, hessian=TRUE,
control=list(fnscale=-1))
o
You did not specify your OS, but you might try at the shell prompt:
Rscript file.R
See ?Rscript
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Peng Yu
Sent: Thursday, August 06, 2009 9:35 AM
To: r-h...@stat.math.ethz.ch
Subject:
?read.table and check on the options offered by read.csv2.
Open the file in a text editor and see what you have. Check the delimiters and
be sure that that they are either ; as specified in read.csv2 or else specify
the delimiter ( sep= "???"
--- On Thu, 8/6/09, Inchallah Yarab wrote:
> F
Hi,
If I run the below command, it will generate a file 'file.Rout' to
save the output. But I want the output be shown in the screen
directly. I'm wondering if there is a direct way to do so.
R CMD BATCH file.R
Regards,
Peng
__
R-help@r-project.org ma
You have two options:
1. The `BBsolve' function in the "BB" package to solve this system of 3
equations.
2. Try `nleqslv' function in the "nleqslv" package.
These would work even if the residual is not zero.
Hope this helps,
Ravi.
__
Try this:
m[!apply(m < 0, 1, any),]
On Thu, Aug 6, 2009 at 9:57 AM, Inchallah Yarab wrote:
> Hi ,
>
> I need to write a function to delete a row if the value of one element of
> the row is negatif!!!
> I have a big file of data and i will check every lines!!!
>
> Any ideas
> Thank you !!
>
>
>
>
Don't understand what this has to do with SQL, or why you're asking
for SQL solutions in an R mailing list, but here are some R
suggestions.
(abbreviating "COLUMN" with "C")
At 11:40 AM -0700 8/3/09, JoK LoQ wrote:
Hi,
Im trying to complete a list of jobs using SQL Querries and some "if else
You can also use ggplot2:
library(ggplot2)
x <- rnorm(1);y <- rnorm(x);myplot <- data.frame(x,y)
qplot(x,y,data= myplot,colour=I(alpha("blue",1/25)))
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
--- On Wed, 8
Hi,
On Aug 6, 2009, at 9:26 AM, Inchallah Yarab wrote:
hi,
i have a file with 49000 lines i want to do a classification in two
tables
suppose data <- read.csv2("c:/total.csv", sep=",")
if the second colonne contains ( A,B,C,D)> tab1
if the second colonne contains ( E,F,G,H)-
1 - 100 of 131 matches
Mail list logo