similar to: Beginner question: How to replace part of a filename in read.csv?

Displaying 20 results from an estimated 1000 matches similar to: "Beginner question: How to replace part of a filename in read.csv?"

2011 Feb 28
3
re-arranging data to create an image (or heatmap)
Let me start by introducing myself as a biologist with only a little knowledge about programming in matlab and R. In the past I have succesfully created my figures in matlab using the hist3d command, but I have not access to matlab right now and would like to switch to R. I have used the plot command to create a figure of my data and it does almost what I want it to do. My data matrix looks like
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2012 Sep 20
3
lattice dotplot reorder contiguous levels
my reproducible example test<-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), .Label = c("A", "B", "C", "D", "E"), class = "factor"),
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
(To the list moderator: I just subscribed to the list. Apologies for not having done so longer before trying to post.) Hi all, I am currently using lmer to analyze data from an experiment with a single fixed factor (treatment, 6 levels) and a single random factor (block). I've been trying to follow the online guidance for estimating p-values for parameter estimates on these and other
2000 Feb 24
2
(-1 as index) OR (envelope for QQ)
I'm new to R (and to S) and am wondering about code from pages 72 and 83 of MASS (Venables+Ripley, 3rd edition), to draw an envelope on a QQ plot. Copying from the book, I've got: #... code whose gist is "a.fit <- nls(..." num.points <- length(resid(a.fit)) qqnorm(residuals(a.fit)) # illustrate data-model residuals qqline(residuals(a.fit)) samp <-
2004 Mar 01
6
How to plot Histogram with frequence overlaid by distribution curve
Hi, I am facing the problem that I want to plot a histogram chart set freq to true and overlay with normal or weibull or exponential distribution curve. The sample code is shown as below: >samp<-c(-8.2262,-8.2262,-8.2262,-8.20209,-8.09294,-8.07321,-8.07321, -8.07321,-8.07175,-8.04948,-8.04948,-8.04948,-8.03848,-8.03848,
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
Dear all, I am currently analyzing count data from a hierarchical design, and I?ve tried to follow the suggestions for a correct estimation of p-values as discusssed at R-Wiki (http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests&s=lme%20and%20aov). However, I have the problem that my model only consists of parameters with just 1 d.f. (intercepts, slopes), so that the
2007 Mar 12
2
Lmer Mcmc Summary and p values
Dear R users I am trying to obtain p-values for (quasi)poisson lmer models, including Markov-chain Monte Carlo sampling and the command summary. > > My problems is that p values derived from both these methods are totally different. My question is (1) there a bug in my code and > (2) How can I proceed, left with these uncertainties in the estimations of > the p-values? > > Below
2010 Oct 10
1
Query about .check_packages_used_in_examples
G'day all, looking at http://cran.at.r-project.org/web/checks/check_results_Sleuth2.html I noticed that r-prerel-* and r-devel-* issue notes. Apparently, now examples are more thoroughly checked by R CMD check and the note pointed out that a package used in the examples was not declared. This was easily fixed by adding 'Suggests: lattice' to the DESCRIPTION file (now this change has
2017 Nov 12
0
create waveform sawtooth
Ccing the maintainer if the tuneR package. Looks to me like sawtooth (and square) don't behave as expected when using xunit="samples". Workaround is to use xunit="time" instead: sawtooth(110,duration=1/100,samp.rate=sample_rate,xunit="time") I looked at the code but found it to be opaque. -- Sent from my phone. Please excuse my brevity. On November 12, 2017
2007 Mar 13
1
lme4 and mcmcamp
Dear R users I am trying to obtain p-values for (quasi)poisson lmer models, using Markov-chain Monte Carlo sampling and the command summary. > > My problems is that p values derived from both these methods are totally different. My question is (1) there a bug in my code and > (2) How can I proceed, left with these uncertainties in the estimations of > the p-values? > > Below is
2006 Jun 23
1
Problems creating packages.
I'm creating my own package for personal and I'm having trouble getting it to a point where R (v 2.3.1) will recognise it. I've followed two different tutorials for how to create the package structure and the DESCRIPTION file ( http://web.maths.unsw.edu.au/~wand/webcpdg/rpack.html , http://www.maths.bris.ac.uk/~maman/computerstuff/Rhelp/Rpackages.html#Lin-Lin ). I'm still getting
2003 Jul 16
1
Help on NNET
Hi, Dear all, I am just starting using R in my work and got some trouble to figure out some of the errors. Can anybody help me? The following is the script: read.csv('pupil.txt',header=TRUE,sep='\t')->pupil samp<-c(1:50, 112:162, 171:220, 228:278) pupil.nn2 <- nnet(Type ~ ., data = pupil, subset = samp, size = 2, rang = 0.1, decay = 5e-4, maxit = 200)
2011 Oct 29
1
minor typos
R-devel doc/NEWS.Rd (SVN 57472) contains: \item There are two new options for typesetting PDF manuals from Rd files. These are \samp{beramono} and \samp{inconsolata}, and used the named font for mononspaced output. They are intended to be used in combination with \samp{times}, and \samp{times,inconsolata,hyper} is now the default for the reference manual and
2003 Apr 08
3
density ranges for uniform law
Hello, I would have some details and explanations about the results I get. In fact, I start with a uniform sample between -1 and 1, and then plot its density. My problem is that the density ranges are much more longer than I expected : samp <- runif(10000,-1,1) plot(density(samp)) Instead of varying between -1 and 1, the density varies between approximaly -1.5 and 1.5 Could someone explain
2012 Jun 07
2
[LLVMdev] no differnce in the execution time between seq. and parallel programs
Duncan Sands <baldrick <at> free.fr> writes: > > > I would be happy if you give me an insight into what could have caused the > > difference. > > No idea. Maybe you forgot to turn optimizations on when compiling? Otherwise > you are going to have to send in your programs along with an explanation of how > you compiled them exactly (exact sequence of
2011 Feb 10
3
Finding length of unique numbers in a vector
Hello there, would you please look into my codes? Here I have following: > set.seed(100) > samp <- sample(c(1,-1,0), 20, replace=T); samp [1] 1 1 -1 1 -1 -1 0 -1 -1 1 -1 0 1 -1 0 0 1 -1 -1 0 Here I want to calculate the length of each unique number for above vector. How can I do that? Thanks in advance [[alternative HTML version deleted]]
2008 May 23
2
About Passing Arguments to Function
Hi, Below I have a function mlogl_k, later it's called with "nlm" . __BEGIN__ vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) mlogl_k <- function( k_func, x_func, theta_func, samp) { tot_mll <- 0 for (comp in 1:k_func) { curr_mll <- (- sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) tot_mll <- tot_mll + curr_mll }
2007 May 02
2
how to reproduce the same sampled units?
Hi all, Is it possible to generate the same sample number of times in R? In SAS, using the option "seed" it is possible to reproduce exactly the same sample. Is there any such feature in R which I can use? For further clarity, for (i in 1:2) { samp = sample(1:1000,100,replace = FALSE) print(samp) } For the above simulation, is it possible to generate the same sampled units
2010 Jul 26
1
Is there a function to interdigitate two columns?
Hello List Inhabitants: I don?t know what this operation is called or if there is a function that does it automatically, hence I seek your help! If I divide a large data collection tasks between two students, and I have a master list of samples, but one student records some of the values, and the other student the remainder, I need to get the two sets of student measurements into one column.