Displaying 20 results from an estimated 2000 matches similar to: "Scan and Lists"
2005 Sep 14
1
Importing IDL Structures
I am trying to get started with R, but before I do, I need to find a
way to import my existing datasets, which are currently stored as
arrays of IDL structures (RSI's IDL, not the other one).
The problem I has is this: the IDL structures contain scalar items, as
well as n-dimensional arrays. I can export the data in a number of
ways, including as separate files for scalars and for each of the
2007 Jan 16
1
RODBC: sqlQuery is successful, but a similar sqlFetch returns error
Greetings guRus --
I have successfully queried a large (24,445 rows by 281 cols.) in-house
database using the following RODBC query (without the line breaks)
testout <- sqlQuery(channel, "select idSchedule,EXCL_Total from
dbo.vwC1198_2006_RawData_With_CMPL_EXCL")
This returns a dataframe of 24445 rows and two columns (as intended),
but the following command
testout
2010 Aug 31
1
odfWeave
Dear -r-helpers,
I'm trying to get my students to use odfWeave. Windows users are having
trouble. I would appreciate advice.
Comment 1:
Hello I have spent a while today trying to get odfWeave to be successful I
installed the unzip and zip program but it has not changed the error message.I
have copied the error message below but I am sure it is the one others have
experienced.
>
2017 Nov 01
0
Function to save results
Let's try a simple example.
> # Create a script file of commands
> # Note we must print the results of quantile explicitly
> cat("x <- rnorm(50)\nprint(quantile(x))\nstem(x)\n", file="Test.R")
>
> # Test it by running it to the console
> source("Test.R")
0% 25% 50% 75% 100%
-2.4736219 -0.7915433
2011 Jul 27
2
Writing a summary file in R
Hello,
I have an input file:
http://r.789695.n4.nabble.com/file/n3700031/testOut.txt testOut.txt
where col 1 is chromosome, column2 is start of region, column 3 is end of
region, column 4 and 5 is base position, column 6 is total reads, column 7
is methylation data, and column 8 is the strand.
I would like a summary output file such as:
2017 Nov 01
1
Function to save results
Hi David,Thank you for the example.When I try to use the cat function, I get an error
cat(attr<-getAttractors(net, type="asynchronous"))Error in cat(attr <- getAttractors(net, type = "asynchronous")) :
argument 1 (type 'pairlist') cannot be handled by 'cat'
Please let me know, if I have used the function in right way?.
Thank you
Priya
?
2011 Oct 25
2
column subtraction by row
Dear UseRs,
I have a data frame that looks like this:
head(test2)
attributes start end StemExplant Callus RegenPlant
1 LTR_Unknown 120 535 3.198 1.931 1.927
3 LTR_Unknown 2955 3218 0.541 0.103 0.613
6 LTR_Unknown 6210 6423 6.080 4.650 9.081
9 LTR_Unknown 9658 10124 0.238 0.117 0.347
14 LTR_Unknown 14699 14894 3.545 3.625
2011 Jul 13
1
[LLVMdev] "Can I use LLVM to convert C++ code to C code?"FAQ doesn't work
hi, I'm new to llvm and trying to convert some c files to bitcode and convert them back to c code.
my command line is pretty simple and verymuch like commands in "Can I use LLVM to convert C++ code to C code?"
dragonegg_disable_version_check=1 llvm-gcc -emit-llvm test.c -o test -c
llc -march=c test -o testout.c
so I meant to compile test.c, which can be compiled and run by normal
2008 Nov 05
1
Using RGDAL to "copy" header information...
R-geographers...
I'm trying to solve a problem to implement a line-by-line tiled
processing using RGDAL (read 1 line of an image, process the one line,
write one line of the image to a binary file). Everything except for
the final step I'm able to do using a combination of RGDAL and r-base
commands. Below is the basic structure, the input file "elev" can be
any image file
2017 Nov 01
3
Function to save results
Hi Eric,Thanks for the explanation. Is there a way to save the results automatically after the analysis gets over?. As I recently lost the results, because I didn't save the results. I don't want to run the sink or save command after the analysis is over rather run the command for saving the file before starting to run the analysis, so the file gets saved automatically after the script has
2008 May 30
1
Get all X iterations in optim output when controls(trace=6)
Hi,
I would like to get all X iterations in optim output in matrix form.
I know about the follow approach:
sink("reportOptim")
optim( ......., control=list( trace=6,..........) )
sink()
all_iterOptim <- readLines("reportOptim")
unlink("reportOptim")
all_iterOptim <- all_iterOptim[ grep( '^X', all_iterOptim ) ]
### TODO: the rest !!! :-)
But it is very
2004 Nov 11
6
scan or source a text file into a list
I've ported somebody else's rather cumbersome Matlab model to R for
colleagues that want a free build of the model with the same type of I/O.
The Matlab model reads a text file with the initial parameters specified as:
C:\Data\Carluc\Rport>more Params.R
# Number of years to simulate
nYears = 50;
# Initial year for graphing purposes
year0 = 1970;
# NPP/GPP ratio (cpp0 unitless)
fnr =
2017 Jun 30
2
Simplest way of executing a non-blocking (async) python AGI script?
OK, I give up and come grovelling, "Fork" was suggested at 18:23, it's
now 22:20 and I have been through 4 different methods, all block with
a 2 second delay before returning to dialplan.
Here are just some of the examples I have tried, as as per the
suggestions, I am closing all possible outputs in the forked process.
https://docs.python.org/3.5/library/multiprocessing.html
1997 Nov 12
4
R-alpha: batch
Back to my favourite R subject: batch mode. Some months ago, I pointed
out how the default of saving .RData automatically in batch can often
lead to completely erroneous results when using data.frames. Basically
the idea of .RData is to save the environment to start where one left
off. This will generally be quite different than where one started
the session. The idea of a batch file is to redo a
2017 Nov 01
0
Function to save results
No. You have not used it correctly. It was an example. Put your commands between the two sink functions. That will save any printed out put that results from those commands. It will not save attr, but you did not ask how to do that.
David C
On Nov 1, 2017 12:21 PM, Priya Arasu <galaxie2485 at yahoo.co.in> wrote:
Hi David,
Thank you for the example.
When I try to use the cat function, I get
2015 May 04
2
Define replacement functions
Hello
I tried to define replacement functions for the class "mylist". When I test them in an active R session, they work -- however, when I put them into a package, they don't. Why and how to fix?
make_my_list <- function( x, y ) {
return(structure(list(x, y, class="mylist")))
}
mylist <- make_my_list(1:4, letters[3:7])
mylist
mylist[['x']] <- 4:6
2017 Jun 15
4
is.null(mylist[1]) and is.null(mylist$a) returns different values
Hi
I have a list :
mylist <- list( a = NULL, b = 1, c = 2 )
> mylist[1]
$a
NULL
> is.null(mylist[1])
[1] FALSE
> is.null(mylist$a)
[1] TRUE
why? I need to use mylist[1]
2009 Oct 25
3
NULL elements in lists ... a nightmare
I can define a list containing NULL elements:
> myList <- list("aaa",NULL,TRUE)
> names(myList) <- c("first","second","third")
> myList
$first
[1] "aaa"
$second
NULL
$third
[1] TRUE
> length(myList)
[1] 3
However, if I assign NULL to any of the list element then such
element is deleted from the list:
> myList$second <-
2010 May 17
3
applying quantile to a list using values of another object as probs
Hi r-users,
I have a matrix B and a list of 3x3 matrices (mylist). I want to
calculate the quantiles in the list using each of the value of B as
probabilities.
The codes I wrote are:
B <- matrix (runif(12, 0, 1), 3, 4)
mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)})
for (i in 1:length(B))
{
quant <- lapply (mylist, quantile, probs=B[i])
}
But quant
2005 Mar 16
8
Summing up matrices in a list
Dear all,
I think that my question is very simple but I failed to solve it.
I have a list which elements are matrices like this:
>mylist
[[1]]
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
[[2]]
[,1] [,2] [,3]
[1,] 7 9 11
[2,] 8 10 12
I'd like to create a matrix M<-mylist[[1]]+mylist[[2]]
[,1] [,2] [,3]
[1,] 8 12 16
[2,] 10 14 18