No, My X label are so big so i cannot reduce margin and cex change won't
affect it much. Is there any way to write legend first and start plot
later.
Regards
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4638997.html
Sent from the R
I didn't do any research about this but I think it's the following:
If you run several t-tests to compare groups and then do a tukey-HSD you
won't get the same results either.
It's the same with the kruskal-wallis test. This happens because the
variance that is used for computing significant
The only way then i believe is to reduce the width of the bars. Make it 0.5
in case if the numbers of variable allows you to do so.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4639002.html
Sent from the R help mailing list archive at
Thanks for the response Petr
On Aug 2, 2012, at 11:11 PM, Petr Savicky [via R] wrote:
On Thu, Aug 02, 2012 at 02:27:43AM -0700, khris wrote:
On Aug 2, 2012, at 12:39 PM, Petr Savicky [via R] wrote:
On Wed, Aug 01, 2012 at 04:55:30AM -0700, khris wrote:
Hi Petr,
It
Hi Bert,
I won't post any more messages on this thread as problem has shifted from
Optimization in R to Graph Algorithms.
Rest fine
Khris.
On Aug 2, 2012, at 9:13 PM, Bert Gunter [via R] wrote:
This discussion needs to be taken off (this) list, as it appears to
have nothing to do with R.
Hi
OTOH I wonder why cbind gives error as OP told us
x - data.frame(x = 1:5)
y - data.frame(y = 6:15)
merge(x,y)
cbind(x,y)
Gives different results but without any error.
Regards
Petr
On Thu, Aug 2, 2012 at 4:52 PM, Ayyappa Chaturvedula
ayyapp...@gmail.com wrote:
Michael,
Thank you
Hi,
Has anyone been able to figure out how to print all duplicated observations?
I have a dataset, with patients ID, and other lab records.
Some patients have multiple lab records, but 'duplicated' ID will only show me
the duplicates, not the original observation.
How can I print both the
On Aug 2, 2012, at 8:27 PM, arun wrote:
For your first condition, this could be used:
gsub((\\d)[.].*,\\1,49888.85)
[1] 49888
Second condition:
formatC(4333.78889,width=8,format=f,digits=2,flag=0)
#[1] 04333.79
formatC(884333.78889,width=8,format=f,digits=2,flag=0)
#[1] 884333.79
On Aug 3, 2012, at 07:42 , greatest.possible.newbie wrote:
I am doing multiple comparisons for data that is not normally distributed.
For this purpose I tried both functions kruskal{agricolae} and
kruskalmc{pgirmess}. It confuses me that these functions do not yield the
same results although
Thanks to all
The problem is fixed. What happened is that i was using the epicalc library and
this way the program didn´t find the var edad11.
Switching off epicalc everything is all rigth.
Thanks again
Antonio Sousa
__
R-help@r-project.org mailing
Excellent, thank you to both of you!!!
Gail
--
View this message in context:
http://r.789695.n4.nabble.com/apply-function-over-same-column-of-all-objects-in-a-list-tp4638681p4639009.html
Sent from the R help mailing list archive at Nabble.com.
__
I cannot reduce bar width. It is ok for me. Is there any way to merge two
plots one with only legend and other with barplot?
Regards
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4639011.html
Sent from the R help mailing list archive
On Aug 3, 2012, at 09:06 , Weijia Wang wrote:
Hi,
Has anyone been able to figure out how to print all duplicated observations?
I have a dataset, with patients ID, and other lab records.
Some patients have multiple lab records, but 'duplicated' ID will only show
me the duplicates, not
Just to follow up on that: You can use the 'btt' argument in the rma() function
to specify which coefficients to include in the QM test. For example:
data(dat.bcg)
dat - escalc(measure=RR, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg,
append=TRUE)
rma(yi, vi, mods = ~ factor(alloc) + year +
David Winsemius wrote
I didn't get the same results as requested with a wider variety of
tests using those formatting methods. Here's what I could offer:
form3 - function (x) switch(findInterval(x, c( 0, 1, 10^7, Inf)),
format(x, digits=3),
Are you sure that output was produced by: rma(yi, vi, data=dat,
mods=cbind(LateralWedge,Dome,Complex))?
Because your model does not have an intercept, which suggests that you actually
used:
rma(yi, vi, data=dat, mods=cbind(LateralWedge,Dome,Complex), intercept=FALSE)
In that case, the
Hi I am trying to fit a time series data.It gives a AR(2) model using the ar
function and ARMA(1,1) model using autoarmafit function in timsac
package.How do I know which is the correct underlying model? pls help
--
View this message in context:
Hello,
This is a standard example in which I read the time series data from a
csv file and create a zoo object:
x0 - read.csv(file=CPI.csv, header=TRUE)
time_0-as.yearmon(1981-01)+(0:371)/12
x0zoo-zoo(x0, time_0)
The data look like this:
TIME CPI CPI_food CPI_Clothes CPI_House
On Aug 2, 2012, at 21:09 , Bird_Girl wrote:
Hi,
I have a question regarding whether it is possible to do post hoc tests on a
model fit with GAM {mgcv}. My response variable is abundance (no.
individuals per plot), and I have one continuous predictor (light) and one
factor (height) which
Hi,
when I call the function list.files() it also lists directories, although
the parameter include.dirs is set to FALSE by default.
The function also lists directories when the parameter include.dirs is
explicitly set to FALSE list.files(include.dirs=FALSE).
I have tested this also on a mac os -
On Aug 3, 2012, at 10:50 , Simon Schafferer wrote:
Hi,
when I call the function list.files() it also lists directories, although
the parameter include.dirs is set to FALSE by default.
The function also lists directories when the parameter include.dirs is
explicitly set to FALSE
Simon Schafferer wrote
Hi,
when I call the function list.files() it also lists directories,
although
the parameter include.dirs is set to FALSE by default.
The function also lists directories when the parameter include.dirs is
explicitly set to FALSE list.files(include.dirs=FALSE).
I
Ingmar,
many thanks for your answer.
I give you a smaller version of my program with the isolated strange
variable, which I used when trying to elaborate the problem .
[Start of R-Editor quote]
library(foreign)
library(gdata)
library(gtools)
library(gmodels)
library(gplots)
library(xtable)
On Fri, Aug 3, 2012 at 4:33 AM, jpm miao miao...@gmail.com wrote:
Hello,
This is a standard example in which I read the time series data from a
csv file and create a zoo object:
x0 - read.csv(file=CPI.csv, header=TRUE)
time_0-as.yearmon(1981-01)+(0:371)/12
x0zoo-zoo(x0, time_0)
Thank you for your answer.
The p.adj argument in the kruskal()-function doesn't seem to change
anything... Not even the bonferroni-method although it is described as the
most conservative one (multiplying all p-values with the number of
comparisons). I suppose the kruskal()-function is not working
I think the following code provides output that Dennis wants as well
as gets rid of the white space David mentioned.
digitTruncation - function(x)
{
ifelse(x10^7, gsub((\\d)[.].*, \\1, x), ifelse(x1, formatC(x, digits=3,
He folks,
Thank you very much so far. Of course this forum is not intended to be a
substitute for reading the literature, maybe I just posed the question in a
way to general. I understand that rq.anovar produces the wald-test proposed
in
Tests of Linear Hypotheses and L1 Estimation (Koenker,
On Aug 3, 2012, at 11:33 , greatest.possible.newbie wrote:
Thank you for your answer.
The p.adj argument in the kruskal()-function doesn't seem to change
anything... Not even the bonferroni-method although it is described as the
most conservative one (multiplying all p-values with the number
Hi!
On Thu, 2 Aug 2012, Prof Brian Ripley wrote:
You may bave a micro-packaged distribution (some form of SuSE as I recall):
is there a separate R-devel RPM? (Fedora had one an one time.)
Thanks, this made the trick. After having R-base-devel installed I
succeeded in intalling the 'igraph'
Dear all,
in one part of my code I want to sum two vectors element-wise
the problem is that either the 1st vector or the 2nd vector always have one or
two less elements
example of my problem
In TotalVector + (datalist2[[1]]$dataset$Results[[j]]$Results[[time]]$Sweep) :
Länge des längeren
Hi
Your description is quite long but almost uninformative about what you
really want.
You do not say which values you want to sum but you say it is completely
equal which value you want to add to what and what shall be the final
vector length
Based on this I would just use simple +
x-1:10
Hi Michael,
Thanks a lot - enclosing the qplot in a print() worked perfectly !
Regards,
-fj
On Thu, Aug 2, 2012 at 7:37 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
On Thu, Aug 2, 2012 at 6:30 PM, Dennis Murphy djmu...@gmail.com wrote:
On Thu, Aug 2, 2012 at 1:38 PM, Michael
Is the Index of what you cut off or add unimportant or do you have indices on
which to compare them?
If you just want to have the same length, not depending on any indices:
v1-1:9
v2-1:10
minlength-min(length(v1),length(v2))
v1[1:minlength]+v2[1:minlength]
If indices are important:
On Fri, Aug 3, 2012 at 4:27 AM, Lee van Cleef l.van.cl...@gmx.net wrote:
Ingmar,
many thanks for your answer.
I give you a smaller version of my program with the isolated strange
variable, which I used when trying to elaborate the problem .
[Start of R-Editor quote]
library(foreign)
Just move the legend. Change topright to x = ? y = ? whatever to find an empty
place on the plot.
John Kane
Kingston ON Canada
-Original Message-
From: mandecent.gu...@gmail.com
Sent: Fri, 3 Aug 2012 00:17:38 -0700 (PDT)
To: r-help@r-project.org
Subject: Re: [R] How to adjust
Actually this might be shorter for working with indices:
v1[names(v1)%in%names(v2)]+v2[names(v2)%in%names(v1)]
On 03.08.2012, at 15:41, Petr PIKAL wrote:
Hi
Your description is quite long but almost uninformative about what you
really want.
You do not say which values you want to sum
Dear group,
I need help on two problems:
1. I am trying to plot density plots for each individual in 8 occasions.
I can do this by subject wiht the code below:
par(mfrow=c(4,2))
plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1all8scenarios$WSEQ==0]))
Thank you for your reply.
I have used the normalized residuals for my variograms, and although the
values of the semivariogram are lower, the shape and steepness of the curve
is exactly the same.
Any potential test that could help me justifying any improvement on the
model other than merely
I had the same problem and was struggling to find the right codethat was
so helpful, Sarah. thanks!
--
View this message in context:
http://r.789695.n4.nabble.com/scatterplot-x-axis-specifications-tp4630952p4639031.html
Sent from the R help mailing list archive at Nabble.com.
did u try CummeRbund?
http://compbio.mit.edu/cummeRbund/
best,
ib
--
View this message in context:
http://r.789695.n4.nabble.com/Comparing-two-gff-gtf-files-de-novo-transcripts-v-s-reference-tp3934629p4639032.html
Sent from the R help mailing list archive at Nabble.com.
Dear list member,
I deperately need an help in performing a MANOVA in R, but I encountered some
problems both in the design and in the synthax with R.
I conducted a listening experiment in which 16 participants had to rate the
audio
stimuli along 5 scales representing an emotion (sad,
Hey Arne
I don't know about the rounding, but you shouldn't be concerned with the
calculation of Q^2. In the line where a value is assigned to RSS, the value
is assigned to h+1 as shown here:
RSS[h + 1, ] = colSums((Y.old - t.new %*% t(c.new))^2)
i.e. the programmer is messing
Hello,
Iâd like to do next, see if you could help me please:
I have a csv called âdatuakâ with a id called âcalee_idâ and a colunm
called âpoidsâ.
I have another csv called âdatuak2â with the same id called âcalee_idâ,
(although there are âcalee_idâ that are in
Hi
I have a find the class of each variable of the data set which is given as
input. I can able to find the string and the numeric variable. Not able to
find if the variable is date or not
Can any one help me.
-
Thanks in Advance
Arun
--
View this message in context:
The package pbivnorm will certainly solve your problem.
It allows a vectorized call to the cdf of the bivariate normal distribution.
--
View this message in context:
http://r.789695.n4.nabble.com/Bivariate-normal-integral-tp4571018p4639041.html
Sent from the R help mailing list archive at
HI,
I modified the code, thanks to Tejas. Now, the results look like
fun1-function(x)
ifelse(x10^7,gsub(\\d)[.].*,\\1,x),ifelse(x10^7
x1,formatC(x,width=length(x),format=fg,digits=8,flag=,drop0trailing=FALSE),sprintf(%.3f,x)))
fun1(VALUES)
[1] 123456789 12345678 1234567.9
Hi David,
Thanks for response, but my key question still remains unsolved. That is, how
to add many vectors (L1,L2,L3) to many list objects (a.list,
b.list) in a workspace?
listObjects=ls(pattern=.list) #for example, a.list, b.list...
for (object in listObjects){
#how to sign
HI,
If you want both the duplicated IDs and nonduplicated IDs to be printed,
ID - sample(1:10, 10, replace=TRUE)
ID
# [1] 3 7 5 8 1 5 4 6 7 2
ID[!duplicated(ID)]
#[1] 3 7 5 8 1 4 6 2
ID2-c(4,4,4,3,4,1,2,5,7,4,3,2,5,9,8,12,A1,A2,A1,B1)
ID2[!duplicated(ID2)]
# [1] 4 3 1 2 5 7 9 8
Hi,
Please check this link:
(http://r.789695.n4.nabble.com/calculations-with-vectors-of-unequal-length-td3477848.html)
A.K.
- Original Message -
From: Alaios ala...@yahoo.com
To: R help R-help@r-project.org
Cc:
Sent: Friday, August 3, 2012 9:13 AM
Subject: [R] Sum two Vectors of
How about providing the data for at least one subject/8 occasions using
dput(dataframe)? This line at the bottom of your message: provide
commented, minimal, self-contained, reproducible code is important. Nothing
you sent allows us to reproduce what you are doing and suggest ways to
improve it.
Hello,
The package pbivnorm will solve your problem.
http://cran.r-project.org/web/packages/pbivnorm/index.html
--
View this message in context:
http://r.789695.n4.nabble.com/bivariate-normal-tp4638159p4639048.html
Sent from the R help mailing list archive at Nabble.com.
I am interested in estimating a panel model with time fixed effects, random
cross-sectional effects and AR(1) error. I am using the plm package. I would
be grateful if you could give me some guidance on how to do it in R.
Thanks in advance.
--
View this message in context:
Hello,
I'm trying to use the pmvnorm function of the mvtnorm to compute the CDF of
the multinormal distribution in rather high dimension (say 100, but 1000
would be nice).
To accelerate the calculations I want to decrease the precision of the
numerical integration, through the GenzBretz()
Wolfgang,
Thanks for your quick response. You are correct- indeed I had inadvertently
left out that i had set intercept = FALSE in rma.
Following your suggestions, I get the following results:
Test of Moderators (coefficient(s) 2,3):
QM(df = 2) = 0.2207, p-val = 0.8955
Model Results:
Yep, you are right, this works:
readCell - function(workbook, sheetName, i, j) {
pos - getSheetPos(workbook, sheetName)
readWorksheet(workbook, pos, startRow=i, endRow=i, startCol=j, endCol=j,
header=FALSE)[[1]]
}
2012/7/17 Rui Barradas ruipbarra...@sapo.pt
Hello,
Sorry, but I'm not at my
My apologies, I know that this is not a new problem, but I'm not sure how
to find the answer
I want to recursively loop over an object and trim trailing white space.
When I use this function on a list of data.frame I get output like this:
[1] c(\ many spaces \, \ many spaces \) c(\ many
I am sorry either naivety with group. I will follow the instructions from
now.
Regards,
Ayyappa
On Aug 3, 2012, at 12:18 PM, David L Carlson dcarl...@tamu.edu wrote:
How about providing the data for at least one subject/8 occasions using
dput(dataframe)? This line at the bottom of your
?merge and ?unique might help
however: why is calee_id a floating point number? Ids are usually stuff thats
close to a factor, integers, strings and the like, you know stuff that has a
value that isn't dependant on precision. Floating points might just complicate
things..
On 03.08.2012, at
Generally multiple comparisons are conducted after a test for a significant
difference among any of the groups. For your data
kruskal.test(x[,1]~x[,2])
Kruskal-Wallis rank sum test
data: x[, 1] by x[, 2]
Kruskal-Wallis chi-squared = 11.0098, df = 10, p-value = 0.3568
There are no
Hi Michael,
many thanks for your comment.
Below the original data as imported from Stata format. I deleted some
columns with explaining variables because they were unnecessary and working;
the model has several explaining variables with generic regression
coefficients.
pid Choice V7.Ch 1
Hi Weijia,
Try this:
dat1-read.table(text=
ID AGE GENER LDL
1 25 M 137
1 25 M 125
2 34 F 108
3 30 F 150
3 30 F 147
3 30 F 165
,sep=,header=TRUE,stringsAsFactors=FALSE)
Recursively loop over an object is a pretty meaningless phrase,
since it depends entirely on the structure of the object. For example,
a character vector is an object, and there is no need for any sort of
recursion to do what you want for it.
The following regex example trims trailing spaces (see
Thank you!
Dan
From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Sent: Thursday, August 02, 2012 5:51 PM
To: Lopez, Dan
Cc: R help (r-help@r-project.org)
Subject: Re: [R] Plotting Where People Live on a U.S. Map
Hi Dan,
For question 1, yes you'll need geographic coordinates. I thinknit's
I'm trying to install and run the Conjoint package, and I get the error:
Error: could not find function caFactorialDesign
I'm running R 2.15.1 on Mac OS X. I have installed the package Conjoint
with the Install Dependencies checkbox checked. I have clicked the Update
All button in the R
Hi,
It would be useful to have more information and a reproducible example.
For instance :
1. Why such margin at the left side ?
2. Why do you have the same problem when you plot the legend at the
bottom ? Have you tried to define the exact (x,y) location ?
3. Why do you say cex doesn't affect
I'm trying to run the Conjoint package, and I receive the error:
Error: could not find function caFactorialDesign
I'm running R version 2.15.1 on Mac OS X. I have installed the Conjoint
package with the Install Dependencies checkbox checked. I have clicked the
Update All button in the R
Hi Vik,
You don't need to post to nabble and to the R-help list. Just skip the
nabble step!
Have you loaded the package with:
library(conjoint) # not Conjoint
before you try to use any of its functions?
Sarah
On Fri, Aug 3, 2012 at 1:23 PM, Vik Rubenfeld v...@mindspring.com wrote:
I'm
Thanks very much for this info, Sarah!
I have used library(conjoint). Here are the commands used:
library(conjoint)
experiment = expand.grid(
+ price = c(low, medium, high),
+ variety = c(black, green, red),
+ kind = c(bags, granulated, leafy),
+ aroma = c(yes, no))
Hi,
On Fri, Aug 3, 2012 at 1:57 PM, Vik Rubenfeld v...@mindspring.com wrote:
Thanks very much for this info, Sarah!
I have used library(conjoint). Here are the commands used:
library(conjoint)
experiment = expand.grid(
+ price = c(low, medium, high),
+ variety = c(black, green, red),
+
Hi Nerea,
For some reason your post is badl garbled and close to imposible to read.
Perhaps you need to check your text encoding?
Also to send sample data it is better to use the dput() command.
Do dput(myfile) and then paste the results into your email
Sorry not to be of more help.
John
With conjoint_1.33 and rather up to date dependencies, I don't see
caFactorialDesign and neither does getAnywhere().
Vik, do you have a citation that suggests this function exists? The
closest I find is gen.factorial() in the AlgDesign package.
The findFn function in the sos library might also
Note that this is a common enough case that Hadley provides for it
with the str_trim() function in his stringr package.
Best,
Michael
On Fri, Aug 3, 2012 at 12:02 PM, Bert Gunter gunter.ber...@gene.com wrote:
Recursively loop over an object is a pretty meaningless phrase,
since it depends
On Fri, Aug 3, 2012 at 11:49 AM, Lee van Cleef l.van.cl...@gmx.net wrote:
Hi Michael,
many thanks for your comment.
Below the original data as imported from Stata format.
Hi Lee,
I apologize for being intransigent (well, no -- I actually don't) but
could you provide your data using dput()
Hi arunkumar,
I've asked you many times to work on providing reproducible examples
-- I'll direct you to this page again which describes how to do so:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
without one, there's not much anyone can do, but
On Fri, Aug 3, 2012 at 2:23 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
With conjoint_1.33 and rather up to date dependencies, I don't see
caFactorialDesign and neither does getAnywhere().
The function is present in conjoint 1.34, the current version on CRAN.
Rarely do I have to
Here is the output of sessionInfo():
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
On Fri, Aug 3, 2012 at 2:40 PM, Vik Rubenfeld v...@mindspring.com wrote:
Here is the output of sessionInfo():
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached
On Fri, Aug 3, 2012 at 1:34 PM, Sarah Goslee sarah.gos...@gmail.com wrote:
On Fri, Aug 3, 2012 at 2:23 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
With conjoint_1.33 and rather up to date dependencies, I don't see
caFactorialDesign and neither does getAnywhere().
The function
On Aug 3, 2012, at 8:19 AM, John linux-user wrote:
Hi David,
Thanks for response, but my key question still remains unsolved.
That is, how to add many vectors (L1,L2,L3) to many list objects
(a.list, b.list) in a workspace?
listObjects=ls(pattern=.list) #for example, a.list,
Hello,
This seems to work.
trim2 - function(x) {
if(is.atomic(x))
gsub(^[[:space:]]+|[[:space:]]+$, , x)
else
sapply(x, function(y) trim2(y))
}
# Tests
trim2(tempobj)
trim2(tempvec)
trim2(templist)
trim2(tempdf)
# Extra test
templistlist - list(templist, list(tempobj,
Hi,
Here is my data, the first 10 rows
u=regCond_all[1:10,]
dput(u)
structure(c(999, 999, 999, 999, 999, 999, 999, 999, 999, 999,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 1.9, 2, 1.97, 1.99, 1.83, 1.78, 1.6, 1.52, 1.52,
1.36, 10.53, 9.88, 9.88, 10.53,
Hi Yolande,
What's index() ?
I get
ind - which.min( abs(index(regCond_all) - thisStamp ))
Error in which.min(abs(index(regCond_all) - thisStamp)) :
could not find function index
There's probably an easier way to do whatever you're trying to
accomplish, but I'm afraid I can't tell what that
After replacing it to u
for(i in 1:dim(diveCond)[1]){
+ thisStamp - as.POSIXct(strptime(diveCond$timestamp[i], %Y-%m-%d
%H:%M:%S))
+ ind - which.min( abs(index(u) - thisStamp ))
+ diveCond$r_wvht[i]- u$WVHT[ind]
+ diveCond$r_dpd[i]- u$DPD[ind]
+ diveCond$r_apt[i] - u$APD[ind]
+
That's really not what my previous post asked for
(nor does it look like R at all in your photo!)
All I can suggest is you put your data in some sort of matrix
structure and look at the ?cor and ?cor.test functions.
Note that summary count statistics are often not enough to discern
correlation
On Fri, Aug 3, 2012 at 4:04 PM, Yolande Tra yolande@gmail.com wrote:
I am sorry I forgot to mention it in the code.
library(xts) has the function index.
That's useful. But here's your first problem:
thisStamp - as.POSIXct(strptime(diveCond$timestamp[i], %Y-%m-%d %H:%M:%S))
You just
On Wed, Aug 1, 2012 at 4:34 PM, Xu Jun junx...@gmail.com wrote:
Thanks Michael. Now I switched my approach after doing some google.
Following are my new codes:
###
library(foreign)
readin - read.dta(ordfile.dta, convert.factors=FALSE)
All,
Is this typical of how people will print a summary of results?
CoinTosses - function(n) {
x - sample(c(0,1), n, replace=TRUE)
y - x
y[y==0] - T
y[y==1] - H
numHeads - sum(x)
numTails - n-sum(x)
p - numHeads/n
cat(cat(y,sep=),\n)
cat(Number of heads: , numHeads, \n)
Yolande,
Please send your message to the R-help email list too, not just to me.
On Fri, Aug 3, 2012 at 4:28 PM, Yolande Tra yolande@gmail.com wrote:
Here is the description
I am trying to build the data diveCond from two datasets diveData_2008,
diveData_2009 and RegCond_all. How would I
Hi,
I find it better to return a named list so that users can do what they
want with the results rather than just looking at them, which is all
your approach allows. That's not incompatible with printing the
results to the screen as well:
CoinTosses - function(n, verbose=TRUE) {
x -
On Fri, Aug 3, 2012 at 3:34 PM, darnold dwarnol...@suddenlink.net wrote:
All,
Is this typical of how people will print a summary of results?
CoinTosses - function(n) {
x - sample(c(0,1), n, replace=TRUE)
y - x
y[y==0] - T
y[y==1] - H
numHeads - sum(x)
numTails - n-sum(x)
All,
Can someone explain why this does not print the contents of x when I source
this file?
CoinTosses - function(n,print=TRUE) {
x - sample(c(0,1), n, replace=TRUE)
y - x
y[y==0] - T
y[y==1] - H
p - sum(x)/n
p
}
x - CoinTosses(40)
x
On the other hand, if I source this file:
On Fri, Aug 3, 2012 at 3:39 PM, darnold dwarnol...@suddenlink.net wrote:
All,
Can someone explain why this does not print the contents of x when I source
this file?
CoinTosses - function(n,print=TRUE) {
x - sample(c(0,1), n, replace=TRUE)
y - x
y[y==0] - T
y[y==1] - H
p -
On Fri, Aug 3, 2012 at 12:19 PM, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
This seems to work.
trim2 - function(x) {
if(is.atomic(x))
gsub(^[[:space:]]+|[[:space:]]+$, , x)
else
sapply(x, function(y) trim2(y))
}
Using sapply is a bit dangerous here.
When i == 10, what is ind?
diveCond$r_apt[10]
regCond_all$APD[ind]
Providing a subset is unhelpful. I gave you explicit dput() code to
use; that's how we need data to be provided.
I've given you various suggestions; if you don't implement them then
there's not much point in me trying to help.
Source()-ing turns off the auto-printing that normally happens at the
command line. This is a feature, because source()ing is often used to
set up things automatically behind the scenes that most folks don't
need.
If you want to force a print, put in a print() command explicitly.
Or use
Hi,
Here, I am getting the error:
for(i in 1:dim(diveCond)[1]){
thisStamp - as.POSIXct(strptime(diveCond$timestamp[i], %Y-%m-%d
%H:%M:%S))
ind - which.min( abs(index(regCond_all) - thisStamp ))
diveCond$r_wvht[i] - regCond_all$WVHT[ind]
diveCond$r_dpd[i] - regCond_all$DPD[ind]
Rui,
Yes, that's exactly it, thanks!!
I wouldn't have thought of the is.atomic. I was going after a series of
tests for dimension and is.list.
@ R. Michael Weylandt
Good point!
Also, thanks for mentioning stringr. I always forget about that one.
It's nice that R keeps the base function list
This runs, so there must be something else going on that you haven't
told us about.
diveCond - structure(list(dive_id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
timestamp = c(2008-08-06 08:49:00,
2008-08-06 10:03:00, 2008-08-06 10:25:00, 2008-08-08 09:42:00,
2008-08-08 10:53:00, 2008-08-08 12:42:00,
Hi, I'm a new user or R and I try to concatenate a several rows according
with the value in a column.
this is my data.frame and I want to concatenate my data.frame according with
the column b and make a new data.frame with the information in the others
columns.
table1
a
On Fri, Aug 3, 2012 at 2:53 PM, John linux-user johnlinuxu...@yahoo.com wrote:
Maybe what I previously posted was not clear enough or something else. All
vectors L1,L2.. and objects (e.g. a.list, b.list, c.list) already exit or
easily to be created in a workspace. Do not worry about those.
1 - 100 of 127 matches
Mail list logo