similar to: Add use of dput() to the instructions at bottom of post?

Displaying 20 results from an estimated 10000 matches similar to: "Add use of dput() to the instructions at bottom of post?"

2010 Aug 17
2
dims error
Greetings, I am a very novice user with R, and in the course of running a linking procedure : P.old<- function (a, c, b, xi){ #a contains a parameters #c contains c parameters #b contains b parameters #xi is a one column vector containing quadrature points for xi(=theta-gamma)for one item tmp <- a*(xi-b)
2011 Aug 15
3
how can I read a xlsx file
Hello, How can I read a xlsx file using xlsx package? Thanks Albert [[alternative HTML version deleted]]
2010 Sep 06
2
dataframe row names from list
Hi, I have a list which looks like this... > str(y) List of 10 $ : chr [1:4] "ABCD" "5" "0" "1" $ : chr [1:4] "DEF" "15" "1" "16" $ : chr [1:4] "AAA" "2" "17" "8" $ : chr [1:4] "SSS" "15" "25" "1" $ : chr [1:4] "III"
2010 Nov 01
2
number of items to replace is not a multiple of replacement length
Hey all, I am writing a function in which I will have a matrix of 4 columns and a variable amount of rows. The first to columns will always contain be of the Character type, the third and fourth columns can be a variation of data types, usually characters and integers, but sometimes lists or matrices. At one point the code makes, for each row, a copy of that row, then it makes some adjustments
2011 Aug 01
1
Write.table Question
Hi, I'm trying to create an abbreviated data file from a larger version. I can use the subset command to create a value for this data: dat <-subset(raw.data, select=c(SNP, Pvalue)) > head (dat) SNP Pvalue 1 rs11 0.6516 2 rs12 0.3311 3 rs13 0.5615 but when I try to write.table using: write.table (dat, file = "/path/to/my/data.txt", sep = " ",
2011 Oct 13
2
write.csv naming file after function argument
Dear R-users, I'm writing a program that constructs a dataset. I wish to save the dataset to a file. Here's a very simple example of what I'm trying to do function(x=peter){ y <- x/2 write.csv(y, file = "...\x") } The problem is that I want to name the dataset as whatever the name of the input is. In this case peter. How do I do this? Thank you in advance. Kristian
2011 Aug 30
1
R crash
Dear users, By running the script below, R crashes systematically at the last command, namely dev.off(), on Windows 7, but not on Windows XP. I therefore don't provide a reproducible example and do not really extract the relevant parts of the script because it has most likely nothing to do with the script itself. I can do it though if you think it might be relevant. R crashes on Windows
2011 Sep 27
2
searching several subsequences in a single string sequence
Hi all I am analyzing bird song element sequences. I would like to know how can I get how many times a given subsequence is found in single string sequence. For example: If I have this single sequence: ABCABAABABABCAB I am looking for the subsequence "ABC". Want I need to get here is that the subsequence is found twice. Any idea how can I do this? Thanks
2010 May 18
3
"Re: Change class factor to numeric"
sorry I had a mistake sending my question without a subject. I do resend again. Please excuse me. > Hello > I have a data array with soil variables (caperf), in which the variable "clay" is factor (as I see entering str(caperf)) . I need to do a regression model, so I need to have arcilla (=clay) as a numeric variable. For that I have entered > >
2011 Sep 09
2
get and save
I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to save 'tmp' under the name hidden in 'name', and the file must have the same name, plus the extension '.rda'. So I try > tmp x y 1 1 3 2 2 4 > name [1] "d2" > assign(name, tmp) > summary(get(name)) x y Min. :1.00 Min. :3.00 1st
2011 May 04
1
Str info. Thanks for helping
It looks from str(SA) that Response IPS1 is a data.frame of class "anova", which probably cannot be coerced to vector. Maybe you can use unlist() instead of as.vector() Or something like SA[["Response IPS1"]]["as.factor(WSD)",] ## to select the first row only, even maybe with unlist() Without a better REPRODUCIBLE example, I cannot tell more (maybe some others
2010 Nov 02
1
Setting the names of a data.frame
I have tData as below. I need to set the names with the headers from the first row in sHeaders Sorry .. forgot how to set the names from row in another data frame .. pls advise. names(tData) = sHeaders[1,] does not work correctly Also, why doesn't drop.levels(sHeaders) not work? dput(tData) structure(list(V1 = structure(c(3L, 1L, 1L, 2L), .Label = c("P H Ravi Kumar", "Rahul
2010 Oct 27
1
Fwd: as.list
-------- Original-Nachricht -------- Datum: Wed, 27 Oct 2010 15:03:48 +0200 Von: "Sibylle St?ckli" <sibylle.stoeckli at gmx.ch> An: Rhelp <r-help at r-project.org> Betreff: as.list Dear R-users sorry, here Rcode included (attachment has been removed) I would like to read a txt file as list, to select rows and columns, and to create barplots. (1) selection of parameter
2010 May 10
2
Extracting a subset
Hi, I have a dataset with many variables and observations. The variable Group has two levels: C and P, the Month variable has four levels: 0, 1, 2 and 3. I want to extract a subset of the variable Weight, considering only 1 and 3 levels for Months of the Group variable. I tried the command subset but it did not work. Any suggestions? Thanks, -------------------------------------- Silvano
2010 May 19
3
save in for loop
Dear users, My problem concerns save() within a for loop. Here is my code: for (i in 1:4) { temp <- data.frame(a=(i+1):(i+10), b=LETTERS[(i+1):(i+10)]) filename <- paste("file", i, sep="") assign(filename, temp) save(filename, file=paste(filename, ".rda", sep="")) } As you can see, save() doesn't work as I would like: (1) the object
2010 Aug 09
1
(no subject)
Hi there, I have been trying to use the "pvclust" package but have been having some difficulties. This is the first time I have used R so I am sure the mistake I am making is a basic one. The data I have is a distance matrix and I have been using the command; fit <- pvclust(cluster, nboot=1000, method.dist="euclidean") to try and perform hierarchical clustering with
2011 Mar 01
2
Simulation
I tried looking for help but I couldn't locate the exact solution. I have data that has several variables. I want to do several sample simulations using only two of the variables (eg: say you have data between people and properties owned. You only want to check how many in the samples will come up with bicycles) to estimate probabilities and that sort of thing. Now, I can only do a simulation
2010 Aug 04
2
barplot and x-axis font size
Hi all, I would like to draw a side by side bar plot.  How can I adjust the the font size for the x-axis?  Furthermore, I'm not sure what to write for 'at=?'.  I tried cex.axis and cex.lab but still fail.  Here is my data and code:   > t(all)            0-100 100-150  150-200 200-250 250-300 300-350 350-400 400-620 obs_data 382.000 177.000 156.0000    93.0 69.0000  45.000
2011 Mar 04
2
How to copy data from data.frame to matrix
Hello I'm a new in R I have a large data.frame "s" (this is actualy just a table in mysql) : > names(s) [1] "symbols", "day", "value" I need to convert it to simple matrix. I have define this matrix like this: > data.matrix <- matrix(nrow=nDays, ncol=nSymbols, dimnames=list(days, symbols)) then i just copy values to the matrix using for()
2011 Jun 15
3
Column of numbers added to dataframe when saving with read.csv
I have a dataframe object having the following structure FinalOutput[1:3,] GasDays 2011-03-31 2010-09-30 2010-10-31 2010-11-30 2010-12-31 2011-01-31 2011-02-28 1 2006-10-01 217303553 221205033 222824639 217016511 216093460 216477468 216834021 2 2006-10-02 231158527 234565250 236004109 231467851 230100639 230079907 230734064 3 2006-10-03 282062314 285427832 286372163