这是使用宏变量的SAS代码,但是我正在R中尝试这样做。是否可以在R中使用Macro?
<?php
echo <<<htmlcode
<!DOCTYPE html>
<head>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>
htmlcode;
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if(isset($_POST["submit"])) {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". basename($_FILES["fileToUpload"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
?>
答案 0 :(得分:2)
在R中,您写用户functions
而不是SAS macros
。即如果您希望复制proc reg
(SAS)以在R中进行线性建模,则必须找到一个等效于此过程的R并对其进行参数化。我假设在R中您正在寻找lm
和predict
方法。