Displaying 20 results from an estimated 10000 matches similar to: "printing intermediate lines while in a function"
2006 Aug 30
10
.Rprofile under Windoze.
I am (for my sins) having to do some work using R under Windoze. I
wanted to set up a .Rprofile to control my set-up. The docs on
.Rprofile say that it can/should be placed in ``the user's home
directory''. ``An Introduction to R'' observes lucidly that this
concept needs to be clarified under Windoze.
Following the suggestions in An Introduction to R, I tried
putting a
2004 Aug 05
1
Local library on Windoze.
I'm mystified by a Windoze ``phenomenon'' which has just bitten me.
I have a laptop which boots either Windoze or Linux; I (sad to say)
need the Windoze OS for teaching purposes. I have R 1.9.1 installed
on the laptop in the Windoze OS.
Just now I decided to install, under the Windoze version of R,
a library (``Misc'') of some local functions that I have collected
over the
2010 Oct 13
5
Regular expression to find value between brackets
Hi,
this should be an easy one, but I can't figure it out.
I have a vector of tests, with their units between brackets (if they have
units).
eg tests <- c("pH", "Assay (%)", "Impurity A(%)", "content (mg/ml)")
Now I would like to hava a function where I use a test as input, and which
returns the units
like:
f <- function (x) sub("\\)",
2004 Jul 16
3
rd2dvi bug on windoze?
hi,
can anyone confirm the following problem? when i do
dos> rcmd rd2dvi --pdf my-package-name
i get
dos> Can't open perl script "c:\PROGRA~1\r\rw1091/bin/rd2dvi": No such file or directory
might the problem be in (double back slashes rather than forward slashes)
R-1.9.1\src\gnuwin32\front-ends\rcmdfn.c(251): strcat(cmd, RHome); strcat(cmd, "/bin/Rd2dvi.sh");
2007 Mar 01
4
How to read in this data format?
Hi,
I recieved an ascii file, containing following information:
$$ Experiment Number:
$$ Associated Data:
FUNCTION 1
Scan 1
Retention Time 0.017
399.8112 184
399.8742 0
399.9372 152
....
Scan 2
Retention Time 0.021
399.8112 181
399.8742 1
399.9372 153
.....
I would like to import this data in R into a dataframe, where there is a
column time, the first numbers as column names, and the
2010 Jul 15
3
Access web content from within R
Hi,
I have to search in an online db for registered manufacturers of raw
materials.
Can I use R for the following:
I have a list with monograph numbers eg: l <- c(198, 731,355)
Now I want to make a dataframe, containing the monograph number and the
information listed under COS:
Certificate holder, certificate number, Status, Type
Is this possible with R?
kind regards
Bart
--
View this
2006 Sep 01
2
Local library under Windoze.
Continuing to try to customize my environment for using R under
Windoze, I experimented with installing a package from CRAN in a
local library ``Lib''.
I created the directory ``Lib'' in the folder in which R starts,
and then executed
> install.packages("abind",lib="Lib")
Everything went according to form (I got prompted to choose a mirror,
etc.) until
2004 Dec 04
9
Excel *.xls files, RODBC
I gather from reading the back-issues of r-help that it should be
possible (modulo a number of caveats) to read an excel (yuck!) file
into R using RODBC. I have obtained and installed ODBC and the RODBC
package, but cannot for the life of me figure out how to go about
it. Can anyone give me a simple recipe?
I have an excel file on cdrom, say:
/mnt/cdrom/melvin.xls
I have started R and loaded
2009 Mar 06
1
Extract dates from dataframe
Hi,
I have the following dataframe:
ID Dates
1 16-07-01 06-10-95
2 24/01/02 06-10-95
3 16/01/02 16/08/94 12/01/91
And I would like to extract the dates, but couple the ID's to the right
dates, eg:
ID Dates
1 16-07-01
1 06-10-95
2 24-01-02
2 ....
I have no clue about how to get started, looks something for the
2013 Jan 24
4
sorting/grouping/classification problem?
Hi,
I'm a database admin for a database which manage chromatographic results of products during stability studies.
I use R for the reporting of the results in MS Word through R2wd.
But now I think I need your help:
suppose we have the following data frame:
ID rrt Mnd Result
1 0.45 0 0.10
1 0.48 0 0.30
1 1.24 0 0.50
2 0.45 3 0.20
2 0.48 3 0.60
2 1.22 3 0.40
3
2005 Dec 18
1
Fit non-lineair 3D Data
Hi,
I have a problem with fitting a model:
I made a dataframe with this data:
a <- 1:3
b <- 1:3
c <- c(3, 2, 3, 2, 1, 2, 3, 2, 3)
df <- expand.grid(a,b)
df$result <- c
names(df) <- c("A","B", "result")
Although I can make a graph of the data:
require(lattice)
wireframe(result~A*B, data=df)
I can't get a model to
2007 May 09
1
Fitting model with response and day bias
Hi,
I'm trying to fit a model which has a response bias, but also a day to day
bias.
If I try to simulate the data, I don't get the right values with optim, and
also I can't
use the function to give a prediction interval.
My simulated data are:
DF <- as.data.frame(cbind(x=rep(1:10,2),dag=rep(1:2,each=10)))
bias <- c(-0.2,0.5)
DF$y <- ((DF$x-0.1) * 5)+2 +
2006 Sep 01
1
Summary --- Local library under Windoze.
Prof. Brian Ripley solved the problem. He wrote:
> I was not aware that this works with relative paths for any version
> of R. Try using a full path, which always works for me.
I tried it using a full path, and bingo! It worked
like a charm.
Under Unix the relative path also works, but.
Prof. Ripley also remarked:
> If indeed your filesystem is readonly, you will have problems
2007 Feb 10
4
Near function?
Hi,
I have an integer which is extracted from a dataframe, which is sorted by another column of the dataframe.
Now I would like to remove some elements of the integer, which are near to others by their value. For example: integer: c(1,20,2,21) should be c(1,20).
I tried to write a function, but for some reason, somethings won't work
x <- 1:20
near <- function(x,th) {
nr <-
2008 Nov 24
3
count the cumulative for each subject
I have a data set like the following:
subject visit x1
1 1 0.5
1 2 1.2
1 3 0.7
2 1 0.4
2 2 0.6
2 3 1.0
.....
where x1 is the interval between the two visits. Now I want to calculate the
cumulative intervals since the beinging, for example
subject visit x1 cum
1 1 0.5 0.5
1 2 1.2 0.5+1.2
1 3 0.7 0.5+1.2+0.7
2 1 0.4 0.4
2 2 0.6 0.4+0.6
2 3 1.0 0.4+0.6+1.0
.....
is there an easy to generate the
2007 Aug 23
4
Calculating diameters of cirkels in a picture.
Hi,
Maybe this is more a programming questions than a specific R-project question, but maybe there is someone who can point me in the right direction.
I have a picture of cirkels which I took with a digital camera.
Now I want to use the diameter of the cirkels on the picture for analysis in R.
I can use pixmap to import the picture, but how do I find the outside cirkels and calculate the
2006 Jun 24
2
data frame search
Hi,
I want to make a data frame which contains the positions of some searched values in another data frame.
Like:
Dataframe 1:
1 2 3 4 1 2 3 4
2 3 4 1 2 3 4 2
4 1 2 3 2 3 4 1
Let's say I searched on "4", then Dataframe 2 should contain:
x y
1 4
1 8
2 3
2 7
3 1
3 7
I have written a routine, but it seems to me that it isn't that perfect:
x<- 0
2006 Jun 10
1
Maximum likelihood estimation of Regression parameters
Hi,
I want to use Maximum likelihood to estimate the parameters from my regression line.
I have purchased the book "Applied linear statistical models" from Neter, Kutner, nachtsheim & Wasserman, and in one of the first chapters, they use maximum likelihood to estimate the parameters.
Now I want to tried it for my self, but couldn't find the right function.
In the book, they give
2011 Nov 03
2
Problem with R CMD check and the inconsolata font business.
I have just installed R version 2.14.0 and tried to re-build and
re-check some
of the packages that I maintain.
I'm getting a warning (in the process of running R CMD check on my "deldir"
package):
> * checking PDF version of manual ... WARNING
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> LaTeX errors found:
> ! Font
2010 Jun 07
1
Help with seting up comparison
Hi,
I tried on this, but couldn't figure it out:
Suppose I have a dataframe as follows:
dat <- data.frame(Day=rep(rep(c(1,2), each=4),2), Animal = rep(c(1,2),
each=8), Count=c(rnorm(8, 100), rnorm(8,90)))
2 animals are being examined on 2 different days. Count is the result.
Now I need to point out whether or not there is a difference between the
days.
I did this by an ANOVA test, while