Here's a toy example which you can apply the logic of:
dfr - expand.grid(1:3,1:2)
results - apply(dfr, 1, sum)
dfr[results==4,]
On 25 January 2013 22:19, Andras Farkas motyoc...@yahoo.com wrote:
Dear All
I have the following data (somewhat simplyfied):
TINF -1
a
Thanks for your commands, Ivan and Michael! However, I am still not
producing the right codes. Would you please help me on this? I've written
the following codes. Please comment. Thank you very much.
Task: Reading data1.dat to data1000.dat (with missing files) into R.
Missing files can be omitted
Hi Ray,
Comments below:
On 26 January 2013 09:03, Ray Cheung ray1...@gmail.com wrote:
[snip]
###FUNCTION TO READ FILES
little_helpful - function(n) {
file_name - paste0(C:/.../data, n, .dat)
read.table(file_name)
}
###RETURN AN OBJECT WHICH CHECKS FOR THE EXISTENCE OF FILES
check -
Following David's suggestion you might want to have a look at
https://confluence.clazzes.org/display/CSVEDIT/CSVEdit+Home .
I have not used it but it seems to get good reviews from people I know.
John Kane
Kingston ON Canada
-Original Message-
From: dwinsem...@comcast.net
Sent:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
John Kane
Kingston ON Canada
-Original Message-
From: eliza_bo...@hotmail.com
Sent: Fri, 25 Jan 2013 18:13:55 +
To: r-help@r-project.org
Subject: [R] joint probability distribution
Dear
This an alternating way of doing it using a list if you know the
argument names in
the function definition i.e. ?formals and ?alist, But would change
the default values of the function. Probably not you wanted.
f - function(x,y,z) x+y+z
args-alist(x=5,y=6,z=7)
formals(f) - args
f()
[1] 18
Sorry Jeff, probably the new version of Yahoo mail doing the html, I switched
back to the older one hope that takes care of the problem. Let me clarify the
code below:
TINF -1
a -c(500,750,1000,1250,1500,1750,2000)
b -c(8,12,18,24,36,48,60,72,96)
infcprodessa -function (D, tin, tau, ts)
How can I do with R an APi or java popup or slide window information ?
I would like to generate a html or php files raster map colors, with a
numerical values, and with information popup window over each data. Do
you know any Java or gogle APi examples?
Hello,
I'm a newbie to R, I have a quesiton.
I'm a bit confused on global variable assignments.
I have the following situation. I have 2 global variables current_idx and
previous_idx. *These 2 global variables have to be set by a method in a
reference class*.
Essentially, using - assignment
Hi,
I've been trying to work this out how it works, I'm still not totally sure but
seems to me it subsets the matrix according to whether each column returns all
TRUE, to not being the same values when you compare the column[-1] and the
column[-length(column)], essentially siding the column
I have written a program in C that two xy datasets, aligns these 2 datasets
based on shared features, transforms them into equal sized histograms,
transforms the histograms into cumulative distribution functions (via GSL)
and finally performs a KS_test.
I am wanting to validate my program's
Duncan,
Good point - I guess I am expecting too much. I'll work on a global replace
before import or chopping with strsplit while importing.
FYI everyone - these folks with the non-standard csv are the US Feds:
How can we possibly know where you went wrong if you don't tell us where you
went?
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---
Jeff NewmillerThe
It is generally expected that the questioner pose a specific example so the
respondent can have some assurance they are answering the actual question. In
this case please provide a test data set, intermediate results, and final
result generated by your C program. It would also show that you
On 26-01-2013, at 12:31, Andras Farkas motyoc...@yahoo.com wrote:
Sorry Jeff, probably the new version of Yahoo mail doing the html, I switched
back to the older one hope that takes care of the problem. Let me clarify the
code below:
TINF -1
a -c(500,750,1000,1250,1500,1750,2000)
b
HI Ben,
Sorry, I didn't test it at that time to different cases.
testm[,apply(testm,2,function(x) all(c(TRUE,x[-length(x)]!=x[-1])))]
x[-length(x)] #removes the last observation in each column
x[-1] #removes the first observation in each column
#and compares them for each column.
If I change the
On Jan 26, 2013, at 16:32 , Tim Howard wrote:
Duncan,
Good point - I guess I am expecting too much. I'll work on a global replace
before import or chopping with strsplit while importing.
FYI everyone - these folks with the non-standard csv are the US Feds:
On 23.01.2013 23:41, Cláudio Brisolara wrote:
Hello R-users
I am getting error messagens when I require some packages or execute some
procedures, like these below:
require(tseries)
Loading required package: tseries
Error in get(Info[i, 1], envir = env) :
cannot allocate memory
Hi listers,
I want to make lattice plots xyplots with the indication of legends
inside each panel with only the points and the lines actually ploted
inside each given panel according to the group(ing) factor.
The code below shows what I have achieved so far and I hope will make
clear what I
The unlist-sapply-seq_len bit is unnecessarily convoluted, since the
infcprodessa function can accept vector inputs.
z - infcprodessa( ab$a, TINF, ab$b, ab$b-TINF )
possibles - ab[ z = 15 z = 20, ]
possibles[ which.min( possibles$a ), ]
On 24.01.2013 13:33, kevj1980 wrote:
ES function gives the below error.
ES(sim, p=.95, method=c(modified),portfolio_method=c(component),
weights=w1)
We get:
Error: object 'ES' not found
Uwe Ligges
/Error in checkData(R, method = xts, ...) : The data cannot be converted
into a time
On 19.01.2013 01:57, Julien Mehl Vettori wrote:
Dear Herry,
This is the R-help mailing list with thousands of readers. Your message
is without any context. Do you really expect an answer?
Best,
Uwe Ligges
I would like to know if you found an answer elsewhere to your question.
I'm
I'm wondering if I need to use a function other than sapply as the following
line of code runs indefinitely (or 30 min so far) and uses up all 16Gb of
memory on my machine for what seems like a very small dataset (data attached
in a txt file wells.txt
On 26-01-2013, at 19:43, emorway emor...@usgs.gov wrote:
I'm wondering if I need to use a function other than sapply as the following
line of code runs indefinitely (or 30 min so far) and uses up all 16Gb of
memory on my machine for what seems like a very small dataset (data attached
in a
Hello again,
I generally use Clipboard to load data into R from Excel using the
read.delim() function. In most cases, my data after loading looks like
below:
myData - structure(list(V1 = structure(c(3L, 2L, 1L, 1L, 2L), .Label = c(,
2, a), class = factor), V2 = structure(c(4L, 3L, 1L, 2L,
1L),
On 26.01.2013 20:46, Berend Hasselman wrote:
On 26-01-2013, at 19:43, emorway emor...@usgs.gov wrote:
I'm wondering if I need to use a function other than sapply as the following
line of code runs indefinitely (or 30 min so far) and uses up all 16Gb of
memory on my machine for what seems
On 26-01-2013, at 21:09, Uwe Ligges lig...@statistik.tu-dortmund.de wrote:
On 26.01.2013 20:46, Berend Hasselman wrote:
On 26-01-2013, at 19:43, emorway emor...@usgs.gov wrote:
I'm wondering if I need to use a function other than sapply as the following
line of code runs indefinitely
On 13-01-26 3:00 PM, Christofer Bogaso wrote:
Hello again,
I generally use Clipboard to load data into R from Excel using the
read.delim() function. In most cases, my data after loading looks like
below:
myData - structure(list(V1 = structure(c(3L, 2L, 1L, 1L, 2L), .Label = c(,
2, a), class =
On 26.01.2013 21:23, Berend Hasselman wrote:
On 26-01-2013, at 21:09, Uwe Ligges lig...@statistik.tu-dortmund.de wrote:
On 26.01.2013 20:46, Berend Hasselman wrote:
On 26-01-2013, at 19:43, emorway emor...@usgs.gov wrote:
I'm wondering if I need to use a function other than sapply as
Hallo to everybody,
I would like to perform an analysis but I don't know how to proceed and
whether R packages are available for my purpose or not. Therefore I'm here
to request your support.
*The idea is the following:* I noticed that the names of the towns and
villages in northern Italy most of
Hi Steve,
IMO this problem does not need a classifier but rather a database and a
simple query. I would just build a database with all city names including
the geo information, and then say whether it is north or south exactly.
If there was such a rule (which I doubt) I would expect it to have
Hi,
myData[]-lapply(myData,as.character)
as.matrix(myData)
# V1 V2 V3 V4 V5
#[1,] a b c d f
#[2,] 2 4 7
#[3,]
#[4,] 34 4
#[5,] 2 4 4
str(as.matrix(myData))
# chr [1:5, 1:5] a 2 2 b 4 34 ...
#- attr(*, dimnames)=List of 2
#..$ : NULL
#..$ : chr
Hi,
May be this helps:
wells-read.table(wells.txt,header=FALSE,stringsAsFactors=F)
wells2-wells[-grep(.*\\_.*\\_,wells[,1]),]
head(wells2)
# V1 V2
#1 w7_1 0
#2 w11_1 0
#3 w12_1 0
#4 w13_1 0
#5 w14_1 0
#6 w15_1 0
wellsNew-wells[grep(.*\\_.*\\_,wells[,1]),]
head(wellsNew)
#
HI,
?grep() found to be a bit faster.
system.time({
indx-grep(.*\\_.*\\_,wells[,1])
wells2-wells[-indx,]
wellsNew-wells[indx,]})
# user system elapsed
# 0.024 0.000 0.023
system.time({
w.sub - gsub([^_]+,,wells[,1])
u.2 - which(w.sub==__)
u.1 - which(w.sub==_)
w.u1- wells[u.1,]
Hi Giovanni,
thanks a lot for your quick reply!!!
I try to answer you in a few points:
1 - A Data Base containing all the towns and the Region they belong to
(North, Sud...) is already available on the ISTAT site (www.ISTAT.it);
2- My goal was just to find a method supporting my idea, that is to
Well, I'd guess you have to first define what you mean by prediction
ellipse, as the confidence ellipses are for the bivariate
distribution of 2 parameter estimates -- as I understand it --
whereas predictions depend on the covariate values and are for a
single response value (unless you have
domcastro wrote
Hi
I'm trying to convert a column of strings (nominal types) to a set of
boolean / binary / logical values. For example, in the column there is
red, blue, green and yellow. There are 100 rows and each has a colour. I
want to convert the column to 4 columns: red, blue,
On Sat, Jan 26, 2013 at 10:26 AM, Tito de Morais Luis
luis.tito-de-mor...@ird.fr wrote:
Hi listers,
I want to make lattice plots xyplots with the indication of legends
inside each panel with only the points and the lines actually ploted
inside each given panel according to the group(ing)
Hi all mailing listers,
My question is as follows:
e.g.
I launched two packages, say packageA and packageB, but they have the
function of the same name, leading to masking. I want to remove the
packageA from the working window after using the packageA so as not to
causing problem. I do not want
Dear R People:
I have an AOV model that I get confidence intervals from via
confint(chick1.aov1)
2.5 % 97.5 %
trtA 1.472085 1.607915
trtB 1.512085 1.647915
trtC 1.328751 1.464582
I am using R2HTML to produce HTML output. However, the HTML code
itself just has rounded values, i.e.,
Realized I did not reply to this list.
On Sat, Jan 26, 2013 at 7:54 PM, Joshua Wiley jwiley.ps...@gmail.com wrote:
Hi Erin,
Most packages creating output for inclusion in pages, reports, books,
etc. do some rounding as R's default level of printed precision tends
to be overkill. R2HTML is
On Jan 26, 2013, at 6:26 PM, hp wan wrote:
Hi all mailing listers,
My question is as follows:
e.g.
I launched two packages, say packageA and packageB, but they have the
function of the same name, leading to masking. I want to remove the
packageA from the working window after using the
Thanks a lot!
2013/1/27 David Winsemius dwinsem...@comcast.net
On Jan 26, 2013, at 6:26 PM, hp wan wrote:
Hi all mailing listers,
My question is as follows:
e.g.
I launched two packages, say packageA and packageB, but they have the
function of the same name, leading to masking. I want
43 matches
Mail list logo