similar to: Question: Beginner stuck in a R cycle

Displaying 20 results from an estimated 500 matches similar to: "Question: Beginner stuck in a R cycle"

2008 Jul 22
4
Function Error
Hi, Why this function doesn't work? function (x) { if (is.factor(x)) { if (!is.ordered(x)) { warning("La mediana non si puo' calcolare!!!") return(NA) } me <- median(unclass(x)) if (me - floor(me) != 0) { warning("Mediana indeterminata") return(NA) } else
2013 Feb 02
2
create and save a simulated dataset
Hello, I am trying to learn how to create a simulated dataset of a forest stand: I must simulate 10 stands, for each of the stands I have been creating a random number of trees. For each tree I should create a random diameter. The problem I have is that I cannot use a matrix because the length of the three items is different. I was trying with list but I have no clue on how to make a dataset out
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2009 Feb 03
3
lapply and aggregate function
Dear list, I have two things I am struggling... # First set.seed(123) myD <- data.frame( Light = sample(LETTERS[1:2], 10, replace=T), Feed = sample(letters[1:5], 20, replace=T), value=rnorm(20) ) # Mean for Light myD$meanLight <- unlist( lapply( myD$Light, function(x) mean( myD$value[myD$Light == x]) ) ) # Mean for Feed
2010 Oct 12
5
aggregate with cumsum
Hello everybody, Data is myd <- data.frame(id1=rep(c("a","b","c"),each=3),id2=rep(1:3,3),val=rnorm(9)) I want to get a cumulative sum over each of id1. trying aggregate does not work myd$pcum <- aggregate(myd[,c("val")],list(orig=myd$id1),cumsum) Please suggest a solution. In real the dataframe is huge so looping with for and subsetting is not a
2013 Mar 20
3
highlight overlapping region of two densities
Hi all. I would like to highlight overlapping regions of two densities and I could not find a way to do it. Here is the sample code: myd <- c(2,4,5, 4,3,2,2,3,3,3,2,3,3,4,2,4,3,3,3,2,2.5, 2, 3,3, 2.3, 3, 3, 2, 3) myd1 <- myd-2 plot(range(density(myd)$x, density(myd1)$x), range(density(myd)$y, density(myd1)$y), type = "n") lines(density(myd), col=1, lwd=4)
2012 Jan 20
1
--link-dest doesn't work if target file exists (but needs updating)
Using: # rsync --version rsync version 3.0.7 protocol version 30 Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others. Web site: http://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv, symtimes rsync comes with ABSOLUTELY NO
2009 Jul 06
3
How to make big MySQL database more diffable/rsyncable? (aka rsyncing big files)
Hello group, I'm having a very hard time rsyncing efficiently a MySQL database which contains very large binary blobs. (Actually, it's the database of Mantis bug tracker [http://www.mantisbt.org/], with file attachments stored directly in the table rows. I know it's a bad idea from many other reasons, but let's say it was given to me as such.) First, I was dumping the
2005 Aug 18
3
Console
I am at my first steps with R... and I already notice that the console has a quite limited number of lines. Can anyone tell me how to visualise all the information, which is actually present? I only see the last part of the output, which obviosly exceeds the maximum number of rows in the console. Thank you very much for your help! Daniela [[alternative HTML version deleted]]
2007 Feb 23
1
how to use apply with two variables
Hi, this is a made-up example. Function "myfun" returns two arguments. Can "apply" be used so that "myfun" is called only once? Thanks Serguei mat<-matrix(runif(50),nrow=10,ncol=5) myfun<-function(x) { mymean<-mean(x) mysd<-sd(x) return(mymean,mysd) } out1<-t(apply(mat,1,function(x) myfun(x)$mymean)) out2<-t(apply(mat,1,function(x)
2010 Jun 23
2
About normality tests...
Hi all, I have two very large samples of data (10000+ data points) and would like to perform normality tests on it. I know that p < .05 means that a data set is considered as not normal with any of the two tests. I am also aware that large samples tend to lead more likely to normal results (Andy Field, 2005). I have a few questions to ensure that I am using them right. 1) The Shapiro-Wilk
2004 Jun 08
2
clustalw
Hi, I'm using the function clustalw in packages dna, but every time i have a segmentation fault! In your opinion What is the problem?Memory? Please help me!!!! Daniela
2009 Sep 25
1
R CMD INSTALL --build: Folders /inst and /etc not in zip-file and WindowsXP locks /library/[package]/etc/
Dear R users, My set-up: OS=Windows XP, R-2.9.2, Rtools210 I faced the follwing problem with the package compilation: There is no "/inst" or "/etc" subdirectory in the package-zip-file. And the content of the "/etc" subdirectory is lost, too. I tried a simplified "test" package. The "test" package has the following structure (see also attachement:
2023 Nov 28
1
Setting up Profiles share... 777?!
In a fresh samba AD domain i'm setting up the 'Profiles' share for roaming profiles, following the wiki: https://wiki.samba.org/index.php/Roaming_Windows_User_Profiles https://wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs leading to: [profiles] comment = Network Profiles Share csc policy = disable map acl inherit = Yes path = /srv/samba/profiles read only =
2007 Mar 09
1
dendrogram again
Hi all, ok, i know i can cut a dendrogram, which i did. all i get is three objects that a dendrograms itself. for example: myd$upper, myd$lower[[1]], myd$lower[[2]] and so on. of course i can plot them seperately now. but the lower parts still have hundreds of branches. i?ll need a 30 " widescreen to watch the whole picture. what i?d like to is group the lower branches , so that i get a
2007 Jul 07
1
calculating p-values of columns in a dataframe
I have a dataframe ("mydf") that contains "differences of means". I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a "good" method to calculate/look-up the p-value for each column? mydf=data.frame(a=c(1,-22,3,-4),b=c(5,-6,-7,9)) mymean=mean(mydf) mysd=sd(mydf)
2009 Sep 13
2
(no subject)
How would I make a histogram using R from a table in excel that has 4 variables, but I only want to use 2 of the columns to make the histogram? [[alternative HTML version deleted]]
2008 Jul 25
3
Maximization under constraits
I''m looking for a R function which can maximise this logliklihood function, under the constraits a>0 e b>0 f<-function(param){ a<-param[1] b <-param[2] log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi ))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)))))} I''ve tried maxlik constrOptim e donlp2 but without success. Thanks so
2004 Apr 01
5
boot question
What in the world am I missing?? > x<-rnorm(20) > mean(x) [1] -0.2272851 > results<-boot(x,mean,R=5) > results[2] $t [,1] [1,] -0.2294562 [2,] -0.2294562 [3,] -0.2294562 [4,] -0.2294562 [5,] -0.2294562 Jeff Morris Ortho-Clinical Diagnostics A Johnson & Johnson Co. Rochester, NY Tel: (585) 453-5794 [[alternative HTML version deleted]]
2010 Jun 29
1
Sweave, xtable plus/minus sign
Dear R-users, please consider the following minimal example: \documentclass[a4paper,titlepage,onecolumn,12pt]{article} \usepackage[italian]{babel} \usepackage{amssymb} \usepackage[utf8x]{inputenc} \usepackage[pdftex]{graphicx} \begin{document} <<label=test, echo=FALSE, results=tex>>= df.data1 <- cbind.data.frame(A = rnorm(18), B =factor(rep(LETTERS[1:6],